JWT decoder

Decode the header and payload of a JSON Web Token and show its times, without verifying it.

Input

The JWT to decode. Use a test or expired token, never a live one.
The time to compare "exp" and "nbf" against, as an ISO 8601 time. Adds the "expired" flag. Left out, no comparison is made.

Result

Fill in the input and press Run.

Your input is processed in memory and then discarded. It is not stored or logged. Even so, don't paste live passwords or keys into any online tool.

Use it from code or an agent

curl -s https://setget.net/v1/tools/jwt-decode \
  -H 'Content-Type: application/json' \
  -d '{"input":{"token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"}}'
import json, urllib.request

body = {'input': {'token': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c'}}
request = urllib.request.Request("https://setget.net/v1/tools/jwt-decode", json.dumps(body).encode(),
                                 {"Content-Type": "application/json"})
print(json.load(urllib.request.urlopen(request))["result"])
const response = await fetch("https://setget.net/v1/tools/jwt-decode", {
  method: "POST",
  headers: {"Content-Type": "application/json"},
  body: JSON.stringify({"input":{"token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"}}),
});
console.log((await response.json()).result);
Tool: run_tool
Arguments:
{
  "slug": "jwt-decode",
  "input": {
    "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"
  }
}
{
  "input": {
    "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"
  }
}

Endpoint: POST /v1/tools/jwt-decode. Over MCP: run_tool with slug: "jwt-decode". Machine-readable: input schema, Markdown. Connect an agent.

Inputs

NameTypeRequiredWhat it does
token string yes The JWT to decode. Use a test or expired token, never a live one.
now string no The time to compare "exp" and "nbf" against, as an ISO 8601 time. Adds the "expired" flag. Left out, no comparison is made.

Examples

Input
{
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"
}
Result
{
  "header": {
    "alg": "HS256",
    "typ": "JWT"
  },
  "payload": {
    "sub": "1234567890",
    "name": "John Doe",
    "iat": 1516239022
  },
  "signature": "SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c",
  "algorithm": "HS256",
  "times": {
    "iat": "2018-01-18T01:30:22Z"
  },
  "verified": false
}

Checking expiry against a given time

Input
{
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiI0MiIsIm5iZiI6MTY5OTk5NjQwMCwiZXhwIjoxNzAwMDAwMDAwfQ.c2lnbmF0dXJl",
  "now": "2024-01-01T00:00:00Z"
}
Result
{
  "header": {
    "alg": "HS256",
    "typ": "JWT"
  },
  "payload": {
    "sub": "42",
    "nbf": 1699996400,
    "exp": 1700000000
  },
  "signature": "c2lnbmF0dXJl",
  "algorithm": "HS256",
  "times": {
    "exp": "2023-11-14T22:13:20Z",
    "nbf": "2023-11-14T21:13:20Z"
  },
  "verified": false,
  "now": "2024-01-01T00:00:00Z",
  "expired": true,
  "not_yet_valid": false
}

Questions

Does this verify the signature?
No. It only decodes. A decoded token proves nothing about who made it, so never trust its contents without verifying the signature in your own code.
Is it safe to paste a live token?
No. A valid token works like a password until it expires. Never paste live tokens into any online tool; use an expired or test token.
Is the payload encrypted?
No. The header and payload of a signed JWT are only base64url-encoded, so anyone holding the token can read them.
Why is there no "expired" flag?
The tool never reads the clock. Send the current time as "now" to have "exp" and "nbf" compared against it.