JWT Decoder

Paste a JWT to instantly see its decoded header, payload, and expiration status.

Encoded Token

Header

Payload

Decode a JWT and Inspect Its Claims

This free online tool decodes a JSON Web Token (JWT) and shows its header, payload, and expiration status in plain, readable JSON — no library, backend, or account required. Paste a token from an Authorization: Bearer header, a session cookie, or an API response, and see exactly what claims it carries.

A signed JWT is a JWS (JSON Web Signature) in compact form, header.payload.signature, so this decoder shows the header and payload of any JWS whose header and payload are JSON objects.

How It Works

  • Paste your token into the box above, or click Sample to try an example JWT.
  • Header and payload are decoded automatically as you type and shown as formatted JSON.
  • Registered claims like exp, iat, and nbf are converted to human-readable dates automatically.
  • Status badge tells you at a glance whether the token's exp claim has already passed.
  • Copy the decoded header or payload independently with one click.

Decode Only — No Signature Verification

This tool decodes the header and payload segments only; it does not verify the signature. A JWT's signature can only be verified with the issuer's secret or public key, and doing that safely requires knowing exactly which service issued the token — this tool is for quickly inspecting claims during development and debugging, not for authenticating a token in production. To create a test token, or to check a signature against a key you hold, use the JWT Encoder and Verifier.

Privacy

Decoding happens entirely in your browser using JavaScript. Your token is never uploaded to a server — which matters, since a JWT's payload is only base64-encoded, not encrypted, and often contains user identifiers or other data you don't want to send to a third party.

JWT Decoder — How It Works

A JWT is three base64url-encoded segments separated by dots: a header, a payload, and a signature. Here's what this tool does with each part.

Header Decoding

The first segment is base64url-decoded and parsed as JSON, revealing the signing algorithm (alg) and token type (typ), shown as badges above the output panels.

Payload Decoding

The second segment holds the token's claims — the actual data, such as a user ID, roles, or an expiration time. It's decoded and pretty-printed just like the header. If a claim's value is itself a stringified JSON object (you'll see escaped quotes like \" in the output), paste that value into the JSON Escape / Unescape tool to turn it back into readable text.

Expiration Detection

If the payload includes an exp claim (a Unix timestamp), this tool compares it against the current time and labels the token as expired or not expired. The signature is not checked, so this says nothing about whether the token is genuine.

UTF-8 Safe Decoding

Base64url segments are decoded byte-by-byte and converted with a proper UTF-8 decoder, so claims containing non-ASCII characters (names, addresses, emoji) render correctly instead of as garbled text.

Who Uses This Tool?

Backend Developers

Quickly inspect the claims inside an access or ID token returned by an auth service (Auth0, Firebase, Cognito, custom OAuth servers) while debugging an integration.

Frontend Developers

Check what's actually inside a token stored in localStorage or a cookie — confirm the expected claims and expiration are present before wiring up API calls.

QA & Security Testing

Verify that a token issued during a test run contains the expected roles, audience, and expiration — without writing a throwaway decoding script.

Students & Learners

See exactly how a JWT is structured while learning about token-based authentication, alongside the JWT explainer article.

Why Decode a JWT in the Browser?

A JWT sent in an Authorization: Bearer header is a credential, not just data: anyone who holds an unexpired token can call the API as that user. Its payload usually carries a user ID and often an email address, roles or a tenant name. Pasting a live token into a decoder that processes it on a server hands both the credential and that data to a third party, and it can end up in their request logs.

This decoder works differently. It base64url-decodes the two segments with the browser's own atob and TextDecoder, parses them with JSON.parse and writes the result into the page. The decoder script (js/jwt-decoder.js) contains no fetch, XMLHttpRequest, WebSocket or sendBeacon call, and it does not store the token: the only thing it saves in localStorage is the dark-mode setting. Decoding the example tokens below in a test browser made no network request. To check it yourself, open your browser's DevTools, switch to the Network tab, clear it and paste a token: nothing new appears when the token is decoded.

Browser-side decoding lowers the risk but does not remove it. Treat a token that grants access to production as a secret: when you only need to see the claim layout, use an expired or test token, and revoke or rotate any token you suspect has leaked. Because decoding is not verification, seeing a claim here never proves the token is genuine.

JWT Decoder Examples: Decoded, Expired and Rejected Tokens

Each example below was run through this page in Chromium and the output copied from what the page displayed. The tokens are made-up test tokens. Dates in the Registered Claims table use your browser's time zone and locale; the dates below are what a browser set to UTC and en-US showed.

Example 1: an HS256 token (the Sample button)

Click Sample, or paste this token into the box above:

eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyLCJleHAiOjE4OTM0NTYwMDB9.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c

The badges read Algorithm: HS256, Type: JWT and, in green, Status: Not expired (signature not checked). The Header panel shows:

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

The Payload panel shows:

{
  "sub": "1234567890",
  "name": "John Doe",
  "iat": 1516239022,
  "exp": 1893456000
}

The Registered Claims table lists only the registered claims it knows, with the raw number after each date. Here that is Subject 1234567890, Issued At 1/18/2018, 1:30:22 AM (1516239022) and Expires At 1/1/2030, 12:00:00 AM (1893456000); the custom name claim appears only in the Payload panel. The sample expires on 1 January 2030, after which its badge turns red. Its signature segment was made for a version of this payload without the exp claim (checked with HMAC-SHA256), so it would not verify against this payload, and the decoder ignores the signature anyway.

Example 2: an expired token

eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJodHRwczovL2F1dGguZXhhbXBsZS50ZXN0Iiwic3ViIjoidXNlci00MiIsImF1ZCI6WyJ3ZWIiLCJhcGkiXSwiaWF0IjoxNzAwMDAwMDAwLCJleHAiOjE3MDAwMDM2MDB9.2y7weBEQVY8cUgxmxOPEYD0Yv5bTDIrQ9AqJC3IoDOo

Its payload is:

{
  "iss": "https://auth.example.test",
  "sub": "user-42",
  "aud": [
    "web",
    "api"
  ],
  "iat": 1700000000,
  "exp": 1700003600
}

The status badge turns red and reads Status: Expired (signature not checked). The Registered Claims table shows Issuer https://auth.example.test, Subject user-42, Audience web, api (an array is joined with commas), Issued At 11/14/2023, 10:13:20 PM (1700000000) and Expires At 11/14/2023, 11:13:20 PM (1700003600).

The badge only compares exp with your computer's clock, so a wrong system clock gives a wrong badge. It only runs when exp is a number: "exp": "1700000000" (a string) gives Status: No Expiration Claim. A nbf (not before) claim is shown as a date but is not evaluated; a token whose nbf is in the future and whose exp has not passed still reads Not expired. A token with "alg": "none" and an empty signature (header.payload.) decodes like any other and the badge reads Algorithm: none; that only means the token is unsigned, not that it is acceptable.

Example 3: tokens the decoder rejects, and the text it shows

When a token cannot be decoded, the page clears both panels and shows one message in the red box under the input. These are the messages for common mistakes:

Messages shown for invalid input
What you pastedMessage shown
Example 2 with its signature removed (2 parts)That doesn't look like a JWT — expected 3 dot-separated parts (header.payload.signature), found 2.
An encrypted JWE token (5 parts), such as eyJhbGciOiJSU0EtT0FFUCIsImVuYyI6IkEyNTZHQ00ifQ.LHDhK3oGRvkiefQnx7OOczTY5Tic_xZ6.CrMGgjA1Zhu426Ic.-NyzQwjlxp9GozyvpivZIkdrGMc.KhBzpuZ_Dl8JpZV8ZZUDxgThat doesn't look like a JWT — expected 3 dot-separated parts (header.payload.signature), found 5.
A header segment of an impossible length, such as eyJhbCould not decode the header segment: Invalid base64url segment
A payload that is valid JSON but not an object, such as null: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.bnVsbA.c2ln. A header that decodes to null, an array or a plain value gets a similar message that says "header segment" and what was found, for example "found an array".Could not decode the payload segment: expected a JSON object but found null.
A payload that decodes to plain text, eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.aGVsbG8gd29ybGQ.c2lnCould not decode the payload segment: Unexpected token 'h', "hello world" is not valid JSON
A JWS with a detached (empty) payload, header..signatureCould not decode the payload segment: Unexpected end of JSON input
Example 2 with Bearer in front of itCould not decode the header segment: Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.

The wording after the colon in the last three rows (the JSON parser and base64 errors) comes from your browser, not from this tool, so other browsers may phrase it differently. If you see the Bearer message, delete the Bearer prefix and paste only the token. The JWE row is the "expected 3 dot-separated parts" case: an encrypted token cannot be read without the key, so there is nothing for a decoder to show.

One input does not produce an error although it is malformed: a segment that is not valid UTF-8. The decoder converts the bytes with a non-strict UTF-8 decoder, so an invalid byte becomes the replacement character. This token's payload is {"name":"José"} with the é written as the single Latin-1 byte 0xE9 instead of UTF-8:

eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoiSm9z6SJ9.c2ln

It decodes without an error, and the Payload panel shows "name": "Jos�", where U+FFFD is the Unicode replacement character. If you see that character in a decoded claim, the issuer did not encode the token as UTF-8.

Frequently Asked Questions

What is a JWT?

A JSON Web Token (JWT) is a compact, URL-safe way to represent claims between two parties — commonly used for authentication and authorization. It consists of a header, payload, and signature, each base64url-encoded and joined with dots.

Does this tool verify the signature?

No. This tool only decodes the header and payload so you can read the claims. Verifying a signature requires the issuer's secret (HS256) or public key (RS256/ES256), which this tool intentionally does not ask for.

Is a JWT encrypted?

No — a standard JWT's header and payload are only base64url-encoded, not encrypted. Anyone who has the token can decode and read its contents, which is exactly what this tool demonstrates. Never put secrets in a JWT payload.

Can I decode a JWS or an encrypted JWE token?

You can decode a JWS in compact form, header.payload.signature, as long as its header and payload are JSON objects; a signed JWT is exactly that. An encrypted JWE token has five dot-separated parts and a ciphertext payload that cannot be read without the key, so this tool stops with: "That doesn't look like a JWT — expected 3 dot-separated parts (header.payload.signature), found 5." A JWS whose payload is detached (empty) or is not a JSON object is rejected with a "Could not decode the payload segment" message.

Why does it say my token is expired?

The tool compares the payload's exp claim (a Unix timestamp in seconds) against the current time. If exp is in the past, the token is flagged as expired — this is a client-side check only and doesn't affect the real token.

Is my token uploaded anywhere?

No. All decoding happens locally in your browser with JavaScript. Nothing is sent to a server, which matters since JWT payloads often contain user identifiers or other data you don't want to expose to a third party.

What does the "expected 3 dot-separated parts" error mean?

A valid JWT always has exactly three segments — header, payload, and signature — separated by two dots. If your input has a different number of parts, it isn't a complete JWT (it may be truncated, or it might not be a JWT at all). The message ends with the number of parts it found: 2 often means the signature was cut off, and 5 means an encrypted JWE token.

Related Tools

Built by Deepak Kumar — a developer who wanted a JSON tool that respects your privacy. All processing happens in your browser. Your data never leaves your device.