What is Base64 Encoder/Decoder?

A Base64 Encoder/Decoder is a free online tool that converts binary data into ASCII text format. Base64 encoding is commonly used when you need to transmit binary data (like images, files, or binary protocols) over media that only support text, such as JSON, XML, or email.

The Base64 alphabet consists of 64 characters: A-Z, a-z, 0-9, +, and /. The = character is used for padding.

Why Use Base64 Encoder/Decoder?

  • Data Transmission — Encode binary data for safe text transmission
  • Email Attachments — MIME encoding for email attachments
  • Data URLs — Embed small images directly in CSS or HTML
  • API Development — Encode binary data in JSON or XML payloads
  • Authentication — Basic HTTP authentication uses Base64 encoding

How Base64 Encoding Works

Base64 encoding converts every 3 bytes (24 bits) into 4 ASCII characters. Here's how it works:

  1. Take 3 bytes of binary data
  2. Split into 4 groups of 6 bits each
  3. Convert each 6-bit value to a Base64 character
  4. Add padding (=) if needed

Common Uses of Base64

Data URLs in HTML/CSS

<img src="data:image/png;base64,iVBORw0KG...">

Email Attachments (MIME)

Email systems use Base64 to encode binary attachments in text-only email messages.

JSON Web Tokens (JWT)

JWTs use Base64 encoding for the header and payload sections.

API Authentication

Basic HTTP authentication encodes credentials as username:password in Base64.

How to Use Base64 Encoder/Decoder

  1. Enter your text in the input field above
  2. Click "Encode" to convert to Base64 format
  3. Click "Decode" to convert Base64 back to regular text
  4. Click "Copy Result" to copy the output

Base64 Encoding Table

DecimalBinaryBase64
0000000A
1000001B
.........
25011001Z
26011010a
.........
521101000
611111019
62111110+
63111111/

Advantages and Limitations

Advantages

  • Universal compatibility across systems
  • Safe transmission over text-only protocols
  • No special character handling needed

Limitations

  • Increases data size by approximately 33%
  • Not encryption (easily decoded)
  • Not suitable for large files

Frequently Asked Questions

Is Base64 encoding secure?

No. Base64 is not encryption and can be easily decoded. Never use it to hide sensitive data like passwords. Use proper encryption methods instead.

What's the difference between Base64 and UTF-8?

UTF-8 is a character encoding that represents text. Base64 is an encoding that converts any data to ASCII text. UTF-8 is often the first step before Base64 encoding.

Can I encode images with Base64?

Yes, small images can be Base64 encoded and embedded directly in HTML or CSS using Data URLs. However, this increases page size and should only be used for small icons.

Why does my decoded text look garbled?

If you're trying to decode text that isn't valid Base64, or if the original data was binary (not text), the output will appear garbled. Base64 can encode any binary data, not just text.

Is Base64 encoding reversible?

Yes, Base64 encoding is completely reversible. If you have the encoded string and the original encoding method, you can always decode it back.