About the Base64 Encoder / Decoder
Base64 turns any data — text, images, PDFs, keys — into plain letters, digits and the symbols + and /, so it can travel safely through email, JSON, HTML, CSS and URLs that only accept text. Developers meet it in API tokens, basic authentication headers, embedded images and configuration files.
This tool encodes and decodes Base64 instantly as you type, with correct UTF-8 handling for accented letters, non-Latin scripts and emoji. You can switch to the URL-safe variant, turn any file into a Base64 string or data URI, and save decoded Base64 as a file. Nothing is uploaded: the conversion runs entirely in your browser.
How to use the Base64 Encoder / Decoder
- Choose Encode or Decode.
- Type or paste into the Input box — the result updates as you type.
- Tick URL-safe if the Base64 is used in a URL or file name.
- To encode a file, drop it in the file area and copy the Base64 or data URI.
- Copy the result, or download decoded data as a file.
How Base64 works
Base64 takes the input 3 bytes (24 bits) at a time and splits them into four 6-bit groups. Each group (0–63) is written as one character from the table A–Z, a–z, 0–9, + and /. If the input length is not a multiple of 3, the output is padded with one or two = signs.
| Encoded length | 4 × ⌈bytes ÷ 3⌉ characters |
|---|---|
| Size increase | about 33% larger than the original |
Worked example
| Text | Base64 |
|---|---|
| Man | TWFu |
| Ma | TWE= |
| M | TQ== |
| Hello, world! | SGVsbG8sIHdvcmxkIQ== |
“Man” is the bytes 77, 97, 110 = 01001101 01100001 01101110. Split into 6-bit groups this is 19, 22, 5, 46, which are the letters T, W, F and u.
Frequently asked questions
Is Base64 encryption?
No. Base64 is an encoding, not encryption. Anyone can decode it without a key, so never use it to hide passwords or private data.
What is URL-safe Base64?
URL-safe Base64 (also called base64url) replaces + with - and / with _, and usually drops the = padding, so the result can be used in URLs, file names and JSON Web Tokens without further encoding.
Why does decoding show an error?
Base64 may only contain A–Z, a–z, 0–9, + and / (or - and _), with up to two = at the end. Spaces and line breaks are ignored. Any other character, or a string whose length is cut off by one character, can’t be decoded.
Why does the decoded text look like gibberish?
The Base64 probably holds binary data such as an image, a ZIP file or encrypted bytes rather than text. Use Download result to save it as a file and open it with the right program.