Skip to content
DeviceCheckHub

JWT Decoder

Paste a JSON Web Token to see its header and claims, with every date in your own time and how long until it expires. Check its signature with the secret, a public key, a certificate or the issuer’s key set, or sign a new token. Everything runs in your browser.

Paste a JWT to decode it. It is read in your browser and never uploaded.

The token, part by part

Header

Payload

What a server would say

    Claims explained

    Each header parameter and payload claim, its value and what it means
    ClaimValueMeaning
    Claims appear here once a token is decoded.

    Check the signature

    No token yet

    Decode a token, then add its secret or public key here.
    Choose an algorithm, paste a key or press Generate, then press Sign. Nothing leaves your browser.

    How to decode and check a JWT

    1. Paste the token into Your JWT. A whole Authorization: Bearer … header, quotes and line breaks are fine: they are removed. Press Try an example to see a fresh token signed a moment ago.
    2. The token is decoded as you type. The coloured view shows its three parts, the header and payload appear as formatted JSON, and Claims explained lists every claim with its meaning. Dates such as exp and iat are shown in your own time zone, with how long ago or how soon they are.
    3. What a server would say lists the problems a careful server would find: an expired token, one that is not valid yet, a missing expiry, alg set to none, or times written in milliseconds.
    4. To check the signature, paste the shared secret (for HS256, HS384 and HS512) or the issuer’s public key under Check the signature. The result says whether the signature is valid, and why not when it fails.

    To make a token, switch to Create and sign, choose an algorithm, edit the claims, paste a secret or private key or press Generate for a new one, and press Sign. Decode it opens the new token in the decoder with its key, so you can see the round trip work.

    What is in a JWT

    A JSON Web Token (RFC 7519) is three pieces of base64url text joined by dots: header.payload.signature. The header is a small JSON object that names the signing algorithm (alg) and often the key that signed it (kid). The payload is a JSON object of claims: facts about the user and the token, such as who issued it and when it expires. The signature is computed over the first two parts with the issuer’s secret or private key.

    Base64url is a way of writing bytes with letters, digits, - and _, so a token can travel in a web address or a header. It is not encryption: anybody who has a token can read its payload, exactly the way this page does. What the signature adds is integrity: change one character of the header or payload and the signature no longer matches.

    The registered claims

    ClaimNameWhat it is for
    issIssuerWho created and signed the token, often the sign-in server’s address.
    subSubjectThe user or thing the token is about, usually a user ID.
    audAudienceThe app or API the token is for; a receiver rejects a token addressed to someone else.
    expExpiration timeThe moment the token stops being valid.
    nbfNot beforeThe moment the token starts being valid.
    iatIssued atWhen the token was made.
    jtiJWT IDA unique ID, so a server can refuse the same token twice.

    Times are NumericDate values: whole seconds since 1 January 1970 UTC, the same count Unix systems use. A value thirteen digits long is a sign that someone wrote milliseconds by mistake, which pushes the date tens of thousands of years into the future. You can convert any such number by hand with the Unix timestamp converter. OpenID Connect ID tokens add profile claims such as name, email and nonce, and OAuth access tokens often carry scope, client_id and roles; the tool explains those too.

    Algorithms and the keys they need

    algMethodKey to check it
    HS256, HS384, HS512HMAC with SHA-2The same shared secret that signed it
    RS256, RS384, RS512RSA, PKCS#1 v1.5The issuer’s RSA public key
    PS256, PS384, PS512RSA-PSSThe issuer’s RSA public key
    ES256, ES384, ES512ECDSA on P-256, P-384, P-521The issuer’s elliptic-curve public key
    EdDSA, Ed25519Ed25519The issuer’s Ed25519 public key

    With HMAC, the same secret signs and checks, so every service that checks tokens could also make them. With the public-key algorithms only the issuer holds the private key, and anyone can check tokens with the public key. Big sign-in services publish their public keys as a JWKS (JSON Web Key Set), usually at an address listed under jwks_uri in their /.well-known/openid-configuration document. Paste the whole set here and the key whose kid matches the token is used.

    Verifying tokens safely in your own code

    These rules come from the JWT best current practice, RFC 8725, which collects the mistakes behind real attacks on JWT libraries.

    Common problems

    Other building blocks of tokens have their own tools here: the Base64 encoder and decoder for single parts, the JSON formatter for big payloads, and the hash generator for SHA-256 and other digests.

    Privacy

    The page is a set of static files. Once it has loaded, decoding, checking, signing and key generation all happen in your browser with its built-in Web Crypto, and nothing you paste is sent anywhere or kept after you close the tab. Only your choices, such as the algorithm, are remembered on this device. The example token is made on your device too, signed with a made-up secret that is shown in the key box.

    Frequently asked questions

    Is my token uploaded anywhere?

    No. Decoding, the signature check, signing and key generation all run in your browser with its built-in Web Crypto, and the page sends nothing anywhere. Tokens, secrets and keys are not saved either: close the tab and they are gone. Even so, treat a live token like a password: it can be used until it expires.

    Is decoding a JWT the same as verifying it?

    No. Anyone can decode a JWT, because the header and payload are only base64url-encoded, not encrypted. Verifying recomputes the signature with the secret or the issuer’s public key and proves the token was made by the issuer and not changed since. A server must also check the time claims, the issuer and the audience before it trusts a token.

    Why does it say “Invalid signature”?

    Usually one of these: the wrong secret or key; a secret that is stored base64-encoded but entered as plain text (or the other way round); a key set where the token’s kid points at a newer key after the issuer rotated its keys; a token that was edited after signing, even by one character; or an ES256/384/512 signature written in the DER format instead of the raw r and s values JWS requires.

    Which keys can I use to check a signature?

    For HS256, HS384 and HS512, the shared secret as plain text, base64url or base64. For RS, PS, ES and EdDSA tokens, a public key in PEM (BEGIN PUBLIC KEY or BEGIN RSA PUBLIC KEY), an X.509 certificate (BEGIN CERTIFICATE), a JWK, or a whole JWKS key set, from which the key whose kid matches the token is picked. A private key works too: the tool uses its public half.

    Why is my secret called too short?

    RFC 7518, which defines the JWT algorithms, says an HMAC key must be at least as long as the hash: 32 bytes for HS256, 48 for HS384 and 64 for HS512. A shorter secret still produces a signature, and this tool still checks it, but short secrets can be guessed by brute force, and some libraries refuse them.

    Can it read an encrypted token (JWE)?

    It recognises one by its five parts and shows its header, which says how it was encrypted. The content stays unreadable without the recipient’s private key, and this tool does not decrypt tokens. Most tokens you meet, such as OAuth access tokens and OpenID Connect ID tokens, are signed JWTs (JWS), which it reads completely.

    Are JWTs encrypted? Can I put secrets in one?

    A normal signed JWT is not encrypted: everything in its payload can be read by anyone who has the token, which is exactly what this page does. The signature only stops changes. Never put passwords, card numbers or other secrets in a JWT payload; use an encrypted JWE, or keep the data on the server and put only an ID in the token.

    Last updated · About DeviceCheckHub