Base64 Encode/Decode
Max 1 MB · Processes automatically as you type
Processed entirely in your browser — nothing is sent to a server.
Base64 is a way of representing arbitrary binary or text data using only plain ASCII characters — an alphabet of 64 symbols (A–Z, a–z, 0–9, +, /). It exists because many text-only formats (JSON, URLs, email, older config files) can’t safely carry raw binary bytes, but can carry any printable ASCII string without corruption. Encoding data as Base64 trades roughly 33% more size for guaranteed safe transport through those formats.
Encode mode takes plain text, converts it to its UTF-8 byte representation, and maps those bytes to the Base64 alphabet. Decode mode reverses the process: the Base64 string is decoded back into raw bytes, and those bytes are then interpreted as UTF-8 text to produce readable output.
That explicit UTF-8 step is the detail that makes this tool reliable for anything beyond plain English text. The browser’s native btoa() and atob() functions only support single-byte Latin-1 characters directly, so applying them straight to arbitrary text corrupts accented letters, non-Latin scripts, and emoji. Converting to and from UTF-8 bytes explicitly, before touching Base64, is what makes those characters round-trip correctly instead of turning into garbled output or throwing an exception partway through.
Invalid input is handled explicitly rather than silently: if Decode mode receives text that isn’t valid Base64 — wrong padding, stray whitespace, characters outside the Base64 alphabet — or valid Base64 that decodes to bytes that aren’t valid UTF-8, an error message is shown instead of a corrupted result. All of this runs locally, capped at 1 MB of input, with nothing sent anywhere.
Examples
- Decoding a JWT payload segment — split a token on its dots and decode the middle part to inspect the claims inside.
- Embedding a small icon as a data URI directly in CSS or HTML, skipping a separate image file for a one-off decorative asset.
- Encoding a string containing special characters before placing it into a system (an old API, a config format) that only accepts plain ASCII.
Frequently asked questions
Is my data sent to a server?
Does this handle emoji and accented characters correctly?
Why does Decode mode show an error?
What is the maximum input size?
data: URI.