A JWT header segment
Input
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9
Result
{"alg":"HS256","typ":"JWT"}Every JWT begins with a Base64URL-encoded JSON header. Seeing eyJ at the start of a string is a reliable hint that the decoded value begins with {".
Inspect and decode Base64 payloads without leaving your browser.
Encode this developer note.
Understand the format
Decoding reverses the 6-bit packing and then interprets the recovered bytes as UTF-8 text, which tells you immediately whether a string was ever text at all.
Decoding recovers the original bytes exactly. Whether those bytes are meaningful text is a separate question. A Base64 string may unpack into a PNG header, a gzip stream, a protocol buffer, or an encrypted blob, in which case the decoded output looks like noise. That is still a useful result: it tells you the value was never plain text and that another step is needed.
A quick heuristic before decoding: standard Base64 contains only A-Z, a-z, 0-9, plus, slash, and trailing equals signs, and its length is a multiple of four. If a string contains hyphens or underscores it is probably URL-safe Base64, and if it contains three dot-separated segments it is probably a JWT.
This decoder normalises common variations before decoding: whitespace and line breaks are stripped, the URL-safe characters - and _ are converted back to + and /, and missing padding is restored. That means a value copied out of a wrapped email header, a URL query parameter, or a JWT segment usually decodes without manual cleanup.
If decoding still fails, the input is genuinely not valid Base64. The usual causes are a truncated copy, a stray character picked up from the surrounding text, or a value that was double-encoded and needs a second pass.
Step by step
Decoding uses the browser atob and TextDecoder APIs in the page, so encoded credentials and internal payloads stay on your machine.
Worked examples
Input
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9
Result
{"alg":"HS256","typ":"JWT"}Every JWT begins with a Base64URL-encoded JSON header. Seeing eyJ at the start of a string is a reliable hint that the decoded value begins with {".
Input
dXNlcjpwYTU1d29yZA==
Result
user:pa55word
A concrete demonstration that Base64 offers no protection: the credentials come straight back out.
Reference
| Clue | Likely format | Next step |
|---|---|---|
| Starts with eyJ | JSON encoded as Base64 | Decode, then format the JSON. |
| Three parts separated by dots | JSON Web Token | Use the JWT decoder instead. |
| Contains - or _ and no padding | URL-safe Base64 | Decodes here; the variant is normalised automatically. |
| Length not a multiple of four | Padding stripped or value truncated | Padding is restored; if it still fails, the copy is incomplete. |
| Decodes into unreadable characters | Binary, compressed, or encrypted data | Identify the container format before going further. |
Practical Guide
Troubleshooting
FAQ
Usually a truncated copy or an unexpected character from the surrounding text. Padding, whitespace, and the URL-safe alphabet are all normalised automatically, so those are not the cause here.
You can decode any single segment, but the JWT decoder splits the token and formats the header and payload for you, including converting the timestamps.
The bytes are not valid UTF-8 text. That normally means the original data was binary, for example an image, an archive, or ciphertext.
Completely. Encoding and decoding are exact inverses, which is precisely why Base64 must never be relied on for confidentiality.
Yes. Missing = characters are restored before decoding, which is what makes JWT segments and URL parameters work directly.
Go deeper