Blog

How to Decode Base64 Online (and in Code)

Decode Base64 back to text or binary — online instantly, or in JavaScript, Python, and the command line. With UTF-8 gotchas and a free decoder tool.

Base64 decoding reverses the encoding: it turns the 64-character text back into the original bytes. Here's how to do it everywhere.

Decode online

The fastest way is the Base64 decoder — paste the encoded string, switch to decode mode, and read the result. It runs entirely in your browser, so sensitive data never leaves your machine.

Decode in JavaScript

In the browser, use atob:

js
const text = atob('SGVsbG8=');   // "Hello"

For UTF-8 (accents, emoji), atob alone mangles multibyte characters. Decode safely with:

js
const bytes = Uint8Array.from(atob(b64), c => c.charCodeAt(0));
const text = new TextDecoder().decode(bytes);

Decode in Python

python
import base64
base64.b64decode("SGVsbG8=").decode("utf-8")   # "Hello"

Decode on the command line

bash
echo "SGVsbG8=" | base64 --decode

Common gotchas

  • Wrong padding — Base64 length must be a multiple of 4. Missing = padding causes errors.
  • URL-safe variants — some tokens use - and _ instead of + and /. See URL-safe Base64.
  • UTF-8 — always decode bytes, then convert to text, or non-ASCII breaks.

Once decoded, if you have JSON, clean it up with the config validator. Working with tokens? Try the JWT decoder, which Base64-decodes each segment for you.

Got a file to check?
Paste it in. Errors come back in plain English.
Open Base64 Encode / Decode →