Skip to content
100% in your browser. Nothing you paste is uploaded — all processing runs locally. Read more →

Base64 → Text

Paste base64 below, get the decoded UTF-8 text. Whitespace, line breaks, and URL-safe variants all work.

🔒 100% client-side · no upload · no account

How the decoder works

  1. Strip whitespace (spaces, tabs, newlines).
  2. Replace - with + and _ with / (URL-safe normalization).
  3. Pad with = until length is a multiple of 4.
  4. Run through atob() to get a binary-string of the bytes.
  5. Convert to a Uint8Array and decode as UTF-8 with TextDecoder.

Steps 1–4 produce bytes; step 5 produces text. If the bytes aren't valid UTF-8, step 5 throws a "decode error" — that's usually a sign the input was binary data, not text.

Common things to decode

What "decode error" means

Two distinct failure modes:

In code

// JavaScript (UTF-8 safe)
const bytes = Uint8Array.from(atob(b64.replace(/-/g,"+").replace(/_/g,"/")),
                              c => c.charCodeAt(0));
const text = new TextDecoder().decode(bytes);

// JavaScript (Node 16+)
Buffer.from(b64, "base64").toString("utf-8");
Buffer.from(b64, "base64url").toString("utf-8");

// Python
import base64
base64.b64decode(b64).decode()
base64.urlsafe_b64decode(b64 + "==").decode()  // urlsafe needs padding sometimes

// Bash
echo "$b64" | base64 -d

// Go
import "encoding/base64"
data, _ := base64.StdEncoding.DecodeString(b64)

FAQ

It says decode error — what's wrong?

The most common causes: (1) the input isn't valid base64 (extra characters, wrong alphabet), (2) the input is base64 but the bytes aren't valid UTF-8 text (it's binary data), (3) padding is missing on a strict decoder. Try removing whitespace, or use the file decoder for binary content.

Does it accept URL-safe base64?

Yes. The decoder normalizes -/_ back to +// automatically. Both forms decode to the same bytes.

Can I decode something that has line breaks?

Yes. The decoder strips whitespace before decoding. MIME-style 76-character line wrapping is handled.

How do I decode a JWT payload?

Split the JWT on ., take the second part (the payload), and paste here. It's URL-safe base64 of a JSON string. For full JWT inspection (including signature verification), use our JWT decoder.