What Is JWT? JSON Web Token Explained
JWT (JSON Web Token) is the standard way modern applications handle authentication and authorization. Every time you log into a web app and stay signed in, JWT is likely working behind the scenes. This guide explains JWT in simple terms — what it contains, how it works, and when to use it.
What Does JWT Stand For?
JWT stands for JSON Web Token. It's an open standard (RFC 7519) for securely transmitting information between parties as a compact, URL-safe string. The information is JSON-encoded and digitally signed so receivers can verify it hasn't been tampered with.
Why JWT Is Used
- Stateless authentication — servers don't need to store session data
- Self-contained — the token carries all necessary user information
- Cross-domain — works across different services and microservices
- Compact — small enough to send in HTTP headers and URLs
- Standardized — supported by every major platform and language
JWT Structure
A JWT consists of three parts separated by dots (.), each Base64URL-encoded:
- Header — contains the token type (JWT) and signing algorithm (e.g. HS256, RS256)
- Payload — contains claims (user data like ID, email, roles, expiration time)
- Signature — verifies the token wasn't modified, created using the header, payload, and secret key
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWII6MTIzNDU2Nzg5MCwibmFtZSI6IkpvaG4In0.signatureCommon JWT Claims
- iss (Issuer) — who created the token
- sub (Subject) — who the token is about (usually user ID)
- aud (Audience) — who the token is intended for
- exp (Expiration) — when the token expires (Unix timestamp)
- iat (Issued At) — when the token was created
- Custom claims — app-specific data like roles, permissions, email
How JWT Authentication Works
- User logs in with credentials
- Server validates credentials and creates a signed JWT
- Client stores the JWT (cookie, localStorage, or memory)
- Client sends JWT with every subsequent request (Authorization header)
- Server verifies the signature and reads claims — no database lookup needed
Decode JWT Tokens Online
During development, you often need to inspect JWT contents — check expiration, debug claims, or verify token structure. Our free JWT Decoder lets you paste any token and instantly view the header, payload, and expiration status.
Decode JWT Token Free
View JWT header, payload, and expiration — 100% client-side, tokens never leave your browser.
Related Free Tools
Frequently Asked Questions
Is JWT the same as OAuth?+
No. OAuth is an authorization framework. JWT is a token format. OAuth often uses JWTs as access tokens, but they're different concepts.
Where should I store JWT tokens?+
HttpOnly cookies are most secure for web apps (prevents XSS access). localStorage is convenient but vulnerable to XSS attacks. Never store JWTs in regular cookies without HttpOnly flag.
Can JWT tokens be revoked?+
JWTs are stateless, so revoking them requires additional infrastructure like token blacklists, short expiration times, or refresh token rotation.