Skip to content

JWT signature verifier

Free, no sign-up Runs in your browser

Verify a JWT signature in your browser with a secret, a PEM public key or a JWK. Supports HS, RS, PS and ES at 256, 384 and 512, and checks exp and nbf.

The token and the key stay in your browser. Nothing is sent anywhere.

A PEM public key, a PEM certificate, a JWK or a JWK Set. Never the private key.

Everything you type here stays in your browser. Nothing is sent to HardenKit or to anyone else.

How to use the JWT signature verifier

  1. Paste the token. The tool reads the algorithm from its header.
  2. For HS tokens, enter the secret and say whether it is text or Base64. For the others, paste the public key, certificate or JWK.
  3. Press Verify signature.
  4. Read the verdict and the time claims. Both must be good before a token is accepted.

About this tool

The signature is the only part of a JSON Web Token that makes it trustworthy. It is computed over the encoded header and payload, so changing one character of either makes it wrong. HS256, HS384 and HS512 use one shared secret with HMAC. RS and PS algorithms use an RSA key pair, and ES algorithms use an elliptic curve key pair: the issuer signs with the private key and everyone else verifies with the public one.

This tool does the check with the Web Crypto API built into your browser. Paste the token, then the shared secret, or a public key as PEM, a certificate, a JWK or a JWK Set. The key never leaves the page. You get a plain verdict, valid or invalid, plus a reading of the time claims, because a correctly signed token that has expired must still be rejected.

When a signature fails, the usual causes are a secret that is Base64 while the tool was told it is text, a key from the wrong environment, or a token that was edited. The dangerous mistake is the opposite: a verifier that takes the algorithm from the token. Then an attacker can sign an HS256 token using your public key as the secret. Fix the algorithm in your code.

Sources

Questions

How do I verify a JWT signature?

Take the first two parts of the token exactly as they are, joined by a dot, and check the third part against them with the key and the algorithm you expect. For HS256 that is an HMAC with SHA-256 and the shared secret; for RS256 or ES256 it is a public key check. This tool does it in your browser.

Which key do I need to verify an RS256 token?

The public key of the issuer. Issuers usually publish it as a JWK Set at a jwks_uri listed in their OpenID configuration, and the token’s kid header says which key in the set to use. You never need, and should never be given, the private key.

Why is my JWT signature invalid?

Most often the secret is being read in the wrong form: many systems store an HMAC secret as Base64 and use the decoded bytes as the key. Other causes are a key from another environment, a token that was copied with a character missing, or a payload edited after signing.

What is a JWT algorithm confusion attack?

A server expects RS256 and holds an RSA public key, but its code lets the token choose the algorithm. The attacker sends an HS256 token signed with that public key as the HMAC secret, and the server verifies it with the same bytes. The fix is to allow only the algorithm you issue.

Does a valid signature mean the token should be accepted?

No. It means the token is authentic. A service must also check that it has not expired, that nbf has passed, and that the issuer and the audience are the ones it expects.

Related tools