Base64 Encoder / Decoder

Encode or decode Base64 text and files instantly in your browser.

Text
Input
Output

What is Base64?

Base64 is a binary-to-text encoding scheme that represents binary data using a set of 64 printable ASCII characters (A–Z, a–z, 0–9, +, /). It was originally designed to allow binary data to be safely embedded in text-based protocols like email (MIME) where certain binary sequences had special meanings or were filtered by gateways.

Today, Base64 is ubiquitous in web development: images can be embedded directly in HTML or CSS as Base64 data URIs (src="data:image/png;base64,..."), basic authentication credentials are Base64-encoded in HTTP headers (Authorization: Basic dXNlcjpwYXNz), JWT tokens use Base64URL (a URL-safe variant) for their header and payload sections, and binary data in JSON or XML payloads is often Base64-encoded since these formats cannot natively represent binary.

Base64 encoding increases size by approximately 33% — every 3 bytes of input become 4 Base64 characters. This is an acceptable trade-off for compatibility, but large binary files should not be routinely Base64-encoded where a binary-capable transport is available.

Common mistakes

  • Confusing Base64 encoding with encryption — Base64 is an encoding scheme, not encryption. Anyone can decode a Base64 string instantly. Never use Base64 to protect sensitive data.
  • URL-unsafe Base64 — Standard Base64 uses + and /, which have special meanings in URLs. Use Base64URL (- and _ instead) for URLs and JWT tokens.
  • Padding issues — Base64 output is padded with = characters to make it a multiple of 4. Some systems strip padding; others require it.