Base64 Encode and Decode

Free Base64 encoder and decoder: convert text (UTF-8) and files to Base64 or Data URI, decode Base64 to text or a file. URL-safe option, runs in your browser.

✓ Free🔒 Private⚡ No sign-up
Drop a file here or click to encode a file (max. 25 MB)

🔒 Runs entirely in your browser. Your files are never uploaded.

</> Add to your site

Embed this tool on your website for free: copy the code and paste it into your page's HTML. Everything runs in your visitors' browsers; files are not uploaded.

Preview ↗

How to encode or decode Base64

  1. Choose Encode to turn text into Base64, or Decode to turn Base64 back into text.
  2. Type or paste into the input box — the result appears instantly in the output box.
  3. To encode a file or image, drop it onto the file area. You can output plain Base64 or a complete Data URI (data:image/png;base64,…) ready for HTML or CSS.
  4. If the decoded data is not text (an image, a PDF, a ZIP), the tool detects the file type and offers it as a download.
  5. Use Swap to send the result back into the input and reverse the direction.

Text is encoded as UTF-8, so accented letters, non-Latin scripts and emoji survive the round trip unchanged.

What Base64 is used for

Base64 turns any bytes into 64 safe, printable characters. That makes binary data travel through systems that were designed for text:

  • E-mail attachments (MIME) are Base64-encoded, traditionally with lines of 76 characters.
  • Data URIs embed small images, icons or fonts directly into HTML and CSS files.
  • APIs and JSON carry files, signatures and keys as Base64 strings.
  • HTTP Basic authentication sends user:password Base64-encoded — which is why it must only be used over HTTPS.
  • JSON Web Tokens (JWT) consist of URL-safe Base64 parts separated by dots.

Standard vs. URL-safe Base64

| | Standard (RFC 4648 §4) | URL-safe (RFC 4648 §5) |

|---|---|---|

| Characters 62 and 63 | + and / | - and _ |

| Padding | = at the end | usually omitted |

| Typical use | e-mail, Data URIs, files | URLs, file names, JWT |

The decoder accepts both variants, with or without padding, and ignores spaces and line breaks. A data:…;base64, prefix is removed automatically.

Size and security

Base64 makes data about one third larger: every 3 bytes become 4 characters. A 30 KB image becomes roughly 40 KB of text, so Data URIs are best for small files.

Base64 is not encryption. Anyone can decode it, so never use it to protect passwords or personal data. All encoding and decoding on this page runs locally in your browser — nothing is uploaded.

Frequently asked questions

What is Base64?

Base64 represents binary data with 64 printable characters (A–Z, a–z, 0–9, + and /). It is used to put files or bytes into text-only places such as e-mail, JSON, HTML or URLs. Every 3 bytes become 4 characters, so the encoded text is about 33% larger.

Is Base64 encryption?

No. Base64 is an encoding, not encryption: anyone can decode it without a key. Never use it to hide passwords or personal data.

What is URL-safe Base64?

The URL-safe variant defined in RFC 4648 replaces + with - and / with _ and usually drops the = padding, so the result can be used in URLs, file names and JSON Web Tokens. The decoder accepts both variants automatically.

Are my files uploaded?

No. Encoding and decoding happen entirely in your browser. Files and text never leave your device.

Sources

Last updated: