A JWT is three base64url-encoded parts joined by dots: a header, a payload and a signature. The header and payload are plain JSON, so you can read them on your own machine with jq, Python, Node or a browser tool that makes no network request. Decoding is not verification: only checking the signature with the issuer's key shows the claims are genuine.
Why it matters where you decode
A JWT that has not expired is a credential: whoever holds it can usually call the API as you. Pasting it into a website that sends it to a server hands it over. Decode it locally, or with a page you have checked makes no request, which you can see in the Network tab of the browser's dev tools.
On the command line
Read the token from a file or the clipboard rather than typing it into the command, where it would be saved in your shell history. These examples use pbpaste on macOS; on Linux use wl-paste or xclip -o -selection clipboard.
Plain base64 -d is a trap. JWTs use the URL-safe alphabet (- and _) and drop the = padding, so GNU base64 reports invalid input and the macOS one can silently drop the last characters, leaving JSON with its closing brace missing. Translate the alphabet and add the padding first, or use one of the commands above.
In the browser console
In the dev tools console of a blank tab, with the token in a variable called token:
atob accepts the missing padding but returns raw bytes as characters, so accented letters and other non-ASCII text in the claims come out garbled.
What to watch for
Signed, not encrypted: anyone with the token can read the payload, so it should never hold secrets. A token with five parts instead of three is an encrypted JWE, which cannot be read without the key.
Decoding is not verification: a decoded payload is whatever the sender wrote. A server must verify the signature with a library such as jose, jsonwebtoken or PyJWT, check exp, nbf, iss and aud, and reject alg: none.
Timestamps are in seconds: exp, iat and nbf are Unix times in seconds, not milliseconds. Multiply by 1000 before passing them to JavaScript's Date.
Clock differences: a token can look expired on your machine but not on the server, or the other way round. Most libraries let you allow a few seconds of leeway.
The Bearer prefix: a copied Authorization header starts with Bearer . Remove it before using the commands above.
Do it in your browser
The JWT Decoder splits a pasted token into its header and payload as you type, lists the registered claims with their dates in local time, says whether exp has passed or nbf is still ahead by your clock, and warns about alg: none. It ignores a leading Bearer and decodes UTF-8 correctly. Decoding happens in the page with no request. It does not verify the signature; the JWT Encoder & Verifier checks a token against a secret or public key when you need that.
Frequently asked questions
Is it safe to paste a JWT into an online decoder?
Only if the decoder runs entirely in your browser and sends nothing to a server, which you can check in the Network tab of the dev tools. A valid token is a credential, so treat it like a password.
Can you decode a JWT without the secret?
Yes. The header and payload are base64url-encoded JSON that anyone can read. The secret or public key is needed only to verify the signature, not to read the claims.
How do I check if a JWT has expired?
Decode the payload and compare its exp claim, a Unix time in seconds, with the current time. A server should rely on its JWT library’s expiry check rather than reading the claim by hand.
What is the difference between decoding and verifying a JWT?
Decoding reads the header and payload. Verifying checks the signature with the issuer’s secret or public key, which proves the token was issued by them and has not been changed; only a verified token’s claims can be trusted.