← Back to blog

Base64 decode errors: padding, URL-safe Base64, and readable output

If a Base64 string won't decode, the cause is usually padding, Base64URL characters, or a pasted prefix. This guide shows how to fix each fast with Textavia.

Dec 21, 2025base64debugging
Glassmorphic cards showing Base64 blocks decoding into readable text on a cyan-purple gradient

Base64 decode errors: padding, URL-safe Base64, and readable output

Base64 shows up everywhere: API payloads, config values, JWTs, and data URIs. When it fails to decode, the fix is usually one small cleanup step.

Start here:

  • Open the Base64 encoder/decoder.
  • Paste the string and switch to Decode from Base64.
  • If it looks like a JWT (three dot-separated parts), use the JWT decoder instead.

Base64 is encoding, not encryption

Base64 turns bytes into text so it can travel through systems that are picky about characters (URLs, JSON, headers, CSVs).

It does not hide the content. If you can see the Base64 string, you can usually decode it.

If you want the exact alphabet and padding rules, see RFC 4648.

Quick signs you are looking at Base64

None of these are perfect, but they help you decide what to try first:

  • It is long and has no spaces.
  • It ends with = or == (padding).
  • It uses only letters, numbers, +, and / (standard Base64).
  • It uses - and _ instead of + and / (Base64URL, common in JWTs).

If the string contains lots of {, :, or quotes already, it is probably not Base64. Try formatting it as JSON first with the JSON formatter.

The most common Base64 decode failures (and the fix)

Use this table when you want the fastest path to readable output.

What you seeWhat it usually meansFix
Error or empty outputYou pasted extra characters or whitespaceRemove spaces, newlines, and surrounding quotes
It decodes, but looks like garbageThe decoded bytes are not UTF-8 textIt might be a file, compressed data, or binary; decode only if you know it should be text
It fails unless you add =The string is missing paddingAdd = until the length is a multiple of 4
It contains - and _It is Base64URL (not standard Base64)Replace -+, _/, then add = padding if needed
It starts with data:It is a data URI, not raw Base64Remove the data:...;base64, prefix and decode only the Base64 part
It contains %2F, %2B, or %3DIt is URL-encoded Base64URL-decode first with the URL encoder/decoder, then Base64-decode

Examples you can copy and verify

Decode a Base64 JSON blob

This Base64 string decodes to a JSON object:

eyJ1c2VyIjoiYWRhIiwicm9sZSI6ImFkbWluIn0=

Decoded text:

{"user":"ada","role":"admin"}

If you want it readable, decode it, then paste the result into the JSON formatter.

Decode Base64 that comes with a prefix

You will often see Base64 embedded like this:

data:application/json;base64,eyJ1c2VyIjoiYWRhIiwicm9sZSI6ImFkbWluIn0=

Only the part after the comma is Base64. Remove the prefix, then decode.

Base64URL from JWTs (why it fails in standard decoders)

JWTs use Base64URL, which swaps characters and often removes padding. A JWT signature segment can look like this:

SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c

If you try to decode that with a standard Base64 decoder, it can fail because of the _.

Two good options:

  • If you have the full token, use the JWT decoder.
  • If you only have one segment, convert Base64URL to Base64 (-+, _/), then pad with = to a multiple of 4 characters.

How to use Textavia's Base64 encoder/decoder

  1. Open the Base64 encoder/decoder.
  2. Select Decode from Base64.
  3. Paste the input, then copy the decoded output.

If the output should be readable text but it is not, double-check whether the input is URL-encoded, Base64URL, or a data URI with a prefix.

FAQs

Why does my Base64 string need = at the end?
= is padding. Some systems strip it; the decoder still needs it to know how to finish the last chunk. Add = until the length is divisible by 4.

Is Base64 the same as encryption?
No. Base64 is a reversible encoding. Treat Base64 as plain text for security purposes.

Does Base64 decoding run locally?
Yes. Textavia's Base64 tool runs in your browser for privacy. Still avoid decoding secrets on shared machines.

Tips and proven approaches

  • If your Base64 is wrapped across multiple lines (emails and PEM-like formats), remove line breaks first with remove line breaks.
  • If your input came from logs or CSVs, normalize whitespace before decoding with the whitespace remover.
  • If the decoded output is JSON, format it before you interpret it. Bad spacing hides problems.

Related tools

Privacy and security

Text decoding runs locally in your browser. Your input is not uploaded to a server.