Work · 18+

Base64 Encoder / Decoder

Encode, Decode, Inspect, and Convert

Paste text or a Base64 string to encode or decode it. Supports standard Base64, Base64URL, MIME, Data URI, and PEM formats with hex inspection and download.

Back to timeline
300 × 250
Advertisement
Use tool</> EmbedPress ⌘D / Ctrl+D to bookmark

Base64 Converter

Encode or Decode Base64

How to Use the Base64 Encoder / Decoder

  1. Select Encode or Decode with the mode toggle.
  2. To encode: Paste or type text, choose a format (Standard, Base64URL, MIME, or Data URI), then click Encode.
  3. To decode: Paste a Base64 string (including Data URI, PEM, or JWT segments), keep Auto-detect checked, then click Decode.
  4. Switch between Text, Hex, and Info tabs to inspect the decoded output.
  5. Copy the result or download it using the buttons below the output.

How Base64 Encoding Works

Base64 converts binary data into a string of 64 printable ASCII characters: A–Z, a–z, 0–9, +, and /. Every 3 bytes of input become 4 characters of output. If the input length is not divisible by 3, one or two = padding characters are appended to make the output length a multiple of 4.

The result is roughly 33% larger than the input. Base64 is not encryption — it is a reversible encoding. Anyone with the encoded string can recover the original bytes. It is used because many text protocols (HTTP headers, JSON, XML, email) cannot safely carry arbitrary binary bytes.

Base64 Variants

  • Standard (RFC 4648 §4): uses + and / as the 62nd and 63rd characters. Output is padded with = to a multiple of 4.
  • Base64URL (RFC 4648 §5): replaces + with - and / with _ to make the output safe in URLs and filenames without percent-encoding. Used in JWTs and OAuth tokens.
  • MIME (RFC 2045): wraps output at 76 characters per line with line breaks. Used in email attachments and multipart bodies.
  • Data URI: prefixes the Base64 payload with data:{mime};base64, for embedding images and files directly in HTML or CSS.
  • PEM: wraps Base64 in -----BEGIN ...----- / -----END ...----- headers. Used for certificates and keys. The tool strips headers and decodes the inner Base64.

Common Mistakes

  • Missing padding: Some encoders omit trailing =. This tool accepts and repairs unpadded input.
  • Wrong variant: Standard Base64 with + and / will fail URL decoding. Use Base64URL when the string is in a URL or JWT.
  • Whitespace in input: MIME and PEM formats include newlines. This tool strips whitespace before decoding.
  • Assuming Base64 is encrypted: It is not. Do not use Base64 to protect sensitive data.

FAQ

Base64 Questions

Short answers for readers and answer engines.

{item.question}

{item.answer}

Browse

Explore All Tools