Base64 Encoder/Decoder
Encode text to Base64 or decode it back, with full Unicode support. Base64 turns arbitrary text into a plain alphanumeric string that survives passing through systems built to handle only simple characters — which is why it appears in data URIs, authentication headers and email attachments.
How to encode or decode Base64
- Paste your text or Base64 string into the input box.
- Tap Encode or Decode.
- Copy the result from the output box.
When you'd use this
- API work — Basic authentication headers and many tokens are Base64-encoded.
- Data URIs — Embedding a small asset directly inside HTML or CSS.
- Debugging — Decoding a Base64 string found in a log or a config file to see what it holds.
- Configuration — Values stored encoded rather than as plain readable text.
Good to know
- Unicode is handled properly — Text is encoded as UTF-8 first, so accented letters, non-Latin scripts and emoji all survive a round trip. Many simple implementations get this wrong and quietly mangle them.
- Bad input is reported — If a string is not valid Base64, or does not decode to valid UTF-8 text, the tool says so rather than handing back garbage.
- Base64 is not encryption — It is an encoding, not a cipher. Anyone can reverse it in seconds. Never use it to protect anything.
- Encoded text is larger — Base64 adds roughly a third to the size, because it represents every three bytes with four characters.
Frequently asked questions
What is Base64 used for?
Base64 turns arbitrary bytes into plain ASCII text, so binary-unfriendly places — like a URL, an email body, a JSON field or a data: URI — can carry it safely. It's an encoding, not encryption — anyone can decode it back instantly, so never use it to hide sensitive data.
Does this handle emoji and non-English text correctly?
Yes. Text is converted to UTF-8 bytes before encoding, and decoded the same way back to text, so Hindi, emoji and other non-Latin scripts round-trip correctly rather than turning into garbled characters.
Why did decoding fail?
The Decode button expects valid Base64 — only the letters A–Z, a–z, 0–9, +, / and = padding. If the text you pasted has line breaks, extra spaces, or isn't Base64 at all, decoding will fail with a clear message rather than showing garbage.
Is Base64 a form of encryption?
No, and treating it as one is a real security mistake. It is a reversible encoding with no key involved — anyone who sees the string can decode it instantly. Use actual encryption for anything that needs protecting.
Why does my decoded text show strange characters?
Usually the original was encoded from a different character set, or it is binary data rather than text. This tool decodes as UTF-8 and reports a clear error when the result is not valid text.
Can I encode a file rather than text?
This page handles typed or pasted text. Encoding a file into a data URI works from the file's raw bytes, which is a different job.