JWT Decoder — Decode Any JSON Web Token Online
Decode and inspect any JWT token instantly. View header, payload, and signature. Free online JWT decoder. No signup. All decoding happens in your browser. Privacy first.
Use JWT Decoder
Launch the JWT Decoder tool — fully free, no signup required.
What Is a JWT Token?
JWT Token Structure Explained
| Part | Contains | Encoded As |
|---|---|---|
| Header | Algorithm type | Base64URL |
| Payload | Claims and data | Base64URL |
| Signature | Verification hash | Cryptographic |
How to Decode a JWT Token
JWT Security Best Practices
What It Is
A JSON Web Token (JWT) is a compact, URL-safe credential format defined by RFC 7519. It packs three pieces of information — a header describing the signing algorithm, a payload of JSON claims, and a cryptographic signature — into a single string of three Base64URL segments separated by dots. JWTs are how modern OAuth flows, single sign-on systems, microservice meshes, and serverless authorizers move identity around. The DigiMetrics JWT Decoder runs entirely in your browser, so the token you paste never touches our infrastructure — important because a real JWT is, by definition, an unexpired credential.
How It Works
The signing server builds the header and payload as JSON, Base64URL-encodes each, joins them with a dot, then signs that string with the configured algorithm (HMAC-SHA256, RSA-SHA256, ECDSA, EdDSA) using its secret or private key. The signature itself is Base64URL-encoded and appended after another dot. Verification reverses the flow: split on dots, recompute the signature over header+payload using the shared secret or public key, and compare. The decoder skips the cryptographic step because it doesn't have your key — but reading the unverified contents is exactly what you need when debugging integration issues.
Real-World Examples
A backend engineer debugging a 401 decodes the access token to confirm the exp claim is still in the future and the aud matches their API's identifier. A frontend developer integrating a third-party SSO pastes the ID token returned by Google to see exactly which scopes were granted. A mobile developer chasing a sign-out bug decodes a refresh token to check whether the auth provider rotated the sub on the last login. A security reviewer audits a token issued to a partner to confirm no overly broad role or scope claims slipped through. An on-call engineer decodes the token attached to a failing webhook to verify the issuer matches the expected service.
Common Mistakes to Avoid
Treating JWTs as encrypted — they aren't. The payload is Base64URL, fully readable by anyone who intercepts the token. Storing sensitive data (passwords, SSNs, raw credit card numbers) inside the payload is a leak waiting to happen. Trusting an alg: none token, the classic JWT vulnerability where a server accepts an unsigned token if it doesn't enforce the expected algorithm. Forgetting to verify exp, iss, and aud separately — a valid signature alone is not enough. Logging full JWTs in plaintext server logs, which leaks reusable credentials to anyone with log access. And refreshing on every request, defeating the point of stateless tokens.
Security Implications
A JWT is a bearer credential — possession equals authorization until it expires. Always send tokens over HTTPS only. Set short access-token lifetimes (5–15 minutes) and rotate via refresh tokens. Pin the expected algorithm server-side (e.g. RS256) and reject any token whose alg header doesn't match. Validate iss and aud on every request. Use a centralized JWKS endpoint for key rotation. Store tokens in HttpOnly secure cookies for browser flows when feasible; localStorage exposes them to any XSS payload. Treat every decoded JWT you share publicly as a fresh credential that needs revoking.
Best Practices
Keep payloads small — every API call carries the full token in a header, so bloated claims taxes every request. Use standard claim names (iss, sub, aud, exp, iat, nbf, jti) so off-the-shelf libraries validate them automatically. Always set exp; never issue infinite-lifetime tokens. Prefer asymmetric algorithms (RS256, ES256) for any system where the signer and verifier are different services. Maintain a key rotation schedule and publish public keys via JWKS. Use jti and a server-side revocation list when you need true logout. And document which claims your APIs expect, in the same place as your API reference.
Troubleshooting Guide
Token rejected with 'invalid signature'? Either the wrong key was used or the token was modified in transit. 'Token expired' is straightforward — the client clock is skewed or the token sat in a queue too long. 'Audience mismatch' means the token was issued for a different API; check the aud claim. 'Invalid algorithm' is a security red flag — your verifier is enforcing one algorithm but the token claims another. 'Malformed token' usually means the JWT was URL-encoded twice or had whitespace inserted by a middleware. If decoding fails entirely, the token isn't actually a JWT — possibly an opaque session ID or a JWE (encrypted JWT).
Frequently Asked Questions
What is a JWT token?+
A JWT (JSON Web Token) is a compact, URL-safe string used to securely transfer information between a client and server. It has three parts: a header, a payload, and a signature, separated by dots.
Is it safe to decode a JWT token in this tool?+
Yes. Decoding happens entirely in your browser. No token data is sent to our servers. However, never share your JWT signing secret keys with any third-party tool.
Is the payload of a JWT encrypted?+
No. The payload is Base64URL-encoded — readable by anyone with the token. For confidentiality, use JWE (JSON Web Encryption) instead.
Does this tool verify the signature?+
No. Signature verification requires your signing secret or public key, which we never see. The decoder shows you the claims so you can inspect them; verification stays on your server.
What's the difference between an access token and an ID token?+
Access tokens authorize API calls (you send them with each request). ID tokens identify the user to the client app after sign-in. Both can be JWTs but they have different audiences and uses.
Why are all three segments base64?+
Compactness and URL-safety. Base64URL keeps the token to printable characters with no = padding so it slots into Authorization headers, URLs, and cookies without further escaping.
What does 'alg: none' mean?+
An unsigned token. Any server that accepts alg: none is critically vulnerable — an attacker can forge any claims. Always pin the expected algorithm.
Can I shorten an expired token's exp claim?+
No. The signature is computed over header+payload. Any change invalidates the signature unless you re-sign with the original key.
What lifetime should I set for exp?+
Access tokens: 5–15 minutes. Refresh tokens: hours to days, with rotation. ID tokens: matched to your session length.
How do I revoke a JWT before it expires?+
Stateless JWTs cannot be revoked individually. Common approaches: short access tokens + refresh rotation, a server-side blocklist keyed by jti, or rotating the signing key.
What's a JWKS endpoint?+
A standardized URL (usually /.well-known/jwks.json) where an issuer publishes its current public keys. Verifiers fetch and cache it to validate tokens without manual key distribution.
Should I put roles and permissions in the JWT?+
Coarse-grained roles, yes. Fine-grained permissions that change frequently are better looked up server-side, otherwise revocation becomes painful.
Is JWT the same as OAuth?+
No. JWT is a token format. OAuth 2.0 is an authorization framework. OAuth often uses JWTs as its access and ID tokens, but they're independent specs.
Why does my JWT have four segments?+
Five-segment tokens are JWE (encrypted). Four segments usually means a typo or a token from a non-standard issuer. Standard JWT/JWS is always three.
How to decode a JWT
- 1
Paste the token
Drop the full JWT (three Base64URL segments separated by dots) into the input box.
- 2
View the header
The first segment decodes to the JWT header — typically the algorithm (alg) and token type (typ). HS256, RS256, and ES256 are the common production algorithms.
- 3
Inspect the payload
The middle segment decodes to the claims: who issued it (iss), who it's for (aud), the subject (sub), issued-at and expiry timestamps (iat, exp), plus any custom claims your app added.
- 4
Check expiry and audience
Compare exp to the current Unix time. Verify iss and aud match what your server expects. Mismatches here are the #1 reason a token gets rejected.
- 5
Note the signature
The decoder shows the third segment but does not verify it — signature verification requires the secret or public key your auth server uses, which never leaves your backend.
Learn More — Related Guides
Related Tools — More Developer Tools
JSON Formatter
Format, validate and beautify JSON data instantly. Free online JSON formatter, no signup needed.
Base64 Encoder
Encode or decode Base64 strings instantly online. Free Base64 converter, no signup required.
URL Encoder
Encode or decode URLs instantly online. Free URL encoder and decoder, no account needed.
HTTP Headers Checker
Inspect HTTP response headers for any URL. Free online header checker for developers.
URL Parser
Parse and analyze any URL into its components instantly. Free online URL parser tool.
Hash Generator
Generate MD5, SHA-1, SHA-256 and SHA-512 hashes from any text. Free online hash generator.