Base64 decoder
Turn a Base64 string back into readable text. The decoder accepts both the standard and URL-safe alphabets, fixes missing padding for you, and decodes the bytes as UTF-8 — useful for inspecting JWT payloads, data URIs, config values and email headers.
How it works
First the tool normalises the input: URL-safe characters - and _ are
converted back to + and /, and any missing = padding is restored so the
length is a multiple of 4. It then uses the browser’s built-in atob to turn
each group of 4 characters into 3 bytes, and decodes those bytes with a strict
UTF-8 decoder. If the bytes are not valid UTF-8, or the length is malformed, it
reports an error rather than returning garbage.
Example
Decoding SGVsbG8sIEdlcmEgVG9vbHMh:
SGVsbG8sIEdlcmEgVG9vbHMh→Hello, Gera Tools!
| Base64 | Decoded text |
|---|---|
R2VyYQ== | Gera |
SGk= | Hi |
To encode in the first place, use the Base64 encoder. All decoding happens locally in your browser — nothing is uploaded.
When you actually need a Base64 decoder
Base64 is not encryption — it is purely an encoding scheme designed to represent binary data using only printable ASCII characters. You encounter it constantly in real work without always recognising it:
- JWT inspection: A JSON Web Token (JWT) is three Base64url-encoded sections separated by dots. The middle section (payload) is where claims like user ID, role, and expiry live. Paste the payload section here to read it — but remember, JWTs are signed, not encrypted. Anyone who holds the token can decode the payload; the signature only prevents tampering.
- Email headers: MIME-encoded email headers use Base64 when subject lines or sender names contain non-ASCII characters. If you see
=?UTF-8?B?...?=in a raw email header, the...part is Base64. - Data URIs: Images and fonts embedded directly in HTML or CSS use the pattern
data:image/png;base64,.... The Base64 portion after the comma is the raw image binary. This decoder will show garbled text for binary data because it decodes to UTF-8 — use a Base64-to-image tool if you need to view the image. - API responses and config values: Some APIs and configuration systems Base64-encode credentials, tokens, or serialised JSON for transport. If a config value “looks random” and ends in
=or==, try decoding it here.
Common errors and what they mean
| Error | Likely cause |
|---|---|
| Invalid character | The string contains a space, newline, or non-Base64 character — strip it and try again |
| Odd length / incomplete byte | The Base64 is truncated; you may have copied only part of it |
| Invalid UTF-8 sequence | The decoded bytes are not text (image, audio, etc.) — this tool is text-only |
Standard vs. URL-safe Base64
The standard Base64 alphabet uses + and / as the 62nd and 63rd characters. These are not safe in URLs (they have special URL meaning), so URL-safe Base64 replaces them with - and _. JWTs and OAuth tokens almost always use URL-safe Base64 and drop the = padding. This decoder handles both automatically.