Paste the messy version — it is fine
Base64 that reaches you in real work is rarely clean. This tool repairs the usual damage on its own.
- Line breaks and spaces — copy from a mail header or a PEM certificate and the string is chopped every 76 or 64 characters
- base64url —
-and_that came out of a JWT or a URL are turned back into+and/ - Missing padding — if the trailing
=was stripped, the length is used to work out how much to add back
When the result comes out as garbage
Base64 does not remember a character set. Only bytes survive the round trip, so the receiving
side has to know what encoding the original text was in. If letters come back as
������, change the character set.
| What you see | What to try |
|---|---|
| Text from any modern system looks wrong | UTF-8 (the default) |
| Text from an old Windows or government system | EUC-KR / CP949 |
A . wedged between every letter | UTF-16 LE |
| Western European accents are mangled | ISO-8859-1 |
If the bytes are not text at all, you get a hex dump instead, and the Save file button switches to the format identified from the leading bytes — PNG, JPG, PDF, ZIP and so on.
The "wrong length" error
Base64 packs three bytes into four characters, so once the padding is removed the length can never leave a remainder of one when divided by four. Seeing this error means the value was truncated. Usually a log viewer cut a long line, or a character was missed while copying.
If anyone can decode it, Base64 is not encryption — right?
Right. Base64 is an encoding, not a cipher. There is no key and anyone can reverse it. "We Base64'd it" is not a security measure.
I pasted a JWT and only part of it decoded
A JWT is three pieces separated by dots (.). Pasting the whole thing will not
work here. Use the JWT Decoder instead — it shows the header,
the payload and the expiry together.