Decode a JWT without sending it to a website
A token can be decoded and its signature verified locally. That matters more than for most files, because a token is not information about a session, it is the session, valid until it expires.
At a glance
- Tool
- /tools/jwt-decoder
- Structure
- Header, payload and signature, separated by dots
- Encoding
- The header and payload are encoded, not encrypted. Anyone can read them
- Signature schemes verified
- HS, RS, ES and PS
- What decoding proves
- Nothing on its own
- What verifying proves
- The token was signed by the holder of the matching key
In detail
State the credential point plainly, because people paste tokens into websites every day without thinking about it. A bearer token is exactly what the name says: whoever holds it is treated as you, by every system that accepts it, until it expires. Handing one to a hosted decoder gives that service a working session. Whether anyone looks is beside the point; the exposure has already happened, and the only real remedy is revocation, which most people cannot do quickly.
The parts are not equally interesting. The payload is an encoding rather than a cipher, so anybody holding the token can already read every claim in it; that is by design and it is why nothing confidential belongs in a claim. The signature is the only part that carries weight, and checking it needs the corresponding key, which is the step that separates reading a token from trusting one.
Read the standard claims when you are debugging. An expired token, a token that is not yet valid, a token issued by the wrong issuer and a token meant for a different audience all fail, and they fail for completely different reasons that a single rejection message rarely distinguishes. The claim set tells you which of those you are looking at in about ten seconds.
Verify the locality with the network off, and treat that as the normal way to work with tokens rather than a demonstration. A token you decoded offline was never anywhere except your own machine, which is the only state in which a live credential is not a disclosure waiting to be discovered.
Examples
header . payload . signature encoded, encoded, and the proof
iss who issued it
sub who it identifies
aud which service it is meant for
exp when it stops being valid
nbf when it starts being valid
iat when it was issuedThings that catch people out
- Decoding shows what a token claims. Only verifying the signature shows that the claims were not written by whoever handed it to you.
- The payload is readable by anyone holding the token, so it is not a place for anything confidential.
- A live token that has been pasted anywhere outside your control should be treated as compromised. Revoke the session rather than waiting for it to expire.
Try it: Hash Generator
The file hasher is on every page here because it takes any file at all and proves the point: disconnect from the network, drop a file in, and it still returns a checksum you can compare against a published one.
Hash Generator
LOCAL · Browser-OnlyGenerate MD5, SHA-1, SHA-256, SHA-384, SHA-512, SHA3-256, SHA3-512, Keccak-256, CRC32, and HMAC hashes from text or files
MD5 is cryptographically broken and should not be used for security purposes. Use SHA-256 or SHA-512 instead.
Related Working without uploading
All working without uploading →Check a .env file without uploading your secrets
Find duplicate keys, mask values and generate a .env.example locally. A .env is nothing but credentials, so uploading one means rotating them.
Format and validate JSON without uploading it
Tidy and check JSON in your browser. The JSON people paste into a formatter is usually a live API response full of real records.
Base64 encode a file without uploading it
Encode files or text in your browser, with a URL-safe variant and line wrapping. Base64 is a transport encoding, never encryption.
Encrypt text in your browser without uploading it
AES encryption that runs locally, so the plaintext and the passphrase both stay put. What that protects, and what it cannot protect.
Generate a password without a server seeing it
Create passwords in your browser. A password produced by a remote service is a password that existed on somebody else's machine first.
Generate a QR code without uploading what it encodes
Make a QR code in your browser. The payload never leaves, and the result points where you said rather than through somebody else.
Tools for this
- JWT Decoder Free online JWT decoder - decode and inspect JSON Web Tokens without sending them to a server
- Base64 Encoder/Decoder Base64 encode and decode online - convert text to Base64 or decode Base64 strings instantly, free
- JSON Formatter JSON formatter and validator online - format, beautify, and validate JSON data instantly in your browser