Utvikling · verktøy

JWT-dekoder

Lim inn en JWT for å undersøke den lesbare overskriften og nyttelasten i nettleseren.

Kjøres i nettleseren. Ingen opplasting.

Decoding does not verify a token or its signature.

Header
—
Payload
—

Om verktøyet

JWT-dekoder sem complicação.

Dette verktøyet dekoder data, men verifiserer ikke en signatur eller beviser at et token er pålitelig. Ikke lim inn hemmeligheter på en delt enhet.

Veiledning

Slik bruker du JWT-dekoder

The JWT Decoder opens a JSON Web Token in your browser and shows its header and payload as readable JSON. It splits the token at the dots and decodes the first two parts. It does not check the signature, so it cannot tell you whether a token is genuine, unexpired or trustworthy. Use it to read what a token says, not to approve it.

Slik gjør du

  1. Paste the token into the box. It should have three parts separated by dots, with no spaces inside. Spaces or line breaks at the start or end are trimmed.
  2. Press Decode token. The header and payload appear as indented JSON in the two boxes below.
  3. Read fields such as the algorithm, the subject and the time claims. Time values are shown as raw numbers, so convert them yourself if you need dates.
  4. Press Clear to empty the input and both outputs before you paste another token.

Eksempler

A made-up token with an expiry

Du skriver inn
Token
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJkZW1vLXVzZXItMSIsIm5hbWUiOiJEZW1vIFVzZXIiLCJpYXQiOjE3MDAwMDAwMDAsImV4cCI6MTcwMDAwMzYwMH0.c2lnbmF0dXJlLXBsYWNlaG9sZGVy
Du får
Header
Algoritme: HS256; Type: JWT
Payload
Subjekt: demo-user-1; Navn: Demo User; Utstedt ved: 1700000000; Utløper: 1700003600

The first two parts are base64url text that decodes to JSON. The last part is a placeholder signature and is not read. The number 1700003600 is a Unix time in seconds, which equals 2023-11-14 23:13:20 UTC; the tool shows only the number.

Kjørt med verktøyets egen kode.

A token with no signature

Du skriver inn
Token
eyJhbGciOiJub25lIiwidHlwIjoiSldUIn0.eyJzdWIiOiJ4In0.
Du får
Header
Algoritme: none; Type: JWT
Payload
Subjekt: x

A trailing dot still gives three parts, the last one empty, so the tool decodes it without complaint. It shows that decoding accepts tokens a server should refuse, which is why decoding proves nothing.

Kjørt med verktøyets egen kode.

Wrong shape

Du skriver inn
Token
abc.def
Du får
Melding
Could not decode this JWT: A JWT must have three dot-separated parts.

Only two parts were found, so no decoding is tried. A token with five parts, like an encrypted JWE, is rejected the same way. If a part is not valid base64url or not JSON, the message comes from the browser and its wording can vary.

Kjørt med verktøyets egen kode.

Når det er nyttig

  • Check which claims an identity provider put in a test token while debugging a login flow.
  • Read the algorithm in the header to see what a token claims to use.
  • Confirm that a sample token from documentation contains the fields you expect.
  • Teach how a JWT is built from header, payload and signature parts.

Begrensninger

  • Decoding does not verify the signature, the issuer, the audience or the expiry. A decoded token is not proof of anything.
  • Only the first two parts are read. The signature part is never decoded or checked.
  • Time claims such as exp and iat appear as raw numbers. The tool does not turn them into dates or say if a token has expired.
  • A leading word such as Bearer is not removed, so paste only the token itself.

Tips

  • As general security advice, avoid pasting real production tokens into any web page, even one that works locally. Use a test token when you can.
  • Treat any token you decode as readable by everyone who sees it, since the payload is only encoded, not secret.
  • Verify tokens in your server code with a trusted library and the right key, never by reading a decoded view.

Kilder

Vanlige spørsmål

Sobre JWT-dekoder.

Does decoding a JWT verify it?

No. Decoding only reverses the base64url encoding to show the JSON. Checking that a token is genuine needs the signature to be verified with the right key, and this tool does not do that step.

Is the payload of a JWT secret?

No. In a standard signed token the payload is only encoded, so anyone holding the token can read it. Do not put passwords or other secrets in a token you plan to share.

Is my token uploaded?

The page says it runs in your browser with no upload, and the decoding code only reads the text locally. Even so, a general rule is to keep real production tokens out of any online tool.

What are the three parts of a JWT?

They are the header, the payload and the signature, joined by dots. The header names the algorithm, the payload holds the claims, and the signature lets a server check the first two parts.

Why does it say my token cannot be decoded?

Common causes are a wrong number of dots, a stray space or prefix such as Bearer, missing characters, or parts that are not valid base64url JSON. Copy the token again and paste only the token.

Can it read an encrypted token?

No. An encrypted JWT has five parts, and this tool accepts only three. Even for three-part tokens it only shows data that is encoded, not encrypted.

How do I read exp and iat?

They are NumericDate values: seconds since 1970-01-01 UTC. The tool shows the raw number, so convert it with a time tool. Comparing it to the current time shows whether the token has expired.

Hvordan bruker du JWT-dekoder?

Lim inn en JWT for å undersøke den lesbare overskriften og nyttelasten i nettleseren.

Lastes dataene mine opp til en server?

Nei. Behandlingen skjer i nettleseren din, og opplysningene dine lastes ikke opp.