Decode JWT tokens, check claim expiration in real time, and verify or sign HS256/384/512 signatures locally in your browser.
Think of a JWT (JSON Web Token) like a tamper-evident VIP pass issued when you log in. Instead of looking up your session in a database on every click, the server hands your browser a compact string with three dot-separated parts:
sub), name, role, and expiry time (exp).HMAC mixes the Header + Payload with a private Secret Key inside a one-way cryptographic blender (SHA-256, SHA-384, or SHA-512):
If a hacker changes even one letter in the Payload (e.g., "role": "admin"), the signature stops matching unless they know your Secret Key. Note: Without the secret key, you can still read the Header & Payload, you just cannot verify or forge the signature.
{"user":"bheem"}, unsafe inside URLs because of spaces, quotes, and braces.AโZ, aโz, 0โ9, plus +, /, and = padding.+ โ -, / โ _, and removes = so tokens travel cleanly inside URLs and HTTP headers.eyJ... token to see its color-coded 3 parts immediately. If invalid, Header & Payload clear automatically.iss issuer, sub user, iat issued at, exp expiry), and watch the live expiration badge.import jwt, time
secret = "dholakpur-laddoo-secret"
payload = {"sub": "chhota_bheem", "role": "defender", "exp": int(time.time()) + 3600}
# 1. Create (Sign) a JWT
token = jwt.encode(payload, secret, algorithm="HS256")
print("JWT:", token)
# 2. Verify & Decode (raises error if tampered or expired)
decoded = jwt.decode(token, secret, algorithms=["HS256"])
print("Verified User:", decoded["sub"])