Decoding is not verifying
The header and payload of a JWT are only Base64URL-encoded, so anyone can read them; the JWT Decoder does exactly that. Verifying answers a different question: was this token really signed by the issuer you trust, and has nobody changed a single character since? Only the signature can answer that, and only with the right key. A server that reads the claims without checking the signature will accept any token a user writes by hand.
The checks, in the order a server should run them
- Reject a header with alg set to none, and any algorithm you did not pin.
- Pick the key: the shared secret for HS256, HS384 or HS512, or the public key whose kid matches the header for RS, PS, ES and EdDSA tokens.
- Check the signature over the exact header.payload text.
- Check the time claims: exp in the future, nbf and iat not in the future, allowing a little clock leeway.
- Check iss is your identity provider and aud names your API.
This verifier runs the same steps and shows which one failed, so a red result tells you whether to look at the key, the clock or the claims.
Which key to paste
HMAC tokens (HS256 and friends) use one shared secret to sign and to verify. Paste it as text, or tick “Secret is Base64-encoded” if your provider shows it in Base64, a common cause of “invalid signature”. RSA, ECDSA and EdDSA tokens are signed with a private key and checked with the matching public key, so you never need, and should never paste, a private key to verify. A PEM public key, an X.509 certificate, a single JWK or a whole JWKS all work.
Finding the JWKS for Auth0, Okta and Cognito
Identity providers publish their public keys as a JWKS, a JSON list of keys, each with a kid. Open the URL, copy the JSON and paste it in as the key:
Auth0: https://YOUR_DOMAIN/.well-known/jwks.json
Okta: https://YOUR_DOMAIN/oauth2/default/v1/keys
Cognito: https://cognito-idp.REGION.amazonaws.com/USER_POOL_ID/.well-known/jwks.json
Most providers also list the JWKS address as jwks_uri in their OpenID configuration at /.well-known/openid-configuration. Keys rotate, so if a token suddenly fails with a kid that is not in your copy, fetch the JWKS again.
Verifying a JWT in Node.js
In your own code, use a maintained library and pass the same rules you set here. With the jose package:
import { createRemoteJWKSet, jwtVerify } from 'jose';
const jwks = createRemoteJWKSet(new URL('https://YOUR_DOMAIN/.well-known/jwks.json'));
const { payload } = await jwtVerify(token, jwks, {
issuer: 'https://YOUR_DOMAIN/',
audience: 'https://api.example.com',
algorithms: ['RS256'],
clockTolerance: 30,
});
jwtVerify throws if any check fails, so treat an error as “not signed in”. Use this page to work out why a real token is rejected, then fix the rule or the key in code.