Base64 Encode/Decode

Convert text to and from Base64 instantly — UTF-8 safe, all in your browser.

How it works

Base64 is a way of representing arbitrary text or binary data using only 64 printable characters, so it can travel safely through systems that expect plain text. This tool encodes what you type into Base64, or decodes Base64 back into readable text, using your browser's built-in functions. Crucially, it is UTF-8 safe: text is converted to UTF-8 bytes before encoding and back again after decoding, so accents, emoji and non-Latin scripts are handled correctly, unlike a naive encoder that mangles them. Everything runs locally in your browser, so your data never leaves your device.

How to encode and decode

Type or paste your text and press Encode → to get the Base64 string in the lower box, or paste a Base64 string and press ← Decode to recover the original text. The result is ready to copy with the Copy button, which puts it on your clipboard and briefly confirms with "Copied!". The tool loads with a sample already encoded, so you can see the expected output at a glance before replacing it with your own.

You can go in either direction with the same field: put plain text in to encode it, or put Base64 in to decode it. There is no separate input mode to switch — pressing the relevant button tells the tool what you have in front of you. A green checkmark (✓) with the character count appears below on success, or a red cross (✗) explains exactly what went wrong.

A concrete example

Say you're pasting an emoji-heavy tweet into a JSON payload, but your API rejects non-ASCII characters. Type Hello, DocuZero! 🚀 and press Encode →. The tool turns the UTF-8 bytes of that whole string, emoji included, into a plain ASCII Base64 string like SGVsbG8sIERvY3VaZXJvISDwn5qA — safe to drop into JSON, a URL, or an email where the rocket emoji would otherwise break the format.

Run it backwards and it round-trips perfectly. Copy that encoded string, clear the input, paste it and press ← Decode: you get Hello, DocuZero! 🚀 back, emoji intact. That faithful two-way return is the key difference between this UTF-8-aware tool and a basic encoder that would turn the emoji into a jumble of question marks.

What to expect

This tool encodes and decodes through your browser's real Base64 engine. Encoding converts your text to UTF-8 bytes and produces standard Base64 64-char-alphabet output with padding; decoding strips whitespace around pasted values, accepts both standard and URL-safe forms automatically, and pads incomplete input before parsing, so most real-world values just work. If the input isn't valid Base64 — because it contains characters outside the alphabet or is malformed — you get a clear error instead of garbled text.

The optional URL-safe checkbox produces the variant used in JWTs, query parameters and file names: it swaps + and / for - and _ and drops the trailing = padding. All of it runs 100% in your browser with no upload and no account, so even private strings stay on your machine.

Common problems and fixes

One common stumble is pasting Base64 that contains characters from Base64URL but not standard Base64; the tool handles that automatically since its alphabet check and decode accept both variants. If you get the red "doesn't look like Base64" message, the input holds characters outside the alphabet — check for stray spaces or punctuation, or if you meant to convert plain text, press Encode instead of Decode. A partially copied value that ends mid-string can fail to parse: paste the full value, since the tool pads incomplete input to a valid length but won't guess at content cut off in the middle.

Remember that Base64 is encoding, not encryption — if you decode something you were hoping was secure, it comes back as readable text, and anyone who sees the base64 string can reproduce your original. Use this for safe transport of text, not for protecting secrets. And since everything is processed in your browser's memory, an extremely large payload may take a moment to encode or decode, though typical text is instant.

Frequently asked questions

Is Base64 encryption?

No. Base64 is an encoding, not encryption — anyone can decode it with any base64 tool. Never use it to protect secrets; it only makes data safe to transport as plain text.

Does it handle emoji and accents?

Yes. Text is encoded as UTF-8 bytes first, so emoji, accented letters and non-Latin scripts round-trip correctly instead of becoming question marks.

Is my data sent anywhere?

No. Encoding and decoding happen entirely in your browser, and nothing you enter ever leaves your device — there's no upload and no account.

What's the difference between normal and URL-safe Base64?

URL-safe Base64 replaces the characters + and / with - and _ and drops the trailing padding, so the output is safe in URLs, file names and JWTs. This tool can decode either variant automatically.

Why can't I decode a string that looks like Base64?

It likely contains characters outside the Base64 alphabet, such as spaces or punctuation. Remove them, or if you pasted plain text by mistake, press Encode instead of Decode.

Does the Copy button work on all devices?

Yes. It uses your browser's clipboard API to copy the current result, and shows a brief "Copied!" confirmation. If your browser blocks clipboard access, select the text in the result box and copy it manually.