JWT Security Calculator
Score a JWT deployment on algorithm, claim validation, token lifetime, rotation, revocation and browser storage.
Inputs
Weight 12
Weight 10
Weight 8
Weight 5
JWT Score
67/ 100
JWT Grade
C — Fair
Stolen Token Validity
15minutes
Most Critical Gap
Add a revocation check so logout takes effect
Algorithm Assessment
Strong — asymmetric signing with the algorithm pinned
Residual Exposure
33%
Step by step
Values used
Signing algorithm and verification = RS256 with a pinned algorithm — 22; Claim validation = exp and aud verified — 14; Access token lifetime = 15 minutes; Refresh token rotation with reuse detection = No; Revocation or deny-list checked on logout = No; Browser storage = HttpOnly Secure cookie — 10; Key identifier pinned to a trusted JWKS = Yes; Audience-scoped, least-privilege claims = Yes
JWT Security
JWT score = algorithm (25 EdDSA/ES256 … 0 header-supplied) + claim validation (20 full … 0 signature only) + lifetime score (10 at ≤5 min … 0 above a day) + 12 refresh rotation + 10 revocation + storage (10 HttpOnly cookie … 0 localStorage) + 8 key pinning + 5 audience scoping = 100.
JWT Score
= 67 / 100
JWT Grade
= C — Fair
Stolen Token Validity
= 15 minutes
Most Critical Gap
= Add a revocation check so logout takes effect
Algorithm Assessment
= Strong — asymmetric signing with the algorithm pinned
Residual Exposure
= 33
How it works
The algorithm term is weighted highest because accepting the alg header lets an attacker present alg=none or swap RS256 for HS256 and sign with the public key. Storage and lifetime are the next largest because they set what a stolen token is worth: a fifteen-minute token in an HttpOnly cookie is a much smaller prize than a day-long token in localStorage. A JWT is a bearer credential your server trusts without a database lookup, so every verification shortcut — unpinned algorithm, unverified audience, no revocation — is directly exploitable.
Formula
JWT Security
JWT score = algorithm (25 EdDSA/ES256 … 0 header-supplied) + claim validation (20 full … 0 signature only) + lifetime score (10 at ≤5 min … 0 above a day) + 12 refresh rotation + 10 revocation + storage (10 HttpOnly cookie … 0 localStorage) + 8 key pinning + 5 audience scoping = 100.
- algorithm
- Signing algorithm and whether it is pinned
- lifetime score
- Rewards short-lived access tokens
Frequently Asked Questions
How is JWT Security calculated?
JWT score = algorithm (25 EdDSA/ES256 … 0 header-supplied) + claim validation (20 full … 0 signature only) + lifetime score (10 at ≤5 min … 0 above a day) + 12 refresh rotation + 10 revocation + storage (10 HttpOnly cookie … 0 localStorage) + 8 key pinning + 5 audience scoping = 100. The algorithm term is weighted highest because accepting the alg header lets an attacker present alg=none or swap RS256 for HS256 and sign with the public key. Storage and lifetime are the next largest because they set what a stolen token is worth: a fifteen-minute token in an HttpOnly cookie is a much smaller prize than a day-long token in localStorage.
Why does JWT Security matter?
A JWT is a bearer credential your server trusts without a database lookup, so every verification shortcut — unpinned algorithm, unverified audience, no revocation — is directly exploitable.
What values do I need to enter?
This calculator takes 8 inputs: Signing algorithm and verification, Claim validation, Access token lifetime, Refresh token rotation with reuse detection, Revocation or deny-list checked on logout, Browser storage, Key identifier pinned to a trusted JWKS, Audience-scoped, least-privilege claims. The pre-filled defaults are a realistic starting point — replace them with figures from your own environment for a result you can act on.
Why not store the JWT in localStorage?
Because localStorage is readable by any script on the origin, so a single XSS exfiltrates every token. An HttpOnly Secure cookie is not script-readable, and holding the token only in memory limits exposure to the current page. Both need CSRF protection, which is a smaller problem than token theft.
Do short lifetimes remove the need for revocation?
They reduce it but do not remove it. Without a revocation check, logout and 'sign out everywhere' are advisory until the token expires, and a compromised account stays usable for the full remaining lifetime. Pair short access tokens with rotating refresh tokens and a deny-list for the access tokens you must kill immediately.
You might also need
- API Authentication Strength CalculatorCommonly used together
- REST API Security CalculatorCommonly used together
- Session Fixation Risk CalculatorCommonly used together
- HTTP Security Score CalculatorAlso in Web & API Security
- OWASP Risk CalculatorAlso in Web & API Security
- API Security Score CalculatorAlso in Web & API Security