JWT Generator
About this tool
About JWT Generator
Build JSON Web Tokens for testing APIs, mocking an identity provider or reproducing an auth bug. Choose any of the thirteen standard JWS algorithms: HS256, HS384 and HS512 with a shared secret, RS and PS with RSA keys, ES256, ES384 and ES512 with elliptic-curve keys, or EdDSA with Ed25519. Edit the payload as JSON, then use the quick buttons to stamp iat with the current time or set exp one hour, one day or seven days ahead. The header gets the right alg automatically, and you can add kid or other fields. For HMAC, generate a random secret of the length RFC 7518 requires; a warning appears if yours is shorter. For the asymmetric algorithms, paste a PKCS#8 private key or JWK, or click Generate test key pair and copy the matching public key for your verifier. The token re-signs as you type, colour-coded by part, using Web Crypto in your browser.
Built and maintained by Abhi JainUpdated
How to Create a Signed JWT
- 1
Choose the algorithm
Pick an Algorithm such as HS256, RS256 or ES256.
- 2
Write the claims
Edit the Payload JSON and use the Set buttons for iat, exp and nbf. Add header fields like kid under Header.
- 3
Add the key
Enter a Shared secret (or click Random secret), or paste a private key or click Generate test key pair.
- 4
Copy the token
Copy the Signed token. For RS, PS, ES and EdDSA, also copy the public key for whoever verifies it.
JWT Generator: questions and answers
Which JWT algorithm should I use?
Use HS256 when the same service issues and verifies tokens and can keep one secret. Use RS256, ES256 or EdDSA when other services verify tokens, because they only need the public key. ES256 and EdDSA give much shorter signatures than RSA.
How long should an HS256 secret be?
RFC 7518 requires a key at least as long as the hash: 32 bytes for HS256, 48 for HS384 and 64 for HS512. Short or guessable secrets can be cracked offline from a single token. Random secret creates one of the right length.
What private key format does it accept?
PKCS#8 PEM (BEGIN PRIVATE KEY) or a private JWK. Older BEGIN RSA PRIVATE KEY or BEGIN EC PRIVATE KEY files can be converted with: openssl pkcs8 -topk8 -nocrypt -in key.pem.
Can I use these tokens in production?
The tokens are standard and valid, but generate production keys with your own infrastructure and keep them in a secrets manager. Use this page for development, tests and debugging.
How do I check the token I made?
Paste it into the JWT Decoder with the secret or public key. It shows the claims and confirms the signature.
Related Tools
- JWT DecoderDecode a JWT, read its claims in human time and verify the signature with a secret or public key.
- Password GeneratorStrong random passwords with a live strength and entropy estimate.
- Timestamp ConverterConvert Unix timestamps to dates and back in any time zone, with a live epoch clock.
- Base64 EncoderEncode and decode Base64 for text and files, with URL-safe, MIME and data URL options.
- UUID GeneratorGenerate UUID v4 or time-ordered v7 in bulk, and validate or decode any UUID.