How to Decode JWT Token: Read Claims Safely in Browser
By Toolinga Editorial Team · Updated · 7 min read
If you have ever stared at a long string like eyJhbGciOi... in an API response and wondered what it actually says, you are not alone. Learning how to decode JWT token strings is one of the most useful debugging skills a developer can pick up, and it takes about thirty seconds once you know the trick. A JSON Web Token (JWT) looks like random gibberish, but it is really just three readable chunks glued together with dots. In this guide, you will learn what lives inside each chunk, how to decode a token safely in your browser without installing anything, and the one security mistake you must avoid when inspecting tokens.
What a JWT Actually Contains
A JWT is a compact, URL-safe way of carrying information between two parties — most often between a server and a browser or mobile app after a user logs in. When authentication succeeds, the server creates a token stuffed with claims: small statements like "this is user 42", "this token was issued at 3pm", and "it expires in one hour". The client then sends that token back with every request, usually in the Authorization header, so the server knows who is asking.
Here is the part that surprises most beginners: a standard JWT is signed, not encrypted. Anyone holding the token string can read the payload — no secret key required. The signature only proves the token came from someone holding the secret (or private key) and has not been tampered with. Reading and trusting are separate operations, and confusing them causes most JWT security mistakes.
Because the token carries the user data, servers can verify requests without a database lookup every time — but it also makes the token a bearer credential, like a temporary password. Whoever holds it can act as the user until it expires, so handle real tokens with care.
Header, Payload, Signature: The Three Parts
Every guide on how to decode JWT token values starts with the same anatomy, because the structure never changes: header.payload.signature — three Base64URL-encoded segments separated by dots, each one plain JSON underneath.
1. Header. A small JSON object describing the token itself, almost always with two fields: typ ("JWT") and alg, the signing algorithm, such as HS256 (HMAC with SHA-256) or RS256 (RSA with SHA-256). A typical decoded header:
{"alg": "HS256", "typ": "JWT"}
2. Payload. The payload holds the claims — the actual data. Claims are registered (the standard iss, sub, aud, exp, nbf, iat, jti), public (custom names registered to avoid collisions), or private (whatever issuer and consumer agree on, like a user role). The classic example:
{"sub": "1234567890", "name": "Jane Doe", "iat": 1516239022}
3. Signature. The signature is made by signing the encoded header, a dot, and the encoded payload together — with HMAC that is HMACSHA256(base64UrlEncode(header) + "." + base64UrlEncode(payload), secret); with RSA the issuer signs with its private key. Everything is Base64URL-encoded — a URL-safe Base64 variant swapping + for - and / for _ — so tokens survive safely inside URLs and headers.
How to Decode a Token Safely in Your Browser
Now the practical part of how to decode JWT token strings without installing any software. You have three good options, and the safest ones never send your token to a server.
Option 1: a client-side decoder. The easiest route is a free JWT decoder that runs entirely in your browser — paste the token and the header and payload appear as readable JSON instantly. Decoding happens locally in JavaScript, so the token never leaves your machine: no upload, no server log, nothing to leak.
Option 2: your browser console. Prefer the keyboard? Open DevTools and run this one-liner — it converts Base64URL back to standard Base64 first:
JSON.parse(atob(token.split('.')[1].replace(/-/g,'+').replace(/_/g,'/')))
This splits off the middle segment, swaps the URL-safe characters back, decodes it with atob(), and parses the JSON. It only reads the payload — it does not verify the signature, which is fine for inspection but means you should not treat the contents as trusted.
Option 3: a debugger page. Debugger pages like jwt.io also decode tokens in your browser and let you test signature verification with a secret. They work, but for quick reads prefer a minimal tool you trust — paste the token into Toolinga's JWT decoder when you just want answers fast.
Remember: decoding is not verifying. Decoding reads the payload; verifying checks the signature, which needs the secret (HMAC) or public key (RSA). A decoder will happily display a payload with an invalid signature. Never trust a token just because it decoded cleanly.
Common Claims Explained (exp, iat, sub)
Once you can decode tokens, the next step is understanding what the standard claims mean. These three show up in nearly every token you will meet:
exp— expiration time. The moment after which the token must not be accepted. It is a NumericDate: the number of seconds since the Unix epoch (1970-01-01T00:00:00Z). Ifexpis1760500000, the token dies at that second. When your app suddenly returns "token expired" errors, decoding and readingexpis the fastest diagnosis — you can convert the number with any epoch converter ornew Date(1760500000 * 1000)in the console.iat— issued at. When the token was created, in the same NumericDate format. Comparingiatandexptells you the token's lifetime at a glance, which is handy when you suspect a misconfigured expiry (say, tokens that live for a year because someone typed days instead of seconds).sub— subject. Whom the token is about — usually a user ID like"sub": "user_8f42". When requests behave as if they belong to the wrong account, checkingsubtells you immediately whether the token itself is the problem or something downstream is.
You will also meet iss (issuer), aud (audience), nbf (not valid before this time), and jti (unique token ID, handy for revocation lists). One tip: servers usually allow a few seconds of clock skew on exp, so do not chase phantoms over a one-second difference.
Why You Should Never Paste Tokens Into Random Sites
Here is the security lesson that matters more than everything above: because a JWT payload is only encoded and not encrypted, the token string itself is the secret. Anyone who copies it can replay it against the API and impersonate the user until exp hits. Pasting a live production token into a decoder that sends it to a server — or logs it, or shows it in a shared screenshot — hands your session to whoever controls that server.
So follow three rules. First, decode with test tokens: use a dummy or expired token, or one minted for a throwaway test user, before trying any new tool. Second, prefer tools that decode locally — if the page works offline, your token never left your machine. Third, treat exposure as compromise: if a real token may have leaked, revoke it immediately. Short-lived access tokens exist precisely to limit the blast radius.
Token debugging rarely happens in isolation — when tracing an auth failure you are usually also staring at database query logs, so running those through a SQL formatter first makes the session far less painful. Keep the loop tight: decode the token, read the claims, check the queries.
Is decoding a JWT the same as verifying it?
No. Decoding Base64URL-decodes the payload so you can read it — no secret needed. Verifying checks the cryptographic signature, which requires the HMAC secret or RSA public key. A token can decode perfectly yet have an invalid signature.
Can I decode a JWT without the secret key?
Yes. A standard JWT payload is only encoded, not encrypted, so no secret is needed to read it. You need the secret only to verify the signature or mint new tokens. Truly encrypted tokens (JWE) are a different format and cannot be read without the key.
Why does my token show "invalid signature" in a decoder?
Almost always because the decoder lacks your signing secret — paste it into the verification field. Other causes: the token was modified after signing, the wrong algorithm is selected, or stray whitespace got copied. The payload still decodes fine either way.
How can I tell exactly when my token expires?
Decode the token, read the exp claim, and convert the Unix timestamp — new Date(exp * 1000) in the console gives the exact expiry moment. Compare with the current time to see the token's remaining life.
Reading tokens is a daily debugging skill, not a dark art. Now that you know how to decode JWT token payloads — the three parts, what exp, iat, and sub mean, and why live tokens deserve respect — the next mysterious eyJ... string will take seconds to crack. When it shows up, decode it free in your browser with Toolinga's JWT decoder: paste, read, debug, done.
Related guides
Free Password Generator: Strong Random Passwords
Create strong random passwords in seconds with our free password generator. Learn the right length and generate a secure one now.
November 10, 2026How to Convert JSON to CSV: A Simple Guide
Learn how to convert JSON to CSV for spreadsheets — flatten nested data, fix common errors, and convert API data in your browser…
November 10, 2026What Is SHA-256 Hash Used For? A Simple Guide
Learn what is SHA-256 hash used for — passwords, downloads, and blockchains — with a real example and a free hash generator.
November 8, 2026What Is Unix Timestamp? A Simple Guide
What is Unix timestamp? Learn what those 10-digit numbers mean, how to read them, and how to convert any timestamp to a date.
November 7, 2026