Base64 to Text and Text to Base64 Converter
Encode text to Base64 or decode Base64 back to text, with full Unicode support.
About Base64 Encoder / Decoder
Base64 Encoder / Decoder converts between ordinary text and Base64, a set of 64 letters, digits and symbols that lets arbitrary bytes travel through systems built for plain text. Choose Encode or Decode with the toggle, type in the left box, and the answer appears in the right box on every keystroke. Swap moves the output into the input and flips the mode.
Developers use it to read the credentials in a Basic authentication header, to look at a value stored in a Kubernetes secret or CI variable, to check what a data URI or email header contains, or to prepare a short string for an API that expects Base64. Students in networking and security classes use it to watch how every three bytes become four characters.
Base64 is an encoding, not encryption: there is no key, and anyone can reverse it, so it hides nothing. This tool handles text only. Text is converted to UTF-8 bytes first, so Urdu, Arabic and emoji survive a round trip. It uses the standard alphabet with = padding and does not accept files.
How to use Base64 Encoder / Decoder
- Choose Encode to turn text into Base64, or Decode to turn Base64 back into text. The highlighted button is the active mode.
- Type or paste into the left box. The right box fills in at once; there is no convert button to press.
- If the right box stays empty and a red "Invalid input for this mode." message appears, check that you are in the right mode and that the text is genuine Base64.
- Click Swap to move the current output into the input box and switch to the opposite mode, which is a quick way to check a round trip.
- Click Copy output to copy the right-hand result; the status line then says "Copied to clipboard."
Tips for best results
- Remove any prefix such as data:image/png;base64, before decoding. The colon, semicolon and comma are not Base64 characters, so only the part after the comma should be pasted.
- Spaces, line breaks and missing = padding are tolerated, so text wrapped over several lines, as in many email attachments, decodes without cleanup.
- Decoding assumes the result is UTF-8 text. If the Base64 actually holds an image, PDF or other binary, you will see replacement characters instead of an error, and copying them will not rebuild the file.
- URL-safe Base64, used in JWTs and some web addresses, replaces + and / with - and _. Change those two characters back by hand, or use the JWT Decoder on this site for tokens.
- Do not treat an encoded string as protected. An encoded password or API key is exactly as sensitive as the original, so keep live secrets out of chats and screenshots.
Frequently asked questions
Does this tool support Unicode characters?
Yes. Text is encoded as UTF-8 before Base64 conversion, so emoji and non-Latin scripts round-trip correctly.
Is my data sent to a server?
No, encoding and decoding both happen locally in your browser using standard JavaScript APIs.
What happens if I try to decode invalid Base64?
Malformed Base64 shows an error message. Valid Base64 that holds binary data rather than text, such as an image, decodes to replacement characters, because this tool reads the result as UTF-8 text.
Is Base64 the same as encryption?
No. Base64 only changes how data is written; it has no key or secret, so anyone can decode it. Use real encryption when content must stay private.
Why is the Base64 version longer than my text?
Every 3 bytes of input become 4 Base64 characters, so the output is about a third longer, plus any padding. Non-English text takes more bytes in UTF-8, so it grows further.
Can I encode an image or a file with this tool?
No. Only text that you type or paste is accepted; there is no file picker. Decoding a file's Base64 here shows text, not a downloadable file.
Why does decoding fail when my text contains - or _?
Those characters belong to URL-safe Base64, while this tool decodes only the standard alphabet (A-Z, a-z, 0-9, + and /). Swap - for + and _ for / and try again.