Base64 Encoder & Decoder — Free Online

Encode text to Base64 or decode Base64 back to text instantly. Full Unicode support. Free, private, browser-based.

What is Base64 encoding?

Base64 is a way to represent binary data as ASCII text. It's commonly used in data URLs, email attachments, API tokens, and embedding images in CSS/HTML. This tool encodes and decodes Base64 with full Unicode support.

Base64 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 ASCII characters (A-Z, a-z, 0-9, +, /). If the input length is not a multiple of 3, the output is padded with '=' characters. This encoding increases data size by approximately 33%.

Developers use Base64 encoding to embed small images as data URIs in HTML/CSS (avoiding extra HTTP requests), encode binary attachments in email (MIME encoding), pass binary data through JSON APIs that only support text, create HTTP Basic Authentication headers, and encode JWT token segments. It is also used in configuration files that need to store binary data.

Only use Base64 for data under 10 KB when embedding in HTML or CSS — larger Base64 strings bloat the document and cannot be cached separately by browsers. Remember that Base64 is encoding, not encryption — anyone can decode it instantly. For actual security, use encryption tools like AES. When working with URLs, use Base64url variant (replacing + with - and / with _) to avoid URL-encoding issues.

Browser developer consoles offer btoa() and atob() functions for Base64, but they only handle ASCII text. Command-line tools like base64 on Linux/Mac work with files but lack a visual interface. This tool handles full Unicode text and provides instant encode/decode with a clean interface — useful for quick debugging without remembering function names or terminal syntax.

How the Base64 Encoder Works

  1. Paste or type your text in the input field
  2. Choose Encode to convert text to Base64, or Decode to convert Base64 back to text
  3. The result appears instantly
  4. Copy the output to your clipboard

What Base64 Encoding Is Used For

Base64 encoding converts binary data into ASCII text, making it safe to transmit through systems that only handle text. Common uses include embedding small images directly in HTML or CSS (data URIs), encoding email attachments (MIME), and passing binary data in JSON APIs. Note that Base64 is not encryption — it's easily reversible and provides no security.

When to Use Base64 Encoding

Use Base64 encoding to embed binary data (images, files) in text-based formats like HTML, CSS, JSON, or email. Common use cases include embedding small images directly in HTML or CSS (data URIs), encoding file attachments in email (MIME), sending binary data through REST APIs, and encoding authentication credentials for HTTP Basic Auth headers.

Common Use Cases

Expert Tips

  • Only embed images as Base64 data URIs if they are under 10 KB — larger Base64 strings bloat your HTML and cannot be cached separately by browsers
  • Base64 is encoding, not encryption — anyone can decode it instantly, so never use it to protect sensitive data
  • When using Base64 in URLs, use the Base64url variant (replacing + with - and / with _) to avoid conflicts with URL special characters

Frequently Asked Questions

What is Base64 encoding?
Base64 is a binary-to-text encoding scheme that converts binary data into a string of ASCII characters. It uses 64 characters (A-Z, a-z, 0-9, +, /) plus = for padding. The encoded output is about 33% larger than the original data, but it can safely travel through systems that only support text.
Is Base64 encryption?
No, Base64 is encoding, not encryption. It does not provide any security — anyone can decode Base64 instantly. For security, use proper encryption algorithms like AES or RSA.
When should I embed images as Base64?
Embed small images (under 10KB) as Base64 data URIs to save HTTP requests. For larger images, use regular file URLs — Base64 increases file size by 33% and cannot be cached separately by the browser.
Is this encoder free and private?
Yes, completely free. All encoding and decoding happens in your browser — no data is sent to any server.

Related Tools

Learn More

Chrome ExtensionFree

Base64 Encode/Decode

Encode and decode Base64 strings instantly from your browser toolbar. No need to visit a website for quick conversions.

Install Free Extension