Skip to content

Base64 Encode / Decode

Encode text to Base64 or decode it back. Supports UTF-8 and URL-safe Base64.

Output

How to use the Base64 Encode / Decode

  1. Choose Encode or Decode.

  2. Type or paste your text — for Decode, paste a Base64 string (padding is optional either way).

  3. Copy the converted result, or toggle URL-safe first if it's going into a URL.

What is Base64 encoding?

Base64 turns arbitrary bytes into a 64-character alphabet (A-Z, a-z, 0-9, + and /) so binary data survives text-only channels — email attachments (MIME), data: URIs, JSON payloads, and the header/payload segments of a JWT are all Base64 underneath. The mechanics: every 3 input bytes (24 bits) become 4 output characters (four 6-bit groups); if the input isn't a multiple of 3 bytes, '=' padding fills the gap. Encoding the word "Man" — bytes 0x4D 0x61 0x6E — regroups the 24 bits into six-bit chunks 010011 010110 000101 101110, which map to T, W, F, u, giving "TWFu". Because the output is ~33% larger than the input, Base64 is a poor choice for bandwidth-sensitive transfers — it's a compatibility encoding, not a compression scheme, and it is not encryption: anyone can decode it back with zero secret. This tool also offers the URL-safe variant (RFC 4648 §5), which swaps + for -, / for _, and drops the = padding so the result can sit unescaped inside a URL path or query string.

For a step-by-step walkthrough, read our guide: Base64 Encoding & Decoding: The Complete Developer Guide.

Key features

  • Encode and decode in one place, output updates as you type
  • Correct UTF-8 handling, including multi-byte emoji and accented characters
  • URL-safe Base64 toggle (- _ alphabet, no padding) for tokens embedded in URLs
  • Swap output back into input for quick round-trip verification

Frequently asked questions

Is Base64 secure or encrypted?

No. Base64 is reversible encoding, not encryption — anyone can decode it with a one-line btoa/atob call, so never use it alone to protect secrets or passwords.

What is URL-safe Base64 and when do I need it?

Standard Base64's + and / characters have special meaning inside URLs, and = padding can get stripped by some systems. URL-safe Base64 replaces + with -, / with _, and omits padding — it's what JWTs and many OAuth tokens use.

Does it support emoji and accented characters correctly?

Yes — text is encoded as UTF-8 bytes first, so multi-byte characters (emoji, é, ñ, 中文) round-trip correctly instead of corrupting into mojibake.

Why is my decoded output garbled?

Usually a mismatched variant — decoding URL-safe Base64 (with - and _) using the standard decoder, or vice versa. Try the URL-safe toggle if the plain decode fails.