JWT Generator (HS256/384/512)
Software · 3 inputs · Free
JWT Generator (HS256/384/512)
Parameters
What is this tool?
JWT Generator (HS256/384/512) helps developers with encoding, encryption and text processing. Signs a JSON payload with your secret and builds a JWT (RFC 7519) using HS256, HS384 or HS512. The token is created in your browser and the secret is never sent anywhere; even so, it is safest not to paste production secrets into online tools.
📘 Common mistakes · Worked exampleSigns a JSON payload with your secret and builds a JWT (RFC 7519) using HS256, HS384 or HS512. The token is created in your browser and the secret is never sent anywhere; even so, it is safest not to paste production secrets into online tools.
The result is not exact or binding and is for information only; it is not an official document and cannot be used in official procedures. Confirm it with the competent authority or a professional before acting; no liability is accepted for losses arising from its use.
Last reviewed: · Methodology and sources
How is it calculated?
Signs a JSON payload with your secret and builds a JWT (RFC 7519) using HS256, HS384 or HS512. The token is created in your browser and the secret is never sent anywhere; even so, it is safest not to paste production secrets into online tools.
Inputs
| Value | Unit | Example |
|---|---|---|
| Payload (JSON) | — | {"sub":"1234567890","name":"John Doe","iat":1516239022} |
| Secret | — | your-256-bit-secret |
| Algorithm | — | HS256 (HMAC-SHA-256) |
What is this tool?
JWT Generator (HS256/384/512) helps developers with encoding, encryption and text processing. Signs a JSON payload with your secret and builds a JWT (RFC 7519) using HS256, HS384 or HS512. The token is created in your browser and the secret is never sent anywhere; even so, it is safest not to paste production secrets into online tools.
Common mistakes
- Putting secrets in the payload. The payload is encoded, not encrypted, and anyone can read it.
- Using a short or guessable secret. An attacker with a single token can brute-force the key offline; RFC 8725 says human-memorable passwords must not be used directly as HMAC keys.
- Writing exp and iat in milliseconds. JWT time claims count seconds since 1970; in JavaScript, divide Date.now() by 1000 and round down.
- Leaving out exp. A token without an expiry stays valid after a leak until the key is rotated; give access tokens a short lifetime.
- Trusting the alg header on the server. The verifier must pin the algorithms it accepts, otherwise alg: none or algorithm-confusion attacks become possible.
- Expecting a Base64 secret to be decoded. Some libraries Base64-decode the secret before use; this tool takes the text literally, so signatures may not match such a library.
- Writing large numeric IDs as numbers. Integers above 2⁵³ lose precision when JSON is parsed; put long identifiers in quotes as strings.
📘 How to Create a JWT: Signing with HS256 Step by Step →
Sources
- RFC 7519 — JSON Web Token (JWT) ↗
- RFC 7515 — JSON Web Signature (JWS) ↗
- RFC 7518 — JSON Web Algorithms (JWA) ↗
- RFC 8725 — JSON Web Token Best Current Practices ↗
Key terms
Frequently Asked Questions
+JWT Generator (HS256/384/512) — how is it calculated?
Signs a JSON payload with your secret and builds a JWT (RFC 7519) using HS256, HS384 or HS512. The token is created in your browser and the secret is never sent anywhere; even so, it is safest not to paste production secrets into online tools.
+Which values are required?
Payload (JSON), Secret, Algorithm.
+Is my data stored?
No. All calculations run in your browser; the values you enter are never sent to or stored on a server. If you press “Save”, the calculation stays only in your own browser and you can delete it at any time.
+Is it free?
Yes, all tools are free and require no sign-up.
Similar tools
Popular Tools
Free Calculators in One Place
Tax, finance, health, math and more — 500+ tools, all in one place.