How to Decode JWT Tokens
March 22, 2026 · 5 min read
JSON Web Tokens (JWTs) are everywhere in modern web development. If you've ever worked with authentication APIs, OAuth, or single sign-on, you've dealt with JWTs. But what's actually inside one? And how do you decode it?
In this guide, you'll learn what JWTs are, how they're structured, and how to decode them — both manually and with a free online JWT decoder.
What Is a JWT?
A JWT (pronounced "jot") is a compact, URL-safe token used to transmit claims between two parties. It's defined in RFC 7519 and commonly used for:
- Authentication — After a user logs in, the server issues a JWT that the client includes in subsequent requests.
- Authorization — The token carries the user's permissions and roles.
- Information exchange — JWTs can securely transmit data between services.
JWT Structure: The Three Parts
Every JWT consists of three Base64URL-encoded parts separated by dots:
1. Header
The header typically contains the signing algorithm and token type:
2. Payload
The payload contains the claims — statements about the user and additional metadata:
Common standard claims include:
- sub — Subject (usually the user ID)
- iat — Issued At (Unix timestamp)
- exp — Expiration Time
- iss — Issuer
- aud — Audience
3. Signature
The signature verifies the token hasn't been tampered with. It's created by signing the encoded header and payload with a secret key:
Important: Decoding a JWT does not verify it. Anyone can decode a JWT — the signature verification is what proves it's authentic. Never trust a JWT's claims without verifying the signature on your server.
How to Decode a JWT
Method 1: Use an Online Decoder
The quickest way is to paste your token into a JWT decoder tool. It will instantly show you the header, payload, and expiration status.
Paste any JWT to see its header, payload, and expiration status.
Open JWT DecoderMethod 2: Command Line
You can decode a JWT with Base64 decoding. Split the token on the dots and decode each part:
Note: You may need to add padding (=) to the Base64 string for some decoders. The UtilShed JWT decoder handles this automatically.
Method 3: In JavaScript
Method 4: In Python
Common JWT Pitfalls
- Don't store secrets in JWTs — the payload is only encoded, not encrypted. Anyone can decode it.
- Always check expiration — look at the exp claim before trusting a token.
- Verify the signature server-side — decoding is not the same as verifying.
- Don't store JWTs in localStorage — use httpOnly cookies to prevent XSS attacks.
When to Use JWTs
JWTs are great for stateless authentication — the server doesn't need to store session data. They work well for:
- API authentication (REST, GraphQL)
- Single sign-on (SSO) across services
- Short-lived authorization tokens
They're less ideal for long-lived sessions or when you need server-side session revocation.
Try It Now
Ready to decode a JWT? Use the free JWT decoder on UtilShed — paste any token to instantly see its contents, expiration status, and claims.
You might also find these tools useful:
- Base64 Encoder/Decoder — since JWTs use Base64URL encoding
- JSON Formatter — to pretty-print the decoded payload
- Timestamp Converter — to convert iat and exp Unix timestamps to human-readable dates