Whitespace changes the signature
Even pretty-printing the same JSON changes the bytes you sign—tiny spacing tweaks create a totally different signature.
"typ": "JWT" will be set automatically if missing.Tip: Press Ctrl/Cmd + Enter to create a JWT. You can also drop a .json file into the payload box.
This JWT encoder helps you build a JSON Web Token quickly and safely without sending any data to a server. It is useful when you need a test token for an API, want to learn how JWTs are structured, or need to generate a signed token for a development environment. Everything runs in your browser, so secrets and keys stay on your device.
A JWT has three parts separated by dots: the header, the payload, and the signature. The header describes the
signing algorithm, the payload holds claims such as user IDs or roles, and the signature proves that the token
was created by a trusted party. The header and payload are JSON that get Base64URL-encoded; the signature is created
by signing the exact string header.payload. Changing even one character changes the signature.
To use this tool, enter your header and payload JSON in the input fields. Choose the signing method that matches your system, then provide a secret or private key if needed. Click Generate, and the full token appears instantly. You can copy the encoded JWT into your application, Postman, or a test request.
Signing options cover common use cases. HS256 uses a shared secret string and is common for internal services.
RS256 uses an RSA private key to sign and a public key to verify, which is better when multiple services need to
validate tokens without sharing a secret. The none option creates an unsigned token for debugging only
and should not be used in production.
Real-world examples include generating access tokens for API testing, creating short-lived tokens with expiration claims, or simulating login flows while building an authentication system. Whether you need a JWT generator, a JSON Web Token encoder, or a quick way to sign payloads, this tool provides a clear, reliable workflow.
Everything happens locally using the Web Crypto API. For highly sensitive keys, consider using the offline bundle or a dedicated local environment.
Even pretty-printing the same JSON changes the bytes you sign—tiny spacing tweaks create a totally different signature.
alg none omits the signature entirely. It’s handy for debugging but shouldn’t leave local/dev environments.
HS256 means everyone verifying also knows the secret; RS256 lets many services verify with just the public key.
Many teams mint access tokens for 5–15 minutes and rely on refresh tokens to keep sessions alive.
A kid header points verifiers to the right key in a JWK set—without it, they may brute-try every candidate.