Encode & Decode  |  UTF-8 & binary safe  |  RFC 4648  |  100% instant

Base64 Encoder / Decoder

Encode any text or data to Base64 and decode Base64 strings back to plain text instantly. Widely used for encoding API tokens, email attachments, JWT payloads and binary data in text-based formats.

1
Encode to Base64
Enter plain text and convert it to a Base64 string

2
Decode from Base64
Paste a Base64 string and convert it back to plain text
Base64 output auto-filled. Click Decode to convert back to plain text.

What is Base64 Encoding?

Base64 encoding is a method to represent binary data as an ASCII string. It converts binary data into a 64-character alphabet (A–Z, a–z, 0–9, +, /) to make it safe for transmission over text-based systems like email or APIs. Each group of 6 bits in the input is mapped to one of these characters, increasing the data size by ~33%.

Important: Base64 is encoding, not encryption. It is easily reversible and provides no security — do not use it to protect sensitive data.

How Base64 encoding works

  1. Divide the input into 3-byte (24-bit) chunks
  2. Split each 24-bit chunk into four 6-bit groups
  3. Map each 6-bit value to a Base64 alphabet character (0–63)
  4. Add = padding if the input length is not a multiple of 3

Example: "Man" → binary 010011 010110 000101 101110 → values 19, 22, 5, 46 → Base64: TWFu

Common use cases

Use caseExample
JWT tokensHeader.Payload.Signature — all Base64URL encoded
Email attachmentsMIME encoding of binary files
Data URLsdata:image/png;base64,... in HTML/CSS
HTTP Basic Authusername:password encoded in Authorization header
API tokensBinary keys encoded as text for JSON or HTTP headers

Base64 vs Base64URL

Standard Base64 uses + and / which are not safe in URLs. Base64URL (RFC 4648 §5) replaces them with - and _, and omits the = padding. This variant is used in JWT tokens and OAuth flows.

References

  1. RFC 4648 — The Base16, Base32 and Base64 Data Encodings
  2. MDN Web Docs — Base64
  3. Base64 on Wikipedia