Base64 Encoder / Decoder

Encode or decode Base64 strings and files instantly

0 chars

What is Base64 Encoder / Decoder?

Base64 is an encoding scheme that converts binary data — images, files, audio — or arbitrary text into a sequence of ASCII characters. The name comes from the 64 printable characters it uses (A–Z, a–z, 0–9, +, /). This encoding is used everywhere in modern computing: email attachments, embedding images directly in HTML/CSS as data URIs, JSON web tokens (JWTs), HTTP Basic authentication, and storing binary data in text-based formats.

The encoding works by taking three bytes (24 bits) of input data at a time and converting them to four 6-bit groups, each mapped to one of the 64 printable characters. This results in encoded output that is approximately 33% larger than the original, but guarantees that the data can pass through any text-based system without corruption.

Altairys's Base64 Encoder/Decoder handles both text encoding (UTF-8 strings to Base64) and file encoding (images, PDFs, and other files converted to Base64 data URIs). This is particularly useful for embedding small images directly in HTML or CSS to reduce HTTP requests, encoding binary data for JSON APIs, debugging JWTs, and working with email attachment encoding. The tool runs entirely in your browser with no server involvement — your sensitive data stays local.

How to Use Base64 Encoder / Decoder

  1. Enter text or upload file

    Type or paste text to encode, or upload a file to convert to Base64.

  2. Choose direction

    Select Encode (text → Base64) or Decode (Base64 → text/file).

  3. View the result

    The encoded or decoded result appears instantly in the output area.

  4. Copy the output

    Click Copy to clipboard to use the Base64 string in your code or application.

Key Benefits

Instant encoding

Text encodes and decodes in real time as you type.

File to Base64

Convert images and files to Base64 data URIs for embedding in HTML/CSS.

Locally processed

Your data never leaves the browser — safe for tokens and sensitive strings.

Developer-friendly

Get formatted data URIs (data:image/png;base64,...) ready to paste into code.

Frequently Asked Questions

Embedding images in HTML/CSS, email MIME attachments, JSON web tokens (JWTs), HTTP Basic authentication headers, storing binary data in XML or JSON, and WebSocket binary messages.

No. Base64 is encoding, not encryption. It's easily reversible by anyone without a key. Never use Base64 to protect sensitive data — use proper encryption instead.

The = characters are padding. Base64 encodes data in 3-byte groups. If the input is not a multiple of 3 bytes, one or two = characters are added to pad the output.

You can decode the payload portion (the middle part between dots) of a JWT. However, use Altairys's dedicated JWT Decoder tool for a cleaner interface with field-by-field breakdown.

No — Base64 encoding makes files about 33% larger, not smaller. Use it for compatibility, not compression.

Related Tools