Why use JWT Encoder?
- Signs tokens with HMAC-SHA256 using the Web Crypto API — no server round-trip
- Fully editable header and payload JSON, with friendly validation errors
- Generates a ready-to-copy three-part token in the standard xxx.yyy.zzz format
- Runs 100% client-side — your secret and claims are never transmitted anywhere
About JWT Encoder
A JSON Web Token is a compact, URL-safe token made of three base64url-encoded parts: a header (algorithm and type), a payload (claims like sub, name or exp), and a signature that proves the token was not tampered with. This tool builds all three parts for you and signs them with HMAC-SHA256 (the HS256 algorithm), the most common choice for local development, internal services and quick API testing.
Edit the header and payload as raw JSON, enter any secret string, and generate a fully signed token in one click. Because HS256 uses a single shared secret for both signing and verifying, it is best suited to development, debugging and learning — production systems handling real user authentication often prefer asymmetric algorithms like RS256 so the signing key never has to be shared with every verifier.
How to use JWT Encoder
- 1
Edit header and payload
Adjust the header and payload JSON objects to match the claims you want to test.
- 2
Enter a secret
Type any string to use as the HMAC signing secret — the same value your backend must use to verify it.
- 3
Generate and copy
Click Generate JWT to build and sign the token, then copy the full three-part string.
Frequently asked questions
What algorithm does this tool use?
HS256 (HMAC using SHA-256), the most common symmetric signing algorithm for JWTs. The same secret string is used to both sign and later verify the token.
Is this safe for production authentication?
This tool is intended for local development, debugging and testing. For production systems, use a proper backend library to sign tokens, keep secrets out of client-side code, and consider asymmetric algorithms like RS256 or ES256 for multi-service verification.
Is my secret sent anywhere?
No. Signing happens entirely in your browser using the Web Crypto API. Your header, payload and secret are never transmitted to any server.
Why is my payload rejected?
The header and payload boxes must each contain valid JSON. Check for missing commas, unquoted keys or trailing commas — the tool will show an error describing which part failed to parse.
Can I add custom claims?
Yes. Add any key-value pairs you like to the payload JSON, such as roles, permissions or an expiry (exp) timestamp — they will be included in the signed token as-is.
How do I check a token this tool produced?
Paste the generated token into the JWT Decoder tool to inspect its header and payload, or verify the signature server-side using the same secret.
Related developer tools
Browse more free tools
Explore every category in our toolbox.