Base64 Encode/Decode

Encode text to Base64 or decode Base64 strings back to text.

Base64 turns binary data into plain ASCII so it can travel through systems built for text: email attachments, data URLs, JSON payloads. Encode or decode here directly in the browser - the conversion never touches a server, and Unicode input like emoji or accented characters round-trips correctly.

What Is Base64 Encoding?

Base64 converts binary data into a set of 64 printable ASCII characters (A-Z, a-z, 0-9, + and /). It was designed to let you send binary stuff through systems that only handle text. Email attachments, for instance, get Base64-encoded before they're sent through SMTP. The tradeoff is size. Base64 encoding increases data by about 33%. Three bytes of input become four Base64 characters.

Where You'll See Base64 in the Wild

  • Data URIs - Embedding small images directly in HTML or CSS (like "data:image/png;base64,iVBOR...")
  • Email - MIME encoding for attachments
  • JWTs - JSON Web Tokens used in authentication are Base64url-encoded
  • API payloads - Storing binary data inside JSON since JSON can't handle raw bytes
  • HTTP Basic Auth - Username and password pairs are Base64-encoded (but not encrypted!)

Base64 Is NOT Encryption

This trips up a lot of people. Base64 is encoding, not encryption. Anyone can decode a Base64 string in seconds. Don't use it to hide passwords, API keys or sensitive data. If you need actual security, use proper encryption like AES-256. Base64 just makes binary data safe for text-based transport.

URL-Safe Base64

Standard Base64 uses + and / characters, which have special meaning in URLs. URL-safe Base64 swaps those for - and _ instead. If you're passing Base64 data in a URL query string, you need the URL-safe variant or things will break. JWTs use URL-safe Base64 for this exact reason.

How to Use

  1. Paste your plain text or Base64 string into the input area.
  2. Click Encode to convert text to Base64.
  3. Click Decode to convert Base64 back to readable text.
  4. Copy the result and use it wherever you need.

Frequently Asked Questions

Is Base64 encryption?

It's encoding, not encryption - probably the most common misconception about it. Anyone can decode Base64 instantly with any tool, including this one. If the data needs protecting, use real encryption like AES.

Why does Base64 make data bigger?

Base64 increases size by roughly 33%. It takes every 3 bytes of input and turns them into 4 characters of output. That's the price you pay for making binary data safe to send through text-only channels.

What does the padding (= signs) mean?

Base64 works in groups of 3 bytes. If your input isn't a multiple of 3, padding characters (=) get added at the end. One = means 1 byte of padding, two == means 2 bytes. Some implementations skip padding entirely.

What's the difference between Base64 and URL-safe Base64?

Standard Base64 uses + and / which cause problems in URLs. URL-safe Base64 replaces those with - and _ instead. JWTs and anything that goes in a URL should use the URL-safe variant.

Can I encode images to Base64 with this?

This tool handles text-to-Base64 conversion. For images, you'd need to read the file as binary data first. Most programming languages have built-in functions for that, like btoa() in JavaScript or base64.b64encode() in Python.