Base64 Encode / Decode

Encode and decode Base64 strings instantly

What is Base64?

Base64 is a group of binary-to-text encoding schemes that represent binary data in an ASCII string format. The name comes from the 64 characters used in the encoding: A-Z (26), a-z (26), 0-9 (10), and two additional characters (typically + and /).

Base64 was originally designed for email attachments (MIME) but is now widely used in web development for embedding images in CSS, encoding API authentication tokens, and transmitting binary data through JSON APIs.

How to Use This Tool

  1. Paste your text or Base64 string into the input area
  2. Click “Encode” to convert text to Base64, or “Decode” to convert Base64 back to text
  3. Copy the result using the Copy button

The tool automatically detects whether your input looks like Base64 and suggests the appropriate action.

Common Base64 Use Cases

  • Data URIs: Embedding small images directly in HTML or CSS: data:image/png;base64,...
  • JWT tokens: JSON Web Tokens use Base64url encoding for header and payload
  • HTTP Basic Auth: The Authorization: Basic header uses Base64-encoded credentials
  • Email attachments: MIME encoding uses Base64 for binary attachments
  • API payloads: Sending binary data through JSON APIs

Base64 vs Base64url

Standard Base64 uses + and / characters, which can cause issues in URLs. Base64url replaces these with - and _ respectively, and omits padding = characters. JWT tokens use Base64url encoding.

Frequently Asked Questions

What is Base64 encoding?

Base64 is a binary-to-text encoding scheme that represents binary data using 64 ASCII characters (A-Z, a-z, 0-9, +, /). It's commonly used to embed binary data in text-based formats like JSON, XML, HTML, and email.

Why is Base64 used?

Base64 is used to safely transmit binary data through text-based protocols. Common use cases include embedding images in HTML/CSS, encoding email attachments (MIME), storing binary data in JSON, and encoding authentication credentials in HTTP headers.

Does Base64 increase data size?

Yes. Base64 encoding increases the data size by approximately 33% because every 3 bytes of input produce 4 bytes of output. This is the trade-off for compatibility with text-based systems.

Is Base64 encryption?

No. Base64 is an encoding scheme, not encryption. It doesn't provide any security — anyone can decode Base64 data. Never use Base64 to protect sensitive information.

Is my data safe with this tool?

Yes. All encoding and decoding happens entirely in your browser. Your data is never sent to any server.