Base64 Encoder & Decoder
The Base64-encoded text
How Base64 encoding and decoding works
Base64 turns bytes into text using 64 characters: A–Z, a–z, 0–9, + and /. Every 3 input bytes become 4 output characters, and = pads the last group. Text is converted to UTF-8 bytes first, so emoji and CJK characters round-trip exactly: "Hello" encodes to SGVsbG8= and "你好" (6 UTF-8 bytes) to 5L2g5aW9. Text input is capped at 1,000,000 characters.
Base64, Base64URL and URL encoding
Standard Base64 follows RFC 4648 §4 (`+/` alphabet, `=` padding). Base64URL follows RFC 4648 §5: it uses `-` and `_` instead of `+` and `/` and drops the padding. When decoding, whitespace and line breaks are ignored and missing padding is restored. URL mode percent-encodes text with `encodeURIComponent` (for a single query value or path segment) or `encodeURI` (for a full URL, keeping `/ ? # & =` intact).
Convert an image or file to Base64
In File mode, drop, paste, or choose a file up to 10 MB to get its raw Base64 payload and a `data:` URL you can paste into HTML or CSS. To go the other way, paste a Base64 string or a `data:...;base64,` URL: the tool detects PNG, JPEG, GIF, WebP, PDF, SVG, ZIP and GZIP from the file's first bytes, sets the right MIME type and extension, previews images, and lets you download the rebuilt file.
FAQ
Is Base64 encryption?
No. Base64 is a reversible encoding; anyone with the encoded value can decode it. Use it to move binary data through text-only channels, not to hide it.
How much bigger is Base64 than the original?
About 33% bigger. Every 3 bytes become 4 characters, so a 30 KB image becomes roughly 40 KB of Base64 text, and the data: URL prefix adds a few more characters.
How do I convert Base64 back to an image?
Switch to File mode, choose Decode, and paste the Base64 string or the full data:image/...;base64, URL. The image is previewed and can be downloaded with the detected extension, such as .png or .jpg.
Why does decoded Base64 text show garbled characters?
Text mode decodes the bytes as UTF-8. If the Base64 holds an image, a ZIP, or text in another encoding such as GBK, the bytes are not valid UTF-8 and show as � characters. Decode binary data in File mode instead.
When should I use Base64URL?
Use it when the value goes into a URL, a JWT segment, or a filename. Base64URL avoids +, / and =, which would otherwise need percent-escaping.
Related tools
Related articles
- Strip, Don't Re-encode: How to Actually Remove EXIF Without Touching a Pixel
Re-saving a photo to strip metadata re-compresses every pixel. Walking JPEG markers and PNG chunks does not. A byte-level tour of EXIF and GPS removal.