Base64 Encoder & Decoder

Type text on the left to encode it to Base64, or paste Base64 on the right to decode it back to text. Text is converted as UTF-8, so accented letters, symbols and emoji come through intact.

File or image to Base64

Drag and drop a file here, or click to choose one Images, PDFs and any other file type · 5 MB or smaller recommended

How to use the Base64 Encoder & Decoder

  1. Type in the Plain text box and the encoded result appears right away in the Base64 box on the right.
  2. To decode, paste a Base64 string into the Base64 box and the original text appears on the left.
  3. 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.
  4. 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.

Frequently asked questions

Is Base64 encryption?
No. Base64 is an encoding, just a different way of writing the same data. Anyone can reverse it, so it offers no security.
Why do I get garbled characters when I decode?
The data inside the Base64 might not be text, or it might use an encoding other than UTF-8, such as Windows-1252. If it's an image or another file, click "Save Base64 as file" to download it.
What are the = signs at the end?
They're padding characters that make the length a multiple of 4. This tool can also decode Base64 that's missing its = padding.
How do I convert an image to Base64?
Drop the image on the file area or click it to choose a file. The tool shows a data URI you can paste into HTML or CSS, plus a button to copy only the Base64 string.
How do I turn a Base64 string back into a file?
Paste the Base64 into the Base64 box and click "Save Base64 as file." The tool guesses the file type from the data and downloads it.
Are my files uploaded to a server?
No. All conversion happens in your browser, and nothing is sent anywhere else.

Last updated: 2026-10-06