Base64 Encode / Decode
A UTF-8 safe Base64 converter that encodes text to Base64 and decodes it back to text, live in your browser. Handles emoji and non-Latin scripts, surfaces clear errors on invalid input, and never uploads your data.
Mode
UTF-8 safe · converts live
100% private. Encoding and decoding run entirely in your browser — nothing is uploaded to a server.
How to use this tool
Pick a Mode
Choose Encode to turn text into Base64, or Decode to turn a Base64 string back into text.
Paste Your Input
Type or paste into the input box — emoji, accents and non-Latin scripts are all UTF-8 safe and convert live.
Copy the Result
Read the output, hit Copy, or use Swap to feed the result back in and round-trip a value.
Base64 is encoding, not encryption — anyone can decode it. Never use it to hide passwords or secrets.
Encoding, not encryption
Base64 only re-packages bytes into a text-safe alphabet — anyone can decode it. Never use it to hide passwords or secrets.
Unicode safe
Emoji, accents and non-Latin scripts survive a round trip because input is read as UTF-8 bytes before encoding and rebuilt with TextDecoder.
Convert Between Text and Base64 Instantly
Base64 is the quiet workhorse of the web: it lets binary or non-ASCII data ride safely through channels that only understand plain text. This Base64 encode / decode tool converts in both directions as you type, is fully UTF-8 safe, and tells you clearly when an input can't be decoded — instead of silently producing garbage or crashing.
What This Tool Does
Pick a mode and paste your data. Encode turns ordinary text into a Base64 string. Decode turns a Base64 string back into the original text. Everything updates live, a one-click copy button grabs the result, and a Swap action feeds the output back into the input so you can round-trip a value without retyping it. The sidebar shows the input size in bytes and the output length, which is handy when you're checking whether a payload fits a size limit.
A Worked Example
Say you want to encode the string Hello, world 👋.
- Under the hood,
TextEncoderconverts the text to UTF-8 bytes. The waving-hand emoji alone becomes four bytes (F0 9F 91 8B). - Those bytes are grouped three at a time and mapped to the Base64 alphabet.
- The result is
SGVsbG8sIHdvcmxkIPCfkYs=.
Switch to Decode, paste that string back, and you get Hello, world 👋 exactly — emoji intact. A naive encoder that calls btoa() straight on the original string would throw "character out of range" the moment it hit the emoji. This tool avoids that by always encoding the bytes, not the raw characters, and decoding with TextDecoder in strict mode so malformed sequences are reported rather than mangled.
Why UTF-8 Safety Matters
The browser's built-in btoa() only accepts code points 0–255. That's fine for plain English but fails for accents (café), non-Latin scripts (日本語, العربية), and emoji. The correct pipeline is text → UTF-8 bytes → Base64 for encoding, and the exact reverse for decoding. Because this converter follows that pipeline, every character you can type survives a full round trip.
When Developers Reach for Base64
- Data URIs — embedding a small image or font directly in CSS/HTML as
data:image/png;base64,...to save an HTTP request. - JSON and APIs — carrying binary blobs, signatures, or file contents inside a JSON field that must be text.
- JWTs and tokens — decoding the header and payload segments of a JSON Web Token to inspect their claims (note: JWTs use the URL-safe variant).
- Email (MIME) — attachments are Base64-encoded so binary files travel through text-only mail transport.
- Debugging — quickly reading a Base64 value from a log, config file, or network request to see what it actually contains.
Encoding Is Not Security
It's worth repeating: Base64 offers no protection. A value like cGFzc3dvcmQ= decodes to password in a fraction of a second. If you spot a "secret" stored as Base64, treat it as plaintext. Use Base64 to make data portable, and proper encryption when you need it kept private.
Built for Privacy
This converter runs entirely in your browser — no upload, no logging, no network call. That makes it safe for internal tokens, draft content, or configuration you'd rather not paste into a remote service. Once the page loads it even works offline.
Clear Errors, Never a Crash
Decoding wraps its work in strict validation: paste something that isn't valid Base64 — extra spaces, missing = padding, or out-of-alphabet characters — and you get a plain-language explanation of what to fix, not a stack trace.
Need to inspect the text you're encoding? Pair this with the word & character counter, or reshape strings first with the text case converter.