Base64 Encoder / Decoder
Encode text to Base64 or decode Base64 back to text, with full Unicode support and a URL-safe variant. Runs entirely in your browser.
Runs entirely in your browser. Your input is never sent to our servers.
Enter text above to encode it.
What is Base64 Encoder /?
Base64 is a binary-to-text encoding that represents arbitrary bytes using 64 printable ASCII characters, allowing binary data to pass safely through channels that only handle text.
What this Base64 Encoder / Decoder does
Encode text to Base64, or decode Base64 back to text. Input is converted through UTF-8 bytes, so accented characters, CJK text and emoji all round-trip correctly — a naivebtoa() call throws on any character above U+00FF.
The URL-safe option produces the RFC 4648 §5 variant, substituting - and_ for + and / and dropping padding, so the output can be used in a URL path or query string without further escaping.
How to use it
- Choose Encode or Decode.
- Paste your text. Output updates as you type.
- For values destined for a URL or a JWT segment, enable the URL-safe alphabet.
Understanding your results
Base64 output is roughly 33% larger than its input: every three bytes become four characters. Padding with = brings the final group up to four characters when the input length is not a multiple of three.
Decoding here is strict about UTF-8. If the decoded bytes are not valid text — because the original data was an image or an encrypted blob — the tool reports that rather than showing replacement characters.
Why this matters
Base64 appears throughout web infrastructure: HTTP Basic authentication headers, data URIs, email attachments via MIME, JWT segments, TLS certificates in PEM form, and Kubernetes Secrets. Being able to read it quickly turns an opaque string into something you can reason about.
Common mistakes
Believing it provides security. Base64 is trivially reversible and provides no confidentiality whatsoever. A Kubernetes Secret is Base64-encoded, not encrypted — anyone who can read the manifest can read the value.
Mixing the two alphabets. Standard Base64 uses + and /; the URL-safe variant uses - and _. Feeding one to a decoder expecting the other produces corrupt output or an error.
Forgetting padding. Some decoders reject unpadded input. This tool restores padding automatically when decoding.
Technical background
Defined in RFC 4648. The encoder takes 24 bits at a time and splits them into four 6-bit groups, each indexing a 64-character alphabet. Because 26 = 64, each character carries exactly six bits, which is why three bytes map cleanly onto four characters and why the expansion ratio is 4:3.
Limitations
This tool works with text. It does not accept file uploads, and decoding data that is not valid UTF-8 text will report an error rather than attempting to render binary.
Frequently asked questions
Is Base64 encryption?
No. It is an encoding with no key and no secret. Anyone can decode it. Never use Base64 to protect sensitive data.
Why does my encoded text end in one or two equals signs?
That is padding. Base64 works on three-byte groups; when the input length is not a multiple of three, = characters pad the final group to four characters.
What is URL-safe Base64?
A variant from RFC 4648 §5 that replaces + and / with - and _, and usually omits padding, so the result is safe in URLs and filenames without escaping. JWTs use it.
Is my input sent to a server?
No. Encoding and decoding run entirely in your browser.
References
Last reviewed