About this tool
Write a JSON payload, pick an algorithm and get a signed token you can use against a local API or in tests. HMAC algorithms use a shared secret, and the RSA, RSA-PSS, ECDSA and EdDSA algorithms use a PKCS#8 private key that you paste or generate on the spot, with the matching public key shown for verification. Keys never leave this tab, which makes it suitable for development secrets.
How to use JWT Generator
- Choose a signing algorithm.
- Edit the payload JSON, using the buttons to set iat or exp.
- Enter a secret, or paste or generate a private key.
- Copy the signed token, and the public key if you need to verify it elsewhere.
Frequently asked questions
Which algorithm should I use?
HS256 is simplest when the same service signs and verifies. Use RS256, ES256 or EdDSA when other services must verify tokens without being able to create them.
How long should an HMAC secret be?
At least as long as the hash output: 32 bytes for HS256, 48 for HS384 and 64 for HS512. The Random secret button creates one of the right length.
Should I sign production tokens here?
It works offline, but production signing keys belong in your server or key management system. Use this for development, tests and debugging.