Skip to content
AgileLogics

JWT Decoder

Splits a JSON Web Token into its three parts and shows the header and payload as formatted JSON, with the issued-at, not-before and expiry claims as readable UTC dates. Decoding happens in your browser and the signature is not verified.

How it works

Paste a JWT (with or without a leading "Bearer ") into the input panel and click Decode.

What is a JWT decoder?

A JWT decoder takes a JSON Web Token, the long three-part string used in login sessions and API calls, and shows what is inside it. This one splits the token at its two dots, base64url-decodes the header and payload, prints both as indented JSON, and turns the time claims into readable dates. It does not verify the signature.

JSON Web Tokens are defined in RFC 7519. The signed form you normally see, header.payload.signature, is the JWS compact serialization from RFC 7515.

How to decode a JWT

  1. Copy the token. It usually starts with eyJ, because that is how {" looks in base64url.
  2. Paste it into the input box. A leading Bearer is fine.
  3. Click Decode.
  4. Read the header, payload, dates and signature in the output panel.

Worked example

This is the sample token used in much JWT documentation:

eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c

The decoder returns:

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

Payload
{
  "sub": "1234567890",
  "name": "John Doe",
  "iat": 1516239022
}

Dates (UTC)
Issued at (iat): 2018-01-18T01:30:22Z

Signature (not verified)
SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c

The header says the token was signed with HMAC-SHA256. The payload identifies user 1234567890, and iat (1516239022 seconds after 1 January 1970) becomes 18 January 2018, 01:30:22 UTC. There is no exp claim, so this token never expires by itself.

The claims you will see most often

RFC 7519 registers seven claim names. All are optional, and applications add their own next to them (name, email, roles, scope and so on).

Claim Meaning Shown as a date
iss Issuer: who created the token No
sub Subject: usually the user ID No
aud Audience: which service the token is meant for No
exp Expiration time, after which the token must be rejected Yes, with expired / not expired yet
nbf Not before: the token is invalid until this time Yes, with "not valid yet" when in the future
iat Issued at Yes
jti A unique ID for this token, used to prevent replay No

The three time claims are numbers of seconds since the Unix epoch. If a token stores one as a string, or in milliseconds, the JSON still shows the raw value; a string is left out of the Dates section and a millisecond value appears as a date far in the future.

In the header, alg names the signing algorithm (HS256, RS256, ES256, ...) and kid tells the server which key to use.

Error messages and what they mean

Message Cause
A JWT has three parts separated by dots Part of the token was cut off when copying, or the text isn't a JWT
This token has five parts It's an encrypted JWE, not a signed JWT
The header (or payload) is not valid base64url A character outside A-Z a-z 0-9 - _ is present, such as = padding, + or /, or the segment was truncated
The header (or payload) decodes, but it is not valid JSON The segment is Base64 of something else
The header (or payload) must be a JSON object It decoded to a string, number or array

JWTs use the URL-safe alphabet without = padding, so a string that was re-encoded with ordinary Base64 is rejected here.

Decoding is not verifying

Anyone can write a payload saying "admin": true, base64url-encode it and attach a made-up signature. This page will decode it happily, which is the reason a decoded token proves nothing about who issued it. A server must check the signature with the right key, pin the algorithm it expects, and then check exp, iss and aud. The IETF's JWT Best Current Practices (RFC 8725) lists the common mistakes, including accepting "alg": "none". If you paste an unsigned token, the output says so in place of the signature.

Related tools

Last updated

Frequently asked questions

Is it safe to paste a token here?
The token is decoded by JavaScript in your browser and is not sent to this site or anywhere else. A live token is still a credential, though, so treat it like a password: prefer test or expired tokens, and revoke any token you have shared in a chat, ticket or screenshot.
Does the decoder verify the signature?
No. It shows the signature segment and labels it "not verified". Checking a signature needs the shared secret (HS256) or the issuer's public key (RS256, ES256), and that check has to happen in the server that accepts the token.
Can anyone read the contents of a JWT?
Yes, for the usual signed kind. The header and payload are only base64url-encoded, which is an encoding and not encryption. Anyone holding the token can read every claim, so never put passwords or other secrets in a payload.
How do I know if my token has expired?
If the payload has a numeric exp claim, the Dates section shows it as a UTC date followed by "(expired)" or "(not expired yet)". The comparison uses your device's clock, so a wrong system time gives a wrong answer.
Why do I get an error about five parts?
A token with five dot-separated parts is an encrypted JWT (JWE). Its payload is ciphertext and can only be read with the decryption key, so this tool can't show it.
Can I paste the whole Authorization header value?
Yes. A leading "Bearer " is removed, and so are spaces and line breaks inside the token, which helps when a token was wrapped in a log file or an email.