Quick answer

Base64 represents bytes as ASCII characters; it does not specify what those bytes mean. To recover multilingual text, decode Base64 to bytes and then interpret those bytes as UTF-8. Treating each byte directly as a legacy character is the usual cause of garbled text.

How to do it

  1. Remove accidental whitespace and confirm the input uses the expected Base64 alphabet.
  2. Decode the characters into the original byte sequence.
  3. Decode those bytes with UTF-8 and report invalid sequences instead of silently replacing them.

Why browser examples often fail

Older examples use atob() and treat its return value as final text. That string represents byte values, so non-ASCII UTF-8 becomes mojibake. A correct implementation converts the values to Uint8Array and uses TextDecoder with UTF-8.

Padding and Base64URL

Standard Base64 may end with one or two equals signs. JWT segments use the URL-safe variant, replacing plus and slash and commonly omitting padding. Normalize only when you know which variant the source uses; random character repairs can hide corrupt input.

Common mistakes to avoid

  • Assuming Base64 always contains text.
  • Passing atob() output directly to the page.
  • Mixing standard Base64 and Base64URL alphabets.

Try the related tool

Use QRFoundry directly in your browser. Tool inputs and uploaded files are processed on your device.

Open Base64 Encoder & Decoder