1666889← Home

Base64 Encoder & Decoder

Convert text to Base64 and back, or turn a local file into Base64. Everything runs locally in your browser — nothing is uploaded.

Input: 0 characters, 0 bytes (UTF-8)

Output: 0 characters

The file is read locally in your browser and converted to Base64. The data URI below uses the file's own media type when the browser knows it.

Frequently asked questions

What is Base64 encoding? Base64 is a way to represent binary data as plain ASCII text, using the letters A–Z, a–z, the digits 0–9, and the symbols + and /. It is used to embed binary data in text formats such as JSON, URLs, and email, where raw bytes would not survive. Three input bytes become four Base64 characters.

What is the difference between standard and URL-safe Base64? URL-safe Base64 replaces + with - and / with _, because + and / have special meanings inside URLs, and it usually drops the trailing = padding. The two variants encode the same bytes but are not interchangeable: a decoder expecting one variant will reject the other's characters.

Does this tool handle non-English text and emoji? Yes. Text is encoded as UTF-8 bytes before Base64 encoding, and decoded back from UTF-8 on the way out, so any Unicode text — accented letters, non-Latin scripts, and emoji — round-trips exactly. Older tools that used the browser's btoa directly on text would corrupt anything outside ASCII.

Why does decoding fail with an invalid input error? The decoder is strict: it rejects characters that are not part of the Base64 alphabet, padding in the wrong place, and lengths that cannot be valid Base64. Common causes are a truncated copy, a stray character such as a quote or space inside the string, or pasting standard Base64 while the URL-safe option is on.

Are my files or text uploaded anywhere? No. All encoding and decoding happens locally in your browser, including files you select. Nothing is sent to a server.

Base64 Encoder & Decoder · Runs locally in your browser

More tools are coming. Back to thetool list.