JWT Decoder & Encoder
Decode a JWT to read its header and claims, verify its signature with a secret or public key, and sign new tokens with HS, RS, PS and ES algorithms.
Signature not verified. The contents below are decoded only. Enter the secret under Verify signature to check it.
Expiry: 20 Nov 2286, 17:46:39 UTC.
- sub
- 1234567890
- name
- Jane Doe
- iat
- 1700000000 (14 Nov 2023, 22:13:20 UTC)
- exp
- 9999999999 (20 Nov 2286, 17:46:39 UTC)
- alg
- HS256
- typ
- JWT
The key is used in your browser to check the signature and is not sent to our server. The sample token is signed with the secret sample-secret.
FJSZYB9O5aGXpYIwbbvfIJcUsv1vXdymaPoKja3slJk
01 · Definition
What is a JWT?
A JSON Web Token (JWT) is a compact, signed piece of JSON used to pass claims such as a user ID and an expiry time between systems. It has three base64url parts separated by dots: a header naming the signing algorithm, a payload of claims, and a signature. Anyone can read the first two; only the signature proves who issued them.
02 · Overview
How the JWT Decoder & Encoder works
Paste a JSON Web Token to see its header and payload, with exp, iat and nbf shown as UTC times and a note on whether the token has expired. Enter the shared secret, or a public key as PEM, X.509 certificate or JWK, to check the signature for HS256/384/512, RS256/384/512, PS256/384/512 and ES256/384/512. The tool says valid, invalid or not verified, and never reports a signature as valid without checking it. Encode mode signs a payload with the same algorithms. Decoding, verifying and signing run in your browser with the jose library; tokens and keys are not sent to our server.
03 · Guide
Decoding a JWT vs verifying it
Decoding is base64url-decoding the header and payload. It needs no key and proves nothing: anyone can write a payload and encode it. Verifying recomputes the signature over the header and payload with a key and compares it with the third part of the token. Only a verified token can be trusted.
This tool separates the two. Without a key it shows the claims and labels the signature as not verified. With a key it reports the signature as valid or invalid. Expiry is reported on its own line, because a token can be correctly signed and expired at the same time.
04 · Guide
HS256 vs RS256 vs ES256
The alg header names how the token was signed. HMAC algorithms use one shared secret to sign and verify. RSA and ECDSA algorithms sign with a private key and verify with the public key, so services that only check tokens never hold a key that could mint them.
| alg | Type | Key to sign | Key to verify |
|---|---|---|---|
| HS256, HS384, HS512 | HMAC with SHA-2 | Shared secret | The same secret |
| RS256, RS384, RS512 | RSA PKCS#1 v1.5 | RSA private key | RSA public key |
| PS256, PS384, PS512 | RSA-PSS | RSA private key | RSA public key |
| ES256, ES384, ES512 | ECDSA (P-256, P-384, P-521) | EC private key | EC public key |
05 · Use cases
When to use the JWT Decoder & Encoder
- 01
Debug a 401 by reading the token your client is sending
- 02
Check a token's signature against your secret or your identity provider's public key
- 03
See when a token expires in UTC
- 04
Sign a test token with a known secret for local development
06 · Examples
JWT Decoder & Encoder examples
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkphbmUgRG9lIiwiaWF0IjoxNzAwMDAwMDAwLCJleHAiOjk5OTk5OTk5OTl9.FJSZYB9O5aGXpYIwbbvfIJcUsv1vXdymaPoKja3slJk
ex 01alg: HS256, typ: JWT · sub: 1234567890, name: Jane Doe, iat: 1700000000 (14 Nov 2023, 22:13:20 UTC), exp: 9999999999 (20 Nov 2286, 17:46:39 UTC)
The sample token the tool opens with. Without a key the signature is labelled not verified.
The sample token, with the secret sample-secret
ex 02Signature valid (HS256)
The token was signed with that secret. Any other secret, or any change to the header or payload, gives Signature invalid.
A token whose exp is 1735689600
ex 03Expired, on 1 Jan 2025, 00:00:00 UTC
exp is Unix seconds. The tool shows the UTC time and how long ago the token expired.
Encode: payload {"sub":"alex"}, HS256, secret supersecret
ex 04eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhbGV4In0.…
A signed token, re-signed as you edit. A button sets iat to now and exp to one hour later.
07 · FAQ
JWT: frequently asked questions
Is it safe to paste a JWT here?
How do I verify a JWT signature?
How is decoding different from verification?
What is the difference between HS256 and RS256?
Why does my token say expired?
Can I edit a payload and re-sign it?
Does it support encrypted JWTs (JWE)?
08 · Guides
JWT guides
- HS256 vs RS256 vs ES256: JWT Signing Algorithms→
HS256 signs JWTs with a shared secret; RS256 and ES256 use a private and public key pair. Key rules, measured signature sizes and when to use each.
09 · Reference
Specs and further reading
These are the primary sources this tool follows. Where a specification defines the behaviour, we link the specification, not a summary of it.
- RFC 7519: JSON Web Token (JWT)
IETF. Defines the JWT format and the registered claims, including exp, nbf, iat, sub and aud.
- RFC 7515: JSON Web Signature (JWS)
IETF. Defines the three-part signed structure and how a signature is computed and checked.
- RFC 7518: JSON Web Algorithms (JWA)
IETF. Defines the alg values: HS256, RS256, PS256, ES256 and the rest.
- JSON Web Token Cheat Sheet
OWASP. Threats to JWTs and how to defend against them, including unsecured tokens and key type confusion.
10 · More
Tools that pair with JWT
API Key Generator
Generate random API keys and secrets with an optional prefix such as sk_test_. Choose base64url, alphanumeric, base32 or hex, 8 to 96 characters, up to 100 keys.
Hash Generator
Hash text or a file with MD5, SHA-1, SHA-256 or SHA-512, and compare it with an expected checksum. Create and check bcrypt password hashes.
UUID Generator
Generate UUID v4, v7 or v1, one at a time or up to 1,000. Output as standard, uppercase, braces (GUID), no hyphens, URN or Base64, and decode any UUID you paste.