Encode text to Base64
This tool turns the text you type into a Base64 string. Base64 exists to carry data through channels that only accept plain ASCII characters: email attachments, images embedded in a page with a data URI, the HTTP Basic authentication header, or a binary value stored inside a JSON or XML file.
Your text is read as UTF-8 and encoded with the standard alphabet: upper and lower case letters, digits, + and /.
To get the original text back, paste the string into the Base64 decoding online tool.
How to use it
- Paste or type your text in the input box.
- Click the encode button.
- The result appears in the green box underneath.
- Click the copy button to send it to your clipboard.
How Base64 works
The encoder splits the data into groups of 3 bytes (24 bits) and rewrites each group as 4 characters of 6 bits. The output is therefore about one third longer than the input: 300 bytes become 400 characters. When the last group is incomplete, it is filled with one or two = signs.
| Text | Base64 |
|---|---|
Man | TWFu |
Ma | TWE= |
M | TQ== |
Hello, World! | SGVsbG8sIFdvcmxkIQ== |
Accented letters weigh more than they look: in UTF-8, "é" takes 2 bytes. That is why café (5 bytes) gives Y2Fmw6k=, 8 characters long.
Common mistakes
- Treating it as encryption. Anyone can decode Base64, no key needed. It protects neither a password nor confidential data. For a fingerprint that cannot be reversed, use the SHA256 generator instead.
- Dropping the result straight into a URL. The characters
+,/and=have a special meaning there. The URL-safe variant, used by JWT tokens, replaces+with-,/with_and removes the=signs. This tool outputs the standard alphabet, so make those replacements by hand when you need them. - Overlooking a space or a line break. Every character counts, including the ones you cannot see. A trailing newline changes the result.
Frequently asked questions
Why does the result end with =?
Because the length of your text is not a multiple of 3 bytes. One = means the last group was one byte short, two = signs mean it was two bytes short.
Can I encode an image or a file?
No. The tool only encodes the text typed in the box; there is no file upload. For a picture, go through the image to Base64 converter, which also gives you the data URI.
Is my text stored?
The text is sent to our server over HTTPS for the time of the calculation. It is not saved. To be on the safe side, still avoid pasting a real password.