How to use the Base64 Encoder & Decoder
- Type in the Plain text box and the encoded result appears right away in the Base64 box on the right.
- To decode, paste a Base64 string into the Base64 box and the original text appears on the left.
- For an image, PDF or other file, drop it on the file area below. The tool creates a data URI and a plain Base64 string for it.
- If your Base64 holds an image or another file, click Save Base64 as file to get the original file back.
What is Base64 encoding?
Base64 represents binary data, like photos and files, or any text using only 64 characters: uppercase and lowercase letters A–Z, digits 0–9, + and /. You'll find it in email attachments, in data URIs that embed images directly in HTML or CSS, in APIs that send files inside JSON, and in HTTP Basic authentication headers.
Base64 turns every 3 bytes into 4 characters, so the output is about 33% larger than the original. To make the length a multiple of 4, zero to two = signs are added at the end.
Base64 is not encryption. Anyone can decode it in seconds, so never use it to protect passwords or personal data.
Why Base64 results for the same text can differ between sites
Base64 encodes bytes, not characters. Plain ASCII text like "hello" gives the same result everywhere. Accented letters, symbols and emoji are different, because their bytes depend on the character encoding. For example, "café" is 5 bytes in UTF-8 (Y2Fmw6k=) but 4 bytes in Windows-1252 or ISO-8859-1 (Y2Fm6Q==). The web and most APIs use UTF-8, so this tool does too.
If you decode something and get garbled characters, the original was probably in another encoding, such as Windows-1252, or it isn't text at all. It might be an image or another file.
URL-safe Base64 and data URIs
Standard Base64 uses +, / and =, and these characters have special meanings in URLs. Putting them in a URL as-is can break things. URL-safe Base64 (also called Base64url) replaces + with -, replaces / with _ and drops the trailing =. JSON Web Tokens (JWTs) are the best-known example.
A data URI, like data:image/png;base64,iVBOR..., puts the file type and the Base64 data together so you can embed an image in HTML or CSS without a separate file. For small icons this saves HTTP requests. Large images get about 33% bigger, though, so it's usually better to keep them as regular files.
How to calculate the size after Base64 encoding
The length of Base64 output is 4 × ⌈original bytes ÷ 3⌉ characters. Every 3 bytes become 4 characters, so the data grows by about 4/3.
- 3 bytes of input → 4 characters
- 100 KB of input → about 133 KB
- A 1 MB image → about 1.33 MB
A JWT has three parts separated by dots (.). The middle part is JSON encoded with URL-safe Base64. If you paste just the middle part here, you can read what's inside. This tool does not check the signature, though, so it can't tell you whether the token is trustworthy.
File size limits and privacy
For best performance, use files of 5 MB or less. The tool accepts files up to 20 MB. Because Base64 adds about a third to the size, very large files make long strings that can slow down your browser and are hard to paste anywhere.
All encoding and decoding happens in your browser. Your text and files are never uploaded to a server, so you can safely convert private documents and images.