Skip to content

JWT Decoder - Decode JSON Web Tokens Online

What You See After Pasting a Token

A JSON Web Token (RFC 7519) is three Base64URL strings joined by dots: header.payload.signature. The decoder splits the token at its two dots, Base64URL-decodes the header and payload, and shows both as formatted JSON. Above them you get the expiry status, and the exp, iat and nbf timestamps converted from Unix seconds to your local time. The signature is shown as-is, because it is binary data, not JSON.

Example

A typical access token payload decodes to something like:

{
  "iss": "https://auth.example.com/",
  "sub": "user_8812",
  "aud": "api.example.com",
  "scope": "read:orders write:orders",
  "iat": 1735689600,
  "exp": 1735693200
}

iat 1735689600 is 1 January 2025 00:00 UTC and exp is one hour later, so this token was valid for 60 minutes. If an API returns 401 for a token like this, the first things to check are whether exp has passed, whether aud matches the API you are calling, and whether iss is the issuer the API trusts. A 403 more often means the token is valid but the scope or role claims are missing something.

Decoding Is Not Verification

The header and payload are only encoded, so anyone can read them and anyone can write a token with whatever claims they like. The signature is what proves a token came from the issuer and was not changed. To check it here, paste the HMAC secret for HS algorithms or the issuer's PEM public key for RS, PS and ES. Use this for debugging only. Production code should verify every token with a maintained JWT library, pin the algorithms it accepts, and reject alg: none.

Header Fields Worth Knowing

  • alg: the signing algorithm. HS256 uses a shared secret; RS256 and ES256 use a private key to sign and a public key to verify.
  • kid: which of the issuer's keys signed the token. Use it to pick the right entry from a JWKS.
  • typ: usually JWT, sometimes at+jwt for OAuth access tokens.

To compute an HS256 signature by hand, take the HMAC-SHA256 of header.payload with the HMAC generator, then convert the Base64 output to Base64URL (replace + with -, / with _, and drop the = padding). To decode an ordinary Base64 string, use the Base64 decoder, and to convert other Unix timestamps, use the epoch converter.

Related Tools

Frequently Asked Questions

Does this tool verify the JWT signature?
Only if you give it a key. Decoding just reads the Base64URL header and payload, which anyone can do and anyone can forge. Below the decoded token you can paste the shared secret for HS256/384/512 (tick "Secret is Base64 encoded" if your provider gives it that way) or a PEM public key for RS, PS and ES algorithms. The check runs with the browser's Web Crypto API and shows "Signature verified" or "Invalid signature". Your server still has to verify every token and check exp, nbf, iss and aud.
Which key do I need to verify an RS256 or ES256 token?
The issuer's public key in SPKI PEM form, starting with -----BEGIN PUBLIC KEY-----. Identity providers usually publish keys as a JWKS at a URL like /.well-known/jwks.json; pick the key whose kid matches the token header and convert it to PEM. A PKCS#1 key (BEGIN RSA PUBLIC KEY) is rejected; convert it with openssl rsa -RSAPublicKey_in -in key.pem -pubout. Certificates and private keys are rejected too.
How do I check if a JWT has expired?
Paste it. The exp claim is shown as a local date and a badge such as "Expires in 3h 12m" or "Expired 2 days ago". A future nbf shows "Not valid yet", and an iat in the future is flagged, which usually points to clock skew between servers.
Why does my token fail to decode?
A JWT must be three Base64URL parts separated by dots. Common causes are copying the "Bearer " prefix along with the token, a token cut off when copied from a log, or pasting a JWE (encrypted token with five parts), whose payload cannot be read without the decryption key.
Is it safe to paste a JWT here?
The token is decoded in your browser and never sent anywhere. Still treat a live token like a password: anyone who has it can use it until it expires. Prefer expired or test tokens when debugging, and never paste them into public chats or tickets.