About the Base64 Encoder / Decoder
Base64 represents binary data such as images and files using only 64 characters: AโZ, aโz, 0โ9, + and /. It is used everywhere: email attachments, Data URLs that embed images in HTML and CSS, JWT tokens and HTTP Basic authentication headers.
This tool encodes text as UTF-8, so accented letters and emoji produce exactly the same output as Python, Java or Node.js. File conversion also runs entirely in your browser; nothing is uploaded.
How to use
- On the Text tab, choose Encode or Decode and type into the box. The result appears instantly.
- Turn on URL-safe for values that go into URLs or file names: + and / become - and _, and the trailing = is dropped.
- If decoded data is an image or other file, a preview and a Save as file button appear.
- On the File / image tab, turn a file into a Data URL, CSS rule or img tag, or turn a Base64 string back into a file.
Base64 is not encryption
Base64 is just an encoding that anyone can reverse instantly; it does not hide anything. Storing or sending passwords or personal data as plain Base64 is not secure. Use encryption such as AES to protect content, and a hash such as SHA-256 to detect tampering.
Size and variants
| Item | Details |
|---|---|
| Size | Every 3 bytes become 4 characters, so output is about 33% larger |
| Padding (=) | 0โ2 = signs are added to make the length a multiple of 4 |
| URL-safe | + โ -, / โ _ and = usually omitted (JWT, RFC 4648 ยง5) |
| Data URL | data:image/png;base64,โฆ can be used directly in HTML and CSS |
Non-ASCII characters take 2โ4 bytes in UTF-8. For example, "cafรฉ" is 5 bytes and encodes to Y2Fmw6k=.
FAQ
Why do some characters look garbled after decoding?
The original was probably encoded in a legacy charset such as Windows-1252 or ISO-8859-1 rather than UTF-8. This tool decodes as UTF-8; data that is not valid UTF-8 is treated as binary and offered as a file download.
Should I embed images as Base64?
For tiny images such as icons (a few KB) it can save HTTP requests. Larger images grow by 33% and can't be cached separately, so they usually load slower. A common rule of thumb is to inline only images under about 10 KB.
Can it decode Base64 with line breaks or spaces?
Yes. Whitespace and line breaks are ignored automatically, and URL-safe characters (-, _) and missing padding (=) are handled too.
Is there a file size limit?
Conversion happens in your browserโs memory, so file to Base64 conversion supports files up to 50 MB.