Base64 Encoder / Decoder

UTF-8-safe Base64 in both directions — with a URL-safe alphabet toggle, RFC 4648-exact output and honest error states.

How to use

  1. Paste text or Base64 into the input box.
  2. Pick Encode or Decode; enable URL-safe output if you need - and _ instead of + and /.
  3. Copy the result — invalid input gets a clear error instead of garbage.

Frequently asked questions

Is the Base64 here safe for emoji and Chinese text?

Yes. Input is first encoded to UTF-8 bytes, and decoding runs through a strict UTF-8 validator. If a decoded payload contains byte sequences that are not valid UTF-8, the tool tells you instead of silently printing garbage.

What is the URL-safe alphabet?

Standard Base64 uses + and /, which are awkward inside URLs and file names. The URL-safe variant swaps them for - and _ and drops the trailing = padding. Enable the toggle to emit that form; decoding accepts both alphabets automatically.

Why does decoding fail on my string?

Base64 length must be a multiple of 4 and contain only the 64 alphabet characters (plus padding). Spaces and newlines are stripped for you; anything else — a stray letter cluster like "Zm9" — is genuinely incomplete and rejected.

Can I decode something that is not UTF-8 text?

The output is always interpreted as UTF-8 text. Decoding a binary file will produce replacement characters and a strict-decode warning — for files use the dedicated image-to-Base64 tool instead.

Does this send my text anywhere?

Never. Encoding and decoding happen in your browser’s memory only — nothing is transmitted, logged or stored.

Comments