🔤

Base64 Encoder / Decoder

Encode and decode Base64 strings.

Base64 Encoding in Plain English

Base64 is a way to represent binary data using only 64 printable ASCII characters: A–Z, a–z, 0–9, and two symbols (usually + and /). It's used whenever you need to embed binary content in a place that only supports text — for example inside a JSON payload, an email attachment, or a data URI in HTML.

How It Works

Base64 groups input bytes three at a time (24 bits) and re-slices them into four 6-bit chunks, each mapped to one of the 64 characters. If the input length isn't a multiple of three, the output is padded with= signs so its length is always a multiple of four. The output is about 33% larger than the input.

When Base64 Helps

  • Embedding images inline with data:image/png;base64,...
  • Encoding file uploads in JSON APIs where multipart isn't convenient.
  • Carrying credentials in HTTP Basic Auth headers.
  • Serializing binary blobs into text-only storage formats.

Base64 Is Not Encryption

Despite looking scrambled, Base64 is not encryption. Anyone can decode it instantly — including this tool. If you need to protect data, use real encryption (AES, for example) in addition to encoding.

URL-Safe Base64

Standard Base64 uses + and /, which have special meanings in URLs. A "URL-safe" variant replaces these with- and _. JWTs use this variant. If you need URL-safe output, run a search-and-replace after encoding.

Related Developer Tools

Cookie and measurement consent

We use analytics and advertising scripts to measure traffic and fund the site. You can accept or reject marketing cookies now, and review the details in our Privacy Policy.