Base64 Converter

Base64 Encoder and Decoder

Encode any text to Base64 or decode a Base64 string back to text. Use the URL-safe variant when you need to embed the result in a URL or filename. Conversion happens locally in your browser.

Input
Output

What is Base64 encoding?

Base64 is a binary-to-text encoding that represents arbitrary bytes using only 64 printable ASCII characters: A-Z, a-z, 0-9, plus + and / (or - and _ in the URL-safe variant). It is the standard way to embed binary data — images, certificates, encrypted blobs — inside text-only formats like JSON, XML, email or HTTP headers.

Encoding inflates size by exactly 4/3 (33%): every three bytes of input become four output characters. The encoding is fully reversible, so decoding gives back the original bytes byte-for-byte. The URL-safe variant swaps + and / for - and _ to avoid breaking URL encoding rules.

How to use this tool

  1. Pick the mode you need: Encode (text → Base64) or Decode (Base64 → text).
  2. If your Base64 needs to fit inside a URL or filename, tick the URL-safe checkbox.
  3. Paste your text or Base64 into the input area. The result appears instantly on the right.
  4. Hit Copy to put the output in your clipboard. Use Swap to chain encode then decode (a quick way to verify a round-trip).

Frequently asked questions

Can I encode binary files?

This tool currently handles text only. For files, drag-and-drop into the converter is on the roadmap. As a workaround, paste the file contents (e.g. via xxd or another tool) or use a desktop utility like base64.

Does encoding handle non-ASCII characters?

Yes. The input is first encoded as UTF-8 bytes, then those bytes are Base64-encoded. Emoji, accents and CJK characters all round-trip correctly through encode + decode.

What is URL-safe Base64?

Standard Base64 uses + and /, both of which are reserved in URLs. The URL-safe variant (RFC 4648 §5) replaces them with - and _, and drops the trailing = padding. Use this variant for URLs, filenames or JWT segments.