Skip to content
thecalculatorstudio

JWT Decoder: Read a JSON Web Token in Your Browser

Paste a JSON Web Token. You get the decoded header and payload, each claim explained, the exp, nbf and iat dates in UTC and whether the token is inside its time window now.

Last reviewed

Everything happens in your browser. The token is not sent, stored or added to the page address.

Algorithm
HS256
Signature
32 bytes, not verified

Header

{
  "typ": "JWT",
  "alg": "HS256"
}

Payload

{
  "iss": "joe",
  "exp": 1300819380,
  "http://example.com/is_root": true
}
Claims
ClaimMeaningValue
issIssuerjoe
expExpiration time13008193802011-03-22T18:43:00.000Z UTC
http://example.com/is_rootCustom or other claimtrue

Decoding is not verifying. Anyone can read a token. Only its signature, checked with the right key on a server you control, shows that it is genuine, and this page does not check it.

What a JWT is

A JSON Web Token (JWT) is a compact string used to pass claims between systems, most often to show that someone has logged in. A signed token has three parts joined by dots: a header, a payload and a signature. Each is written in base64url, which is base64 with - for +, _ for / and no = padding.

The header and the payload are JSON. The header says how the token is signed (alg) and what it is (typ). The payload is the claims set, a JSON object of statements such as who issued the token and when it expires. The signature is a short block of bytes that lets a server holding the right key check that neither part was changed.

Paste a token and this page splits it, decodes the header and payload, lists every claim with its meaning, converts the date claims into readable UTC dates, and tells you whether the token is inside its time window right now. All of it happens in your browser.

Decoding is not verifying

Anyone who has a JWT can read it. Base64url is an encoding, not encryption, so the contents of a signed token are not secret. What a signature gives you is a way to detect tampering, and only a server with the right key can check it. This page does not verify signatures. A token that decodes cleanly may be forged, expired, or issued for another service.

Never trust the claims in a token until your own server has checked its signature and its time window. If the header says the algorithm is none, the token is unsigned and cannot be trusted at all.

Tokens are credentials: treat a real one like a password. This page keeps the token in memory only. It is never sent anywhere and never added to the page address or the shared link. Even so, avoid pasting live tokens from production into any tool you do not control.

The registered claims

RFC 7519 names seven registered claims. None is required.

Claim Meaning
iss Issuer, who created the token
sub Subject, who the token is about
aud Audience, who the token is meant for
exp Expiration time: the token must not be accepted on or after it
nbf Not before: the token must not be accepted before it
iat Issued at: when the token was created
jti JWT ID, a unique identifier for the token

The three time claims, exp, nbf and iat, are a NumericDate: the number of seconds since 1970-01-01T00:00:00Z UTC. The RFC says the current time must be before exp and at or after nbf. The page shows those dates in UTC.

Worked example

RFC 7519 gives this token as its example:

eyJ0eXAiOiJKV1QiLA0KICJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJqb2UiLA0KICJleHAiOjEzMDA4MTkzODAsDQogImh0dHA6Ly9leGFtcGxlLmNvbS9pc19yb290Ijp0cnVlfQ.dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk

  • The header decodes to {"typ":"JWT", "alg":"HS256"}: a JWT signed with HMAC SHA-256.
  • The payload decodes to {"iss":"joe", "exp":1300819380, "http://example.com/is_root":true}: an issuer of joe, an expiry and a custom claim.
  • The expiry 1300819380 is 22 March 2011 at 18:43:00 UTC, so on any date after that the example token has expired.
  • The signature is 43 characters of base64url, which is 32 bytes, the length of a SHA-256 result.

Base64url turns every 4 characters into 3 bytes, so a part whose length leaves a remainder of 1 when divided by 4 can never be valid, which is one of the errors this page reports.

What the errors mean

  • Not three parts. A signed token has exactly two dots. Five parts means an encrypted token (a JWE), which cannot be read without its key.
  • Not base64url. Letters, digits, - and _ only. A token copied with spaces or line breaks needs them removed.
  • Not JSON. The header and payload must decode to JSON objects.
  • “Bearer” in front. The word Bearer from an Authorization header is removed for you.

Common mistakes

  • Assuming a decoded token is trustworthy. Verify the signature on a server.
  • Putting secrets in a payload. Anyone who has the token can read it.
  • Comparing exp to a time in milliseconds. Claims are in seconds, not milliseconds.
  • Ignoring the audience. A valid token for one service is not valid for another.
  • Forgetting clock drift. Servers may allow a little leeway when they check exp and nbf.

For other developer tools, see the UUID generator, the hash generator and the password generator. To read a time in seconds, the time converter helps.

How it works

The token is split at the dots. Each of the first two parts is turned from base64url into bytes, read as UTF-8 text and parsed as JSON. The signature is only measured, never checked. The date claims are multiplied by 1,000 and shown as UTC dates, and the validity window is checked against your computer’s clock, which is read after the page loads.

Frequently asked questions

How do I decode a JWT?

Split it at the dots. The first part is the header and the second the payload, each base64url-encoded JSON. Decode both from base64url and read the text as JSON. This page does it when you paste the token.

Is my token sent anywhere?

No. Decoding runs in your browser. The token is held in memory only and is never sent, saved or added to the page address. Even so, avoid pasting live production tokens into tools you do not control.

Does this verify the signature?

No. Decoding is not verifying. Anyone can read a token, and only a check of the signature with the right key shows it is genuine. Always verify on your own server before trusting any claim.

How do I read the exp claim?

It is a NumericDate: the number of seconds since 1970-01-01T00:00:00Z UTC. The RFC example exp of 1300819380 is 22 March 2011 at 18:43:00 UTC. The token must not be accepted on or after that time.

What if my token has five parts?

It is an encrypted token (a JWE), not a signed one, and its contents cannot be read without the decryption key. A signed token has three parts separated by two dots.

Why does my token fail to decode?

Common causes are spaces or line breaks added when copying, the word Bearer left in (this page removes it), a part with characters outside the base64url set, or a header or payload that is not a JSON object.

Related calculators

Sources