Base64 Encode
Free Base64 encoder: convert text or any file to Base64 with UTF-8 support, URL-safe output, optional padding and 76-character lines. Runs in your browser.
How to use Base64 Encode
- 1Type or paste text, or choose Encode file to use any file's bytes.
- 2Choose URL-safe, padding and line-break options if you need them.
- 3Copy the Base64 or download it as base64.txt.
What makes it better
- UTF-8 safe: emoji and non-Latin text encode correctly
- URL-safe alphabet (- and _), optional = padding
- Optional line breaks every 76 characters (MIME)
- Encodes any file up to 25 MB and shows the size growth
- Live result with copy and download
About Base64 Encode
Base64 Encode turns text, or the bytes of any file you open, into the 64-character alphabet that email, JSON and URLs can carry safely. Text is converted as UTF-8, so emoji and non-Latin scripts such as Hindi or Japanese round-trip correctly. Files up to 25 MB are supported, and the result shows how much larger the encoded form is.
Common uses
- Put a small binary value, such as a key or certificate body, into a JSON or YAML config.
- Build the user:password string for an HTTP Basic Authorization header.
- Create a URL-safe token or filename-safe string from arbitrary text.
- Prepare an attachment body for an email or API that only accepts text.
Example
Input
Hello, Security Tools! नमस्ते 👋
Result
SGVsbG8sIFNlY3VyaXR5IFRvb2xzISDgpKjgpK7gpLjgpY3gpKTgpYcg8J+Riw==
Good to know
- Base64 is an encoding, not encryption. Anyone can decode it, so never use it to hide passwords or secrets.
- Encoded data is about 33% larger than the original (every 3 bytes become 4 characters), and about 37% larger with 76-character line breaks.
- Text is encoded as UTF-8. Systems that expect another charset such as Latin-1 or UTF-16 will produce different Base64 for the same text.
Base64 Encode FAQ
How do I encode text to Base64?
Paste your text into the box. The Base64 appears immediately on the right. The text is converted to UTF-8 bytes first, then each group of three bytes becomes four Base64 characters.
What is URL-safe Base64?
Standard Base64 uses + and /, which have special meaning in URLs. The URL-safe variant swaps them for - and _ so the result can sit in a query string or filename. Tokens such as JWTs use it, usually without = padding.
Why does the output end with = signs?
Padding fills the last group to four characters when the input length is not a multiple of three. One or two = signs appear at the end. Turn off Keep padding if your target format, such as JWT, expects none.
What does the 76-character line break option do?
It starts a new line after every 76 characters, the layout defined for MIME email and used by PEM files. Most APIs and web code expect a single unbroken line, so leave it off unless a format asks for it.
Can I encode a file instead of text?
Yes. Choose Encode file and pick any file up to 25 MB. Its bytes are encoded directly, so the result is not limited to text files. Large files take a moment and make a long output.