Base64 is a way of writing data using only letters, digits, and two symbols, so the result can pass safely through systems that expect plain ASCII. This tool converts your text, images, or files to Base64 and converts Base64 back to text, and because it works in UTF-8 it keeps emoji and non-Latin characters intact. Everything runs in your browser, so what you paste or drop stays on your device.
How to use the Base64 encoder and decoder
- Choose Encode, Decode, or Auto — Pick Encode to turn text or a file into Base64, Decode to turn Base64 back into text, or Auto to let the tool detect the direction from your input.
- Add your input — Paste text into the box, or drop a file (an image works too) on the file area.
- Pick your options — Turn on URL-safe, MIME line breaks, or a data URI, and switch on Live to convert as you type.
- Convert and copy — Choose Convert if Live is off, then copy the output or download the decoded file.
When you encode, the tool reads your input as UTF-8, so accented letters, Japanese and Chinese text, and emoji all survive the round trip. When you decode, it checks both the Base64 and the bytes it produces — if the input is not valid Base64, or the bytes are not valid UTF-8, it shows an error instead of a garbled result.
Auto-detect the direction
If you would rather not think about which way to convert, choose Auto. The tool looks at what you pasted: if it is valid Base64 that decodes to readable text, it decodes it, and the status line reports “Detected Base64 input and decoded it.” If the input is anything else, the tool treats it as text and encodes it to Base64 instead. Live mode follows the same rule, so the direction is chosen for you as you type.
Standard Base64 vs URL-safe Base64
Standard Base64 represents every three bytes of data as four characters drawn from a 64-character alphabet: A–Z, a–z, 0–9, plus + and /. It also pads the end with = so the length is a multiple of four. The trade-off is that +, /, and = are not always welcome in a URL, a filename, or a query string.
URL-safe Base64 solves that by swapping + for - and / for _, and dropping the = padding, so the value can be pasted into a link without escaping. Turn on the URL-safe option and the output is rewritten that way. Decoding accepts both alphabets at once — standard +//, URL-safe -/_, and values with or without padding — so you do not have to tell it which one you pasted.
Files, images, and data URIs
Drop a file on the file area, or use Choose a file, to encode its bytes rather than its text. The file is read in your browser with the File API, so nothing is uploaded. When the file is an image, the tool shows a preview next to the result. Turn on Include data URI to emit data:<mime>;base64,<characters> instead of a bare Base64 string — the form you paste straight into a CSS url() or an <img src>.
MIME line breaks
Some formats, such as email bodies and certain headers, expect Base64 to be wrapped at 76 characters per line. Turn on Line breaks (MIME 76) and the output is chunked that way. The decoder ignores whitespace and line breaks, so a MIME-wrapped value still decodes back to exactly the same bytes.
Is it private?
Yes. Encoding and decoding run entirely in your browser using built-in JavaScript APIs, and nothing you paste or drop is sent to a server, stored, or logged. Files you open are read locally through the browser’s file reader and are never transmitted. There is no account to create and no history kept on our side, so closing the tab clears the input and output from view.