فارسی

Sign and Verify JSON Web Tokens

Sign a JWT with HS256 or RS256, then verify a received token with the matching key. Keys stay in your browser.

Use this tool in your browser without installing software.

About this tool

A JWT has three parts: a header, a JSON payload, and a signature. This tool signs that signature with a shared key (HS256, HS384, HS512) or an RSA private key (RS256, RS384, RS512), and it can check a token you received with the matching key. With RSA you can generate a fresh key pair right here; the private key stays in the signing box while the public key goes to the other side for verification. Verification covers the signature and the expiration time (exp); the receiving service still has to check iss, aud, and permissions. The payload is not encrypted, so anyone holding the token can read it; confidentiality needs encryption.

How to use it

  1. 1

    Write the token payload as JSON, using the fields the receiving service expects.

  2. 2

    Choose the algorithm and key; for RSA you can generate a fresh key pair right here.

  3. 3

    Create the token, then paste a received token and the matching key into the Verify tab.

If the answer looks wrong

  • My signature does not match the server sample.

    The key, algorithm, and payload bytes must all match. Key order and whitespace also change the signature, so send the same JSON the other side signed.

  • The private key is not accepted.

    Check the header: PKCS#8 must say BEGIN PRIVATE KEY. A BEGIN RSA PRIVATE KEY file needs converting to PKCS#8 with openssl first.

  • Where do I get the public key?

    In RSA mode the Generate a key button creates both the private and the public key. If the key came from elsewhere, paste its SPKI public form.

  • The token is expired but the signature is valid.

    That is expected: the signature is intact while exp has passed. Create a new token or move exp forward in your own payload.

Frequently asked questions

What is the difference between HS and RS?

With HS, the sender and receiver share one key that both signs and verifies. With RS, the private key stays with you and the other side verifies with the public key, which suits services that hand the key to several parties.

Which RSA key formats are accepted?

The private key must be PKCS#8 with a BEGIN PRIVATE KEY header, and the public key must be SPKI with a BEGIN PUBLIC KEY header. Older BEGIN RSA PRIVATE KEY files are rejected until converted.

Why is a token rejected when its signature is valid?

The receiving service may also check exp, iss, aud, or permissions. This tool only looks at the signature and exp and makes no claim about the rest.

Are the token or key sent anywhere?

No. Signing and verification run in your browser, and no request carries the payload or the key.

Can a token with alg=none be verified?

No. A token without a signature is refused, because anyone could change its payload and claim it is valid. This tool rejects it on purpose.

Why is no expiration shown?

When the token has no exp field, the tool says so. The receiving service may accept or reject such a token depending on its own policy.