Skip to content
All tools

JWT decoder

Decode a JSON Web Token and check its expiry, sign and verify HMAC tokens, or generate a signing secret.

Runs in your browser. Nothing you paste here is sent to a server.

Questions

Is my token or secret sent anywhere?
No. Decoding, signing and generating secrets all run in your browser with the Web Crypto API. Nothing you paste here is sent to a server.
Does decoding a JWT verify it?
No. A JWT's header and payload are only Base64URL-encoded, not encrypted, so anyone holding the token can read them. Only checking the signature proves the token came from whoever holds the key and wasn't changed. For HS256, HS384 and HS512 tokens, add the secret to check it here. Never put passwords or other secrets in a payload.
How do exp, iat and nbf work?
They are Unix timestamps in seconds (NumericDate). exp is when the token stops being valid, iat is when it was issued, and nbf is when it starts being valid. This tool compares them with your device's clock.
How long should a JWT secret be?
At least as long as the hash: 256 bits (32 bytes) for HS256, 384 bits for HS384 and 512 bits for HS512 (RFC 7518, section 3.2). Use random bytes from a cryptographic generator, not a passphrase.
What's the difference between HS256 and RS256?
HS256 uses one shared secret to both sign and verify, so every service that checks tokens can also create them. RS256 and ES256 sign with a private key and verify with a public one, so services that only check tokens never hold the signing key. Identity providers (OAuth, OpenID Connect) usually use RS256 or ES256.
Why Base64URL instead of Base64?
Base64URL swaps + and / for - and _ and drops the = padding, so a token can travel in URLs, cookies and Authorization headers without being escaped (RFC 4648, section 5).

Good practice

  1. Minimum Entropy

    Never use human-readable passphrases for HMAC signing keys. Always use at least 256 bits (32 bytes) of random entropy from a CSPRNG.

  2. Protect from Source Code

    Never commit JWT secrets to Git repositories. Inject them dynamically at deploy time using encrypted secret managers (AWS Secrets Manager, Infisical, Doppler).

  3. Defend Against Algorithm Confusion

    Explicitly specify accepted algorithms in your verification parser (e.g. algorithms: ['HS256']) to prevent tokens signed with the "none" algorithm from being accepted.

  4. Rotate Secrets Periodically

    Implement a key rotation strategy with grace periods. Support multiple active keys so that tokens signed with the previous key remain valid until their natural expiry.

Which algorithm

AlgorithmKeySizeUse it for
HS256 · HS384 · HS512One shared secret (HMAC)256 to 512 bitsOne backend that both issues and checks its own tokens
RS256RSA key pair2048 to 4096 bitsIdentity providers; many services verifying with a public key
ES256Elliptic-curve key pair (P-256)256 bitsThe same as RS256, with smaller keys and signatures