Base64 Encoder / Decoder

Encode text to Base64 and decode Base64 back to text. Supports three variants: Standard (RFC 4648), URL-safe (base64url), and MIME (RFC 2045). All computation in-browser.

Quick load:
▶ Encode — Text to Base64
◀ Decode — Base64 to Text

How to Use This Base64 Encoder/Decoder

Encoding

  1. Type or paste text into the left panel.
  2. Select a variant: Standard for general use, URL-safe for JWTs/URLs, MIME for email attachments.
  3. The encoded Base64 appears instantly. Click Copy to use it.

Decoding

  1. Paste a Base64 string into the right panel.
  2. The tool auto-detects the variant (Standard, URL-safe, or MIME).
  3. Decoded text appears instantly. If the output is binary, you'll see a hex dump instead.

When to Use Each Variant

VariantCharactersBest For
StandardA-Z a-z 0-9 + / =PEM certificates, data URIs, general encoding
URL-safeA-Z a-z 0-9 - _JWT tokens, URL query params, OAuth PKCE
MIMEA-Z a-z 0-9 + / =Email attachments, SMTP content

Common Base64 Encode/Decode Examples

Need to learn how Base64 works? Read our Base64 Encoding Guide for a complete walkthrough of the algorithm, 3-byte-to-4-char conversion, and code examples in Python and JavaScript.
JWT Token Decode: Paste a JWT into the decode panel with variant "URL-safe" to inspect the header and payload. (Note: only Base64-decodes — does not verify signatures.)
PEM Certificate Inspect: Copy the Base64 body of a PEM certificate (between BEGIN and END lines) to decode the DER binary and then parse with the ASN.1 Parser.
Data URI Extract: Paste a data URI like data:image/png;base64,... — the tool extracts and decodes the Base64 portion.
Unicode / Emoji: The encoder correctly handles multi-byte UTF-8 characters and emoji via the TextEncoder API.

Related Tools