Plain definition
Definition of JSON Web Token (JWT)
A compact, URL-safe token standard (RFC 7519) that encodes JSON claims between two parties and protects them with a digital signature or encryption.
Compact JWS = Base64url(Header) + "." + Base64url(Payload Claims) + "." + Base64url(Signature)Worked example
Imagine a made-up webhook testing workbench called TraceBin at `https://tracebin.example`. After a user signs in, the auth service issues a short-lived signed JWT (JWS) with `alg: "RS256"` in its header and JSON claims in its payload: `{"sub": "usr_914", "org": "org_22", "iss": "https://auth.tracebin.example", "aud": "tracebin-api", "iat": 1795699200, "exp": 1795700100}`. Because `exp` is 15 minutes (900 seconds) after `iat`, any microservice or edge gateway holding the public JWKS key can verify the signature locally without querying the central user table on every API call.
Crucially, TraceBin never places Stripe keys, internal email notes, or sensitive PII inside those claims, because standard JWS segments are Base64url-encoded JSON rather than encrypted (JWE). Any browser script or network proxy holding the token can decode the middle segment instantly. When a team revokes a member's access, the 15-minute access JWT expires quickly while TraceBin revokes the paired server-side refresh token immediately.
Why it matters when you launch
JWTs appear everywhere in modern auth providers, OAuth 2.0 OIDC ID tokens, and multi-service APIs because stateless signature verification scales cleanly across edge nodes and worker services. Following IETF RFC 7519 registered claims (`iss`, `sub`, `aud`, `exp`, `iat`, `jti`) gives every service a standard contract for who issued the token and who may accept it.
However, rolling custom JWT verification carelessly introduces severe security holes. IETF RFC 8725 (JWT Best Current Practices) instructs implementations to restrict accepted algorithms via an explicit allowlist, reject unsigned `alg: "none"` tokens, and check `iss`, `aud`, and `exp` on every request. For simple monolithic web apps, opaque `HttpOnly` server sessions are often easier to revoke immediately than long-lived JWTs.
Common mistakes
- Assuming a signed JWT hides its contents and packing secrets or private user data into a Base64url-encoded JWS payload.
- Trusting the `alg` header supplied by the caller without pinning an allowed algorithm server-side, opening `alg: "none"` or key-confusion attacks.
- Storing long-lived JWTs in browser `localStorage` where any third-party script or XSS vulnerability can read and exfiltrate them.
- Issuing 30-day JWTs with no short expiry or revocation plan, leaving banned users or leaked tokens valid until next month.
Tools and guides that use it
Free tool
Launch Day ChecklistEverything to check before, during and after launch day, saved in your browser.Free tool
Live Launch Readiness CheckerInspect any live URL for HTTPS, title, meta description, canonical, Open Graph cards, JSON-LD and AI search crawler access.Founder guide
The Next.js Technical SEO Launch Checklist (2026)What to check before and after launch day: crawlability, metadata, canonical URLs, structured data, sitemaps, internal links, Core Web Vitals and AI crawlers.Founder guide
Privacy Policy and Terms of Service for a New SaaS (2026)What your legal pages need to cover before launch, what GDPR, CCPA, Stripe, Google OAuth and app stores check, and when to hire a lawyer.Related glossary terms
Official sources
Pritam Ghosh runs Hauntboard and maintains this glossary.
Published · Updated
Building something real? Launch it in public.
A person reviews every launch on Hauntboard, and every view and visit it sends your site is published on your launch page. Free to submit.