JWT Decoder
Inspect the header and payload of a JSON Web Token, read the claims and check the expiry. The signature is not verified.
Bearer and any surrounding quotes first.
Decoded token
Both parts are base64url text that decodes to JSON. The signature is left untouched.
—
—
Common signature algorithms
alg value |
Family | Key used to verify | Shared secret |
|---|---|---|---|
HS256 | HMAC with SHA-256 | The same secret used to sign | Yes |
RS256 | RSA PKCS#1 v1.5 with SHA-256 | The signer's public key | No |
PS256 | RSA-PSS with SHA-256 | The signer's public key | No |
ES256 | ECDSA with P-256 and SHA-256 | The signer's public key | No |
EdDSA | Ed25519 | The signer's public key | No |
none | No signature | Nothing | No |
A JWT is three base64url strings joined by dots
The compact form is easy to pass in an HTTP header, but it is also easy to misread: readable does not mean trusted.
The three parts of a JSON Web Token
A signed token in JWS compact serialization has three segments separated by periods: a header, a payload and a signature. Each of the first two is base64url-encoded JSON; the third is the raw signature bytes, also base64url-encoded.
A header of {"alg":"HS256","typ":"JWT"} encodes to eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.
That string is the standard encoding of the default HMAC-SHA256 header. Seeing it tells you the signing algorithm, not who signed the token.
What the header tells you
The header is a small JSON object that describes how the token was protected. Three fields carry most of the meaning:
algnames the signature algorithm, such asHS256,RS256orES256. A verifier must accept only the algorithms it expects.typis usuallyJWT, an optional hint about the content type.kididentifies which key was used, which matters when a provider rotates signing keys and publishes a key set.
Encrypted tokens, known as JWE, use a different compact form with five segments and a header that also describes the encryption algorithm. This decoder expects the three-segment signed form.
Registered claims in the payload
The payload is a JSON object. Some field names are registered by the JWT specification, which means their meaning is fixed even though their use is optional. Everything else is an application claim defined by whoever issues the token.
| Claim | Meaning | Value type |
|---|---|---|
iss | Issuer that created the token | String or URI |
sub | Subject the token is about, usually a user ID | String or URI |
aud | Intended audience, such as the API name | String or array of strings |
exp | Expiration time; the token must not be accepted after it | Numeric date in seconds |
nbf | Not before; the token must not be accepted earlier | Numeric date in seconds |
iat | Time the token was issued | Numeric date in seconds |
jti | Unique identifier, useful for revocation lists | String |
A numeric date counts seconds since 1 January 1970 at 00:00 UTC. It is not milliseconds and it is not an ISO string. Reading a value such as 1700000000 requires multiplying by 1000
before it can be passed to a JavaScript date.
A typical access token payload might look like {"sub":"user-42","aud":"orders-api","iat":1700000000,"exp":1700003600}.
The difference between exp and iat is the intended lifetime, one hour in this example.
How base64url encoding works
Base64url is standard Base64 with two substitutions: + becomes - and / becomes _. Padding characters are usually removed.
Both changes exist so the value can travel safely in a URL, a cookie or an HTTP header without further escaping.
Decoding therefore reverses the substitutions, restores the missing padding until the length is a multiple of four, and then converts the bytes back to text. This decoder converts the result as UTF-8 so accented names and non-Latin identifiers display correctly.
base64url: - and _ instead of + and /
padding: = removed, restored before decoding
payload text: UTF-8 after the bytes are decoded
Base64 is not compression and it adds no security. A payload is roughly one third longer than the JSON it carries, which is why large claims make large headers.
Decoding is not verification
This page reads the bytes. It does not check the signature, the issuer, the audience or the expiry. A token can be decoded successfully and still be forged, expired or meant for another service.
Verification requires the key that matches alg. For HMAC algorithms the verifier holds the same secret that signed the token. For RSA and ECDSA algorithms the verifier holds the public key.
The signature is computed over the exact text of the first two segments, so changing a single character invalidates it once verification runs.
The dangerous case is "alg":"none". It declares that no signature is present, and a naive verifier that reads the algorithm from the header can be tricked into accepting it.
A server must choose the allowed algorithms from its own configuration and reject anything else, including none.
Treat the payload as public. Anyone holding the token can read every claim, so never put passwords, API keys, full card numbers or private personal data inside it. The token is protected against modification by the signature, not against reading.
Expiry, clock skew and common decoding errors
Servers usually allow a small clock skew when comparing exp and nbf, because the issuer and the verifier rarely share an exact clock.
The allowance is a server setting, not part of the token, so the same token can be valid on one service and expired on another.
| Problem | What you see | Fix |
|---|---|---|
Token copied with Bearer | The first segment fails to decode | Remove the scheme prefix |
| Line breaks or spaces | Base64 error or missing segments | Paste the token as one continuous string |
| Only two segments | The decoder reports a malformed token | Copy the full token including the signature |
| Five segments | The token is encrypted (JWE) | Use a JWE-aware tool and the decryption key |
| Payload is not JSON | JSON parse error after decoding | Confirm the token follows JWS compact form |
| Expired token | Decodes fine but the API returns 401 | Request a new token; check exp |
A token that fails to decode in the browser may still be valid on the server if it was copied incompletely. Compare the number of segments and the last characters before assuming the token itself is broken.
Related Developer & Security Tools
| Tool | What does it do? | Action |
|---|---|---|
| Base64 Encoder & Decoder | Encode text to Base64 or decode a Base64 string back to plain text. | Base64 Codec → |
| Hash Generator | Create MD5, SHA-1, SHA-256 and SHA-512 hashes from text. | Hash Maker → |
| UUID Generator | Generate random UUID v4 values, one or many at a time. | UUID Maker → |
| Password Generator | Build strong random passwords with length and character options. | Password Maker → |
| Regex Tester | Test a regular expression against sample text and inspect the matches. | Regex Test → |
| JWT Decoder | Decode a JWT header and payload locally, without sending the token anywhere. | Current Page |
Frequently Asked Questions
exp is the expiration time, iat is when the token was issued and nbf is the earliest time it may be used. All three are seconds since 1 January 1970 UTC, not milliseconds.none unless the design explicitly calls for an unsecured token, which is rare and should be limited to non-sensitive contexts.
Rate this Tool
Based on 0 user ratings.