zerouploads

Base64 Decoder

Decode Base64 back to text or a file. Handles URL-safe input, missing padding and embedded line breaks.

  • Preview
  • Unlimited
  • No signup
  • Private
  • Works offline

Base64 ConverterText or files, either direction

59 characters · padding 1 × =auto: standard alphabet

DecodedValid

{"sub":"user_8421","plan":"team","seats":12}

44 bytes · valid UTF-8detected: JSON

The decoded bytes parse as JSON.Open in JSON Formatter →

Decoding settings
59 characters in / 44 bytes out · decoded as UTF-8 text

How it works

  1. 01

    Paste the Base64

    Line breaks, missing padding and URL-safe characters are all fine as they are.

  2. 02

    Read the output

    Text appears in the second pane. Bytes that are not text offer a download instead.

  3. 03

    Copy or save

    Copy the text, or save the bytes as a file with the right extension.

What the decoder tolerates

Real Base64 rarely arrives clean. Base64 copied out of an email carries a line break every 76 characters. JWT segments have their padding stripped. URL-safe variants use - and _ in place of + and /. All three are accepted here without you saying so. Whitespace is ignored, the padding is worked out from the length, and the alphabet is read from the characters present.

What cannot be repaired is a string that is cut short. Base64 packs three bytes into four characters. So a length that will not divide up means characters are missing, and the end of the data went with them. The tool reports that case instead of decoding it into rubbish.

Accepts
Both alphabets, padded or not, with any whitespace.
Output
Text in your chosen encoding, or a file download.
Detection
Spots JSON, images and common file types in the output.
Errors
Bad characters and impossible lengths get a position.

Decoding binary

Not everything decodes to readable text. If the bytes are a PNG, a PDF or a zip, the tool reads the file signature first. It then offers a download with the right extension, instead of printing control characters into the page.

The text check is strict on purpose. Bytes that are not valid UTF-8 are reported as not text. Showing them with replacement characters scattered through would look like a decoding bug, when the real problem is the wrong format.

Frequently asked questions

Why does my Base64 fail to decode?
For one of two reasons, and the tool says which. Either a character is outside the Base64 alphabet, or the string is cut short. Base64 stores three bytes in four characters, so a length that cannot divide up means characters are missing. Whitespace and missing padding are handled for you, so neither is the cause.
Does it handle URL-safe Base64?
Yes, without being told. The - and _ characters appear only in the URL-safe form, so a string carrying them answers the question itself. You can also set the alphabet by hand.
Can I decode a JWT here?
You can decode one segment at a time, since each is Base64. For the whole token, with its claims and expiry read out, use the JWT decoder instead.
Is padding required?
No. The equals signs only pad the length, and the length alone says how many were dropped. That is why a JWT segment decodes here even though it has none.
Can I decode to a file?
Yes. If the bytes are not text, the tool says so and offers a download. It reads the file signature first, so a PNG saves as .png rather than .txt.
What does the On invalid characters setting do?
Report stops and points at the character, which is what you want when a string should be clean. Ignore drops anything outside the alphabet, which is what you want when it was copied out of a log.
Why does it say the output is not text?
Because not every set of bytes is. The check is strict on purpose. If it cannot read them as valid UTF-8, it says so instead of filling the page with replacement characters.
Is my data sent anywhere?
No. The decoding happens in this tab, so tokens and payloads never leave your device and there is nothing to log.
Does this work offline?
Yes. Once the page has loaded, decoding carries on with no network connection.
Browse all developer tools