Công Cụ Nhanh

JWT decoder online

The token is decoded in your browser and never sent anywhere. Even so, never paste a live session token from a production system into any website: whoever holds the token can use that session.

Processed in your browser. Your files and data are never uploaded to a server.

Quick answer

A JWT (JSON Web Token) has three Base64URL parts separated by dots: the header (algorithm), the payload (data such as the user ID and the exp expiry) and the signature. The header and payload are only encoded, NOT encrypted, so anyone holding the token can read them; the signature is what proves the token has not been tampered with.

What is a JWT?

Paste a token to see its header and payload as readable JSON, a table explaining each standard claim (iss, sub, aud, exp, iat…), the issue and expiry times, and whether the token is still valid. Signature verification uses your browser's WebCrypto for HS256/384/512 (enter the secret) and RS, PS and ES algorithms (enter a PEM or JWK public key). The token is never sent to any server.

Illustration of an envelope with a wax seal opening to show three stacked coloured slips, next to a brass key and a magnifier

How to decode and verify a JWT

  1. 1

    Paste the token into the JWT box. A whole “Bearer eyJ…” line from an Authorization header is fine; the Bearer prefix and whitespace are stripped.

  2. 2

    Read the header (alg, typ, kid) and the payload. The Claims table explains each field and converts iat, nbf and exp to readable dates.

  3. 3

    The expiry status line tells you how long until the token expires, whether it already has, or whether it is not valid yet.

  4. 4

    To be sure the token is untouched, enter the secret (for HS256…) or the public key (for RS256, ES256…) under Verify signature.

Registered claims (RFC 7519)

ClaimFull nameMeaning
issIssuerWho issued the token, e.g. https://accounts.google.com
subSubjectWho the token is about, usually the user ID
audAudienceWhich app or API may accept the token
expExpiration timeExpiry (Unix seconds); reject the token after this
nbfNot beforeDo not accept the token before this time
iatIssued atWhen the token was issued
jtiJWT IDA unique ID for the token, used to prevent replay

JWT times are SECONDS since 1 Jan 1970 UTC, not milliseconds like JavaScript's Date.now().

Common signing algorithms

algKey typeWho can verifyNotes
HS256 / HS384 / HS512One shared secretOnly whoever holds the secretSimple; fits one system that both issues and checks tokens
RS256 / RS384 / RS512RSA key pairAnyone with the public keyThe most common choice in OAuth and OpenID Connect
PS256 / PS384 / PS512RSA key pair (RSA-PSS)Anyone with the public keyA theoretically stronger RSA variant
ES256 / ES384 / ES512Elliptic-curve key pairAnyone with the public keyShort, fast signatures; used by Apple and Google
noneNoneNobodyAn unsigned token; servers must reject it

Swipe sideways to see the whole table →

Real-world examples

An API call returns 401

Paste the token you are sending: if the status says “Expired 2 hours ago”, the app needs to refresh the token rather than change how it calls the API.

Check a user's permissions

Many systems put roles in the payload, such as "role": "admin" or "scope": "read write". Decode it to confirm the token carries the right permissions before debugging elsewhere.

Verify a Google, Auth0 or Keycloak token

OpenID Connect providers sign with RS256 and publish their public keys as JWKs at the jwks_uri. Take the key whose kid matches the header and paste it into the public key box.

Experiment while coding

Click “Use a sample token” (the jwt.io example, secret “your-256-bit-secret”) to see a valid token, then change one character of the payload to watch the signature fail.

Common problems and fixes

Putting passwords or card numbers in the payload because the token looks encrypted.
The payload is just Base64URL; anyone can decode it, as you can see here. Keep secrets out of JWTs, or use JWE when the content must be confidential.
“A JWT must have exactly 3 parts”.
The token was cut off when copying or has extra characters. Copy the whole line again; a 5-part token is an encrypted JWE.
The signature fails even with the right secret.
Many libraries store the secret Base64-encoded: tick “Secret is Base64 encoded”. A trailing space in the secret also breaks it.
The public key format is rejected.
Use a PEM starting with -----BEGIN PUBLIC KEY----- or a JWK in JSON. Certificates and PKCS#1 keys (BEGIN RSA PUBLIC KEY) must be converted to SPKI with openssl first.
A freshly issued token is already expired.
exp is in seconds. exp = Date.now() + 3600 (milliseconds) is wrong; use Math.floor(Date.now() / 1000) + 3600. A server clock that is off causes the same symptom.
The server accepts alg “none”.
That is a serious vulnerability: attackers can mint unsigned tokens. Configure your library to accept only the algorithm you actually use.

Decoding is not verifying

Decoding simply turns Base64URL back into JSON; it needs no key and proves nothing. Verifying recomputes the signature over the header and payload with the key and compares it with the third part: if they match, the token really was signed by the key holder and not a single character has changed.

Servers must always verify the signature and expiry before trusting anything in a token. Front-end code may decode a token to show the user's name, but must never grant access based on it.

A word on pasting tokens

Everything on this page runs in your browser with WebCrypto; tokens, secrets and keys are not sent anywhere. Still, prefer test tokens, expired tokens or development tokens. A live session token works like a key: whoever gets it can use that session.

Glossary

JWT
JSON Web Token: signed JSON data used for sign-in and API authorisation.
JWS / JWE
A JWS is signed (the content is readable); a JWE is encrypted (unreadable without the key).
Claim
A name–value pair in the payload, such as sub, exp or role.
Base64URL
A Base64 variant using - and _ instead of + and /, without trailing =, safe inside URLs.
JWK / JWKS
A key written as JSON; a JWKS is the list of public keys a provider publishes for verifying tokens.
kid
Key ID in the header, telling you which JWKS key signed the token.

Frequently asked questions

Do I need the secret to decode a JWT?

No. Anyone can read the header and payload. The secret or public key is only needed to verify the signature.

Is my token sent anywhere?

No. Decoding and verification run in your browser; no network request contains the token.

Why does the signature fail?

The token was modified, the secret or key is wrong, the secret needs Base64 mode, or the public key does not match the kid in the header.

Can it decode a 5-part JWE?

No. A JWE is genuinely encrypted and needs the issuer's decryption key.

Which time zone are the dates in?

The raw values are Unix seconds in UTC. The tool shows Vietnam time (UTC+7) alongside the ISO form in UTC so you can compare.

Should I use HS256 or RS256?

HS256 when one system both issues and checks tokens. RS256 or ES256 when several services must verify tokens without holding the signing key, since they only need the public key.

Ratings and comments

Loading…