Skip to main content
zerouploads

base64 decode

Decoded in the page, with nothing uploaded.

Whitespace is ignored, and URL-safe base64 is accepted too.

The short answer

Decoding turns the sixty-four-character alphabet back into bytes and reads those bytes as UTF-8 text. If the result looks like nonsense, the original was probably not text at all: an image or a PDF encoded as base64 decodes to bytes no one can read.

Turns base64 back into text, accepting URL-safe input and ignoring the line breaks that pasted strings tend to arrive with.

The formula

four base64 characters → three bytes → UTF-8 text

Worked examples

"aGVsbG8="
"hello"
URL-safe input with - and _
accepted, and decoded the same
Base64 split over several lines
whitespace ignored

Reference table

Why a decode fails
InputWhat happensWhy
aGVsbG8=Decodes to helloValid, correctly padded
aGVsbG8Decodes anywayPadding is optional to read
aGVsbG8!Error! is not in the alphabet
Half a stringError or nonsenseThe byte groups are incomplete

How to use it

  1. 01Paste the base64Line breaks and spaces are ignored. URL-safe strings using - and _ are accepted too.
  2. 02Read or copy the textIf the input is not valid base64, the box says so rather than showing you nothing.

Also searched for

Searches that land here include base64 decode, base64 to text, base64 decoder, decode base64 online and base64 to string.

Reading base64 back

Four characters, three bytes

Each base64 character carries six bits, so four of them make twenty-four bits, which is three bytes. The decoder works through the string in those groups. That is why a string whose length is not a multiple of four either needs padding or has been cut short, and why a single missing character shifts everything after it.

The URL-safe variant

The standard alphabet includes + and /, which both mean something inside a URL, so a second variant swaps them for - and _. Tokens, signed URLs and cookies mostly use that one. This page accepts either without being told which.

When the output should not be text

If you are decoding something that was originally a file, the useful thing to do with the result is save it as that file, not read it. What you see here in that case is the byte stream interpreted as UTF-8, which is meaningless but harmless.

Questions people ask

Why is the result unreadable?

Because the original was probably not text. An image, a PDF or a zip file encoded as base64 decodes back to bytes that are not characters, and any tool showing them as text will show nonsense. That is the correct answer to the wrong question: the decode worked, the content simply is not readable prose.

Can I read a JSON Web Token with this?

The middle part, yes. A JWT is three base64url sections separated by dots: paste the middle one and you will get the claims as JSON. That is worth knowing for a reason beyond curiosity — anyone holding the token can do the same, so a JWT is not a place to put anything private.

Why does it refuse my string?

Something in it is not in the base64 alphabet, or the length is impossible. A truncated copy and paste is the usual cause, and so is a string that has been through a chat app that turned quotes into curly quotes. Padding, on the other hand, is optional here.