# JWT Decoder

> Paste a JWT to read its header and claims, see when it expires, get warnings and check the signature, all on your device.

- Page: https://codethatmoves.com/tools/dev/jwt-decoder/
- Site: Code That Moves
- Category: Developer tools
- Free, runs in the browser, nothing is uploaded
- Last checked: 2026-11-03

## What it does

- Decodes the header and the payload of a JWT as readable JSON
- Writes exp, nbf and iat as dates in UTC and your local time, and shows whether the token has expired
- Warns about alg none, a missing expiry, long-lived tokens and keys carried in the header
- Checks the signature for HS, RS, PS, ES and EdDSA (Ed25519) with the Web Crypto API
- Reads public keys as PEM (SPKI or PKCS#1), an X.509 certificate, a JWK or a whole JWKS, where it picks the key by kid
- Takes HS secrets as text or Base64, and warns when a secret is shorter than RFC 7518 requires
- Builds and signs HS256, HS384 and HS512 test tokens from your own header and payload
- The token never leaves your device, so a real one is safe to paste

## How to use it

1. Paste the token. A leading Bearer and quotes around it are ignored.
2. Read the header, the payload and the claims. The summary at the top says whether it has expired.
3. To check the signature, enter the secret for an HS token (tick Secret is Base64 if it was issued that way), or paste the public key, certificate or JWKS for RS, PS, ES and EdDSA.
4. To make a test token, edit the header and payload under Make a token and enter a secret.

## What it checks and why

A JSON Web Token has three parts joined by dots: a header, a payload and a signature. The first two are JSON written in Base64URL, which is an encoding and not encryption, so anyone holding the token can read them. This tool decodes them and lays out the claims, with the time claims written as dates and compared with the clock.

Reading a token does not tell you it is genuine. The signature does, and checking it needs the key. For HS256 and its relatives the key is a shared secret. For RS, PS, ES and EdDSA it is the public key: a PEM block (BEGIN PUBLIC KEY or BEGIN RSA PUBLIC KEY), a certificate (BEGIN CERTIFICATE, as Google and Firebase publish them), a JWK, or the whole JWKS from an issuer's jwks_uri, in which case the key whose kid matches the token is used. The check runs in your browser with the Web Crypto API, and a valid result means the token was made with that key and has not been changed.

The warnings come from the current best practice for JWTs in RFC 8725. A token with the algorithm none is not signed at all. A token without exp never expires. A header that carries its own key, through jwk, jku or x5u, must not be trusted, because anyone could put their own key there. Because everything runs on your device, you can paste a real production token without sending it to anyone.

## Reference data

| Claim | Name | Meaning |
| --- | --- | --- |
| iss | Issuer | Who made the token |
| sub | Subject | Who the token is about |
| aud | Audience | Who the token is for |
| exp | Expires | Time after which the token is not valid (seconds since 1970) |
| nbf | Not before | Time before which the token is not valid |
| iat | Issued at | When the token was made |
| jti | Token ID | A unique id for the token |

## Specs and sources

- [RFC 7519: JSON Web Token (JWT)](https://datatracker.ietf.org/doc/html/rfc7519)
- [RFC 7515: JSON Web Signature (JWS)](https://datatracker.ietf.org/doc/html/rfc7515)
- [RFC 8725: JSON Web Token best current practices](https://datatracker.ietf.org/doc/html/rfc8725)
- [MDN: SubtleCrypto.verify()](https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/verify)

## Limits

- Encrypted tokens (JWE, five parts) cannot be read without the key and are not decoded.
- A valid signature does not make the claims right. A server must still check the issuer, the audience and the time.
- Private keys are not accepted for checking. The JWKS is pasted, not fetched: the tool makes no network requests.
- EdDSA is checked for Ed25519 only, and needs a browser with Ed25519 in Web Crypto. Ed448 and other algorithms are decoded but not verified.
- The encoder signs with HS256, HS384 and HS512 only. Use it for tests and local work, not for production secrets.

## Questions

### Is it safe to paste a real JWT here?

Yes. The token is decoded and checked in your browser and is never sent anywhere. Still, treat a live token like a password, and prefer a short-lived or test token when you can.

### Can anyone read the content of a JWT?

Yes. The header and the payload are only Base64URL encoded, not encrypted. Never put a secret or private data in them. If the content must stay hidden, use an encrypted JWT or keep the data on the server.

### What does a valid signature mean?

It means the token was made by someone with the key and has not been changed since. It does not mean the token is still in date, that it is meant for your service or that the user is allowed to do anything.

### Why does my HS256 token say the signature is invalid with the right secret?

Often the secret was issued in Base64 (some identity providers do this), so the bytes that signed the token are the decoded secret, not the text. Tick Secret is Base64. Also check for a space or line break copied with the secret.

### How do I verify a JWT with a JWKS?

Open the issuer's jwks_uri (for example from /.well-known/openid-configuration), copy the JSON and paste it as the key. The tool picks the key whose kid matches the token header and says which one it used.

### What is the alg none attack?

Some libraries once accepted a token whose header said alg none and carried no signature, so an attacker could make any token. A server must reject it and decide the algorithm itself, not take it from the token.
