Base64 Encode / Decode
Type in either box — plain text encodes to Base64 and Base64 decodes back to text, live as you type.
Processed on your device — nothing is sent anywhere.
How it works
- Type or paste plain text into the left box to see its Base64 encoding appear on the right.
- Or paste a Base64 string into the right box to decode it — the plain text appears on the left. Invalid Base64 shows an error instead of garbage.
- Click Copy under either box to put that value on your clipboard.
Frequently asked questions
- What is Base64 encoding used for?
- Base64 represents binary data using only 64 safe ASCII characters, so it survives systems built for plain text. It is used for data URLs in HTML and CSS, email attachments (MIME), basic HTTP authentication headers, and embedding small files in JSON or XML. Note that it is an encoding, not encryption — anyone can decode it.
- Does this tool handle Unicode characters like emoji or accents?
- Yes. The text is first converted to UTF-8 bytes with the browser’s TextEncoder before encoding, and decoded back with TextDecoder. This means accented letters, CJK characters and other non-ASCII text round-trip correctly, unlike naive btoa-only tools that fail on anything outside Latin-1.
- Why does my Base64 string fail to decode?
- Valid Base64 contains only the characters A-Z, a-z, 0-9, + and /, with optional = padding at the end. Common causes of errors are stray whitespace or line breaks (this tool strips those automatically), truncated strings, or URL-safe Base64 that uses - and _ instead of + and /, which this tool also accepts.
- Why is the Base64 output longer than my original text?
- Base64 stores three bytes of input in four output characters, so encoded data is always about 33% larger, plus up to two = padding characters. That overhead is the price of using only text-safe characters. It also means Base64 is not compression — if size matters, compress first, then encode.
- Is it safe to paste API keys or passwords into this tool?
- The conversion runs entirely in your browser with no network requests, so nothing you type is uploaded, logged, or stored — you can verify this in the network tab of your browser’s developer tools. Remember, though, that Base64 itself offers zero secrecy: an encoded credential is still the credential, readable by anyone who decodes it.
About this tool
This is a two-way Base64 converter: type plain text on one side and the Base64 encoding appears on the other, or paste Base64 and get the decoded text back. Conversion happens live on every keystroke in both directions, and malformed input produces a clear error rather than silently corrupted output. Copy buttons under each box move the result to your clipboard in one click.
The tool runs entirely in your browser. Text is converted to UTF-8 bytes with the standard TextEncoder API, encoded to Base64, and decoded back through TextDecoder — no request ever leaves your machine. That makes it safe for the things developers actually paste into Base64 tools: authorization headers, JWT segments, connection strings, and configuration blobs that shouldn’t end up in some website’s server logs. Full UTF-8 handling also means emoji, accented characters, and CJK text survive the round trip, which naive btoa-based converters get wrong.
Typical uses include building or debugging Basic Auth headers, inspecting the payload of a JWT (its middle segment is Base64-encoded JSON), creating data: URLs for small inline assets, decoding SMTP or MIME fragments from email source, and reading values out of Kubernetes secrets or environment files. The decoder is deliberately forgiving: it strips whitespace and line breaks, accepts missing padding, and understands URL-safe Base64 that substitutes - and _ for + and /, so output from other systems usually pastes straight in.
Two things worth remembering. Base64 is an encoding, not encryption — it hides nothing and adds roughly 33% to the size, so never treat it as a security measure. And when a decode produces readable text with a few garbled characters, the source was probably not UTF-8; legacy systems sometimes encode Latin-1 or Windows-1252 bytes, which no standards-based decoder can distinguish automatically.