ad

Base64 Encode & Decode

Encode text to Base64 or decode back — all in your browser.

What is Base64 Encoding?

Base64 is a binary-to-text encoding scheme that represents binary data using 64 ASCII characters. It was originally designed for sending binary data through systems that only support text, such as email (MIME) and URLs.

The encoding works by taking groups of 3 bytes (24 bits) and splitting them into 4 groups of 6 bits. Each 6-bit group maps to one of 64 printable characters. If the input length isn't a multiple of 3, the output is padded with = characters.

How to Use This Tool

  1. Select Encode or Decode mode
  2. Paste or type your text in the input area
  3. The result appears instantly in the output area
  4. Click Copy to copy the result to your clipboard

Common Base64 Use Cases

  • Data URIs — Embed small images directly in HTML/CSS
  • API authentication — HTTP Basic auth sends credentials as Base64
  • Email attachments — MIME encodes attachments in Base64
  • JWT tokens — JSON Web Tokens encode their payload in Base64url
  • Binary in JSON — Store binary data in JSON fields as Base64 strings

Frequently Asked Questions

Is Base64 encryption?
No. Base64 is an encoding scheme, not encryption. It converts binary data to ASCII text for safe transmission. Anyone can decode Base64 — it provides no security. Never use Base64 to hide passwords or sensitive data.
Why does Base64 make data larger?
Base64 encodes every 3 bytes of input into 4 ASCII characters, resulting in approximately 33% size increase. This trade-off allows binary data to be safely transmitted through text-only channels like email or JSON.
Is my data sent to a server?
No. All encoding and decoding happens entirely in your browser using JavaScript. Your data never leaves your device.
What characters does Base64 use?
Standard Base64 uses A-Z, a-z, 0-9, +, and / (64 characters total), with = for padding. URL-safe Base64 replaces + with - and / with _ to avoid URL encoding issues.
Can I encode images to Base64?
Yes. Base64-encoded images can be embedded directly in HTML or CSS using data URIs. This eliminates extra HTTP requests but increases file size by ~33%. Best for small icons under 10KB.
ad