⌘K

Developer

Base64

Base64 is an encoding scheme that represents binary data using 64 printable ASCII characters so it can travel safely through text-only channels.

Updated 12 Aug 2026

How the encoding works

Base64 takes three bytes of input — 24 bits — and re-slices them into four 6-bit groups. Each group indexes an alphabet of A–Z, a–z, 0–9, plus and slash, producing four printable characters. Output is therefore about 33% larger than the input, which is the price of surviving systems that only handle text.

When the input length is not a multiple of three, the final group is padded with one or two equals signs so the output length stays a multiple of four. A URL-safe variant swaps plus and slash for minus and underscore, because the standard characters have special meaning inside URLs.

Base64 is not encryption

Anyone can decode Base64 instantly — there is no key and no secret. Never use it to hide passwords, tokens or personal data. Encode for transport, encrypt for confidentiality.

Where it shows up

  • Data URIs that embed a small image or font directly in CSS or HTML
  • Email attachments, which MIME encodes so binary survives mail servers
  • HTTP Basic authentication headers
  • JWT segments, which use the URL-safe variant
  • Binary blobs stored inside JSON or XML documents

Base64 Encoder

Encode or decode text and files locally — nothing is uploaded.

Try Base64 Encoder

Characteristics

  • 64-character alphabet plus = for padding
  • Three input bytes become four output characters
  • Increases size by roughly one third
  • Reversible with no key — an encoding, not a cipher
  • URL-safe variant replaces + and / with - and _

Common uses

  • Embedding small assets as data URIs
  • MIME email attachments
  • HTTP Basic authentication credentials
  • Encoding binary payloads inside JSON or XML

Advantages

  • Lets binary data pass through text-only protocols unchanged
  • Supported natively in every language and browser
  • Deterministic and lossless
  • Simple to debug — the output is visible plain text

Limitations

  • Adds about 33% to payload size
  • Provides no security whatsoever
  • Large encoded blobs bloat JSON and slow parsing
  • Standard alphabet is unsafe in URLs without the variant

Examples

Encoding a short string, with padding on the final group
Input:  ToolSera
Base64: VG9vbFNlcmE=

Input:  Hi
Base64: SGk=

Frequently asked questions

What is Base64 used for?

Carrying binary data through channels that only accept text: email attachments, data URIs, auth headers and JSON payloads.

Is Base64 encryption?

No. It is a reversible encoding with no key, so anyone can decode it instantly.

Why does Base64 end with equals signs?

Padding keeps the output length a multiple of four when the input is not a multiple of three bytes.

Does Base64 make files bigger?

Yes, by roughly 33%, so avoid it for large assets you can serve as binary.

What is URL-safe Base64?

A variant that uses - and _ instead of + and / so the result can appear in a URL without escaping.

Related terms

All terms

Related tools

Related guides

All guides