oktools

JWT Decoder

Decode and inspect JSON Web Tokens, then verify a JWT signature against your own secret or public key — HS256, RS256, ES256, EdDSA and the rest of the RFC 7518 algorithms. Everything runs in your browser — no token or key is ever sent anywhere.

155 characters

Header

HS256
{
  "alg": "HS256",
  "typ": "JWT"
}

Payload

{
  "sub": "1234567890",
  "name": "John Doe",
  "iat": 1516239022
}
Registered claims
Subject (sub)1234567890
Issued at (iat)2018-01-18 01:30:22 UTC

Signature

SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
Paste the secret above to verify this signature.
Supported signature algorithms
HS256HMAC with SHA-256
HS384HMAC with SHA-384
HS512HMAC with SHA-512
RS256RSASSA-PKCS1-v1_5 with SHA-256
RS384RSASSA-PKCS1-v1_5 with SHA-384
RS512RSASSA-PKCS1-v1_5 with SHA-512
PS256RSASSA-PSS with SHA-256
PS384RSASSA-PSS with SHA-384
PS512RSASSA-PSS with SHA-512
ES256ECDSA on P-256 with SHA-256
ES384ECDSA on P-384 with SHA-384
ES512ECDSA on P-521 with SHA-512
EdDSAEdDSA (Ed25519)
Ed25519EdDSA (Ed25519)
noneUnsecured — no signature

Ed25519 verification depends on browser support for the Web Crypto Ed25519 curve.

How it works

A JWT is three Base64url strings joined by dots: a header, a payload and a signature. The decoder splits the token on those dots, Base64url-decodes the first two segments and parses each as JSON, which is all that reading a token takes — no key and no network request. The registered claims from RFC 7519 (iss, sub, aud, exp, nbf, iat and jti) are picked out and labelled, and the three timestamp claims are shown as UTC dates with how far in the past or future they fall, so an expired token is obvious without converting epoch seconds by hand.

Verification is a separate step, because the signature is the only part of a token that cannot be forged. Paste the HMAC secret or the issuer’s public key and the signature is checked against the exact bytes of the first two segments using the Web Crypto API built into the browser. The header’s alg picks the algorithm, the key is imported in whichever form you pasted it, and the result says whether the signature matches that key — which is what proves the claims were issued by whoever holds it and have not been altered since.

The input is forgiving about how a token was copied. A leading Authorization: or Bearer prefix, the quotes around a token lifted from a JSON body and the line breaks a terminal inserts are all stripped before decoding, so a token pasted straight out of a request log decodes without tidying.

Examples

Decode an access token

The payload is pretty-printed and the registered claims are listed beneath it with iat and exp rendered as dates: issued at 2025-01-01 00:00:00 UTC and expiring an hour later, so the badge reads EXPIRED. The header shows the token is signed with HS256.

Token
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJodHRwczovL2F1dGguZXhhbXBsZS5jb20iLCJzdWIiOiJ1c2VyXzhmM2EiLCJhdWQiOiJvcmRlcnMtYXBpIiwiaWF0IjoxNzM1Njg5NjAwLCJleHAiOjE3MzU2OTMyMDAsInNjb3BlIjoib3JkZXJzOnJlYWQifQ.Md6qe805Ua8uiyUpWgjiUhomoYHTrS0zR43MBbkG3A4
Decoded payload
{
  "iss": "https://auth.example.com",
  "sub": "user_8f3a",
  "aud": "orders-api",
  "iat": 1735689600,
  "exp": 1735693200,
  "scope": "orders:read"
}

Verify an HS256 signature

The token above was signed with this secret. Paste it into the key box under the signature and the check passes; change a single character of the token’s payload and it reports that the signature does not match.

Secret
your-256-bit-secret
Result
Signature verified with HMAC with SHA-256.

Paste a whole Authorization header

The Authorization: and Bearer prefixes are removed before decoding, so a header line copied from browser developer tools or a curl -v trace decodes exactly as the bare token does.

Pasted text
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJodHRwczovL2F1dGguZXhhbXBsZS5jb20iLCJzdWIiOiJ1c2VyXzhmM2EiLCJhdWQiOiJvcmRlcnMtYXBpIiwiaWF0IjoxNzM1Njg5NjAwLCJleHAiOjE3MzU2OTMyMDAsInNjb3BlIjoib3JkZXJzOnJlYWQifQ.Md6qe805Ua8uiyUpWgjiUhomoYHTrS0zR43MBbkG3A4

Tell an encrypted token from a signed one

A JWE has five segments rather than three and its payload is ciphertext, so there is nothing to decode without the recipient’s private key. The page says so instead of reporting a malformed JWT.

Token
eyJhbGciOiJSU0EtT0FFUCIsImVuYyI6IkEyNTZHQ00ifQ.<encrypted key>.<iv>.<ciphertext>.<tag>
Result
This is a JWE (encrypted token), not a JWS. Its payload cannot be decoded here.

Supported formats

  • JWS compact serialisationThree Base64url segments separated by dots, as issued by OAuth 2.0 and OpenID Connect providers such as Auth0, Keycloak, Cognito, Firebase and most API gateways. Both the header and the payload must decode to JSON objects.
  • Tokens with their wrappingA full Authorization: Bearer header line, a token in quotes from a JSON response and a token broken across lines by a terminal all decode as pasted.
  • HMAC secretsHS256, HS384 and HS512 take the shared secret as UTF-8 text, or as base64url when the issuer stores it that way — tick the box so the bytes match what signed the token.
  • Public keys for asymmetric algorithmsRS256/384/512, PS256/384/512, ES256/384/512 and EdDSA (Ed25519) take the issuer’s public key as an SPKI PEM block, a single JWK, or a whole JWKS document from the issuer’s jwks_uri, in which case the key whose kid matches the token header is used.

Use cases

  • Debug a 401 from an APIDecode the token the client actually sent and compare exp, aud and scope with what the API expects. Most rejected tokens are expired, issued for a different audience or missing a scope, and all three are visible in the payload.
  • See what an identity provider puts in a tokenPaste an ID token from Auth0, Cognito, Keycloak or Firebase to learn which claims it carries, how roles or groups are named and how long it lives, before writing the code that reads them.
  • Confirm a key rotationVerify a freshly issued token against the new JWKS to prove the issuer has switched keys, and an older token against the previous key to see that it still validates until it expires.
  • Assess a token found in a log or bug reportRead its subject, issuer and lifetime without sending it anywhere, then treat it as a leaked credential and revoke it if the expiry is still in the future.

Limitations

  • Decoding is not trustThe header and payload can be read and edited by anyone holding the token. Only a signature verified against the issuer’s key proves the claims are genuine, and the page only verifies when you give it that key.
  • Encrypted tokens stay closedA JWE carries its payload as ciphertext. Opening one needs the recipient’s private key, which should never be pasted into a web page, so the decoder identifies a JWE and stops there.
  • A valid signature is not an authorisation decisionVerification shows the token was signed by the key you supplied. Whether that issuer is trusted and the audience is your service is for your application to decide, and the page labels an expired token rather than refusing it.
  • Algorithms follow the browserVerification runs on the browser’s Web Crypto implementation. Ed25519 needs a browser that supports the curve, and algorithms outside RFC 7518, such as ES256K, are not supported.
  • It cannot mint or sign tokensThere is no private-key input and no signing step: the page reads and checks tokens, it does not create them.

Frequently asked questions

How do I decode a JWT?

Paste the token into the box. It is split on its dots and the header and payload are Base64url-decoded and pretty-printed immediately, with the registered claims labelled and timestamps rendered as readable dates. No key or secret is needed to read a token — only to verify it.

Is decoding a JWT the same as verifying it?

No, and conflating the two is a serious security bug. Decoding just Base64-decodes text that anybody holding the token can read and edit. Verifying checks the signature against the issuer’s key, which is what proves the claims have not been tampered with. Never trust a claim from a token your server has not verified.

Why does my JWT have three parts separated by dots?

A JWT is header.payload.signature. The header names the signing algorithm and key, the payload carries the claims, and the signature covers the first two so any change to them invalidates it. The first two parts are only Base64url-encoded, not encrypted — anyone with the token can read them.

What do the exp, iat, nbf, iss, aud and sub claims mean?

They are the registered claims from RFC 7519: iat is when the token was issued, nbf the earliest moment it may be accepted, and exp when it expires, all as Unix timestamps in seconds. iss identifies the issuer, aud the intended recipient and sub the subject, usually the user ID. Each one is labelled and its dates spelled out here.

Why does the signature not verify with my secret?

Usually the algorithm and the key do not match. An HS256 token needs the shared secret exactly as bytes, including any trailing newline your editor added, while an RS256 or ES256 token needs the issuer’s public key in PEM form, not the private key and not a certificate fingerprint. A token copied with a line break or a missing final character will also fail.

Is it safe to paste a real token here?

The token never leaves your browser — it is decoded locally and no request is made. Still treat any live token as a password: it grants whatever access it represents until it expires, so avoid pasting production tokens on a shared or managed machine, and revoke or let expire anything you have handled loosely.