What does the JWT Expiry Checker & TTL Duration Countdown do?
The JWT Expiry Checker & TTL Countdown decodes JSON Web Tokens (JWT) client-side to evaluate security timeframe claims (exp, iat, nbf). It calculates the remaining validity duration (Time-To-Live), runs an active real-time countdown timer, displays visual lifespan timeline progress bars, and detects clock skew desynchronization issues.
Core Concepts
Understanding JWT expiration and lifecycle claims:
- Expiration Time (
exp): The epoch timestamp (in seconds) after which the token must not be accepted for authentication. - Issued At (
iat) & Not Before (nbf): Define the token's creation timestamp and earliest allowable usage threshold. - Time-To-Live (TTL): The dynamic remaining lifespan (
exp - currentTime) indicating seconds left before session expiration. - Clock Skew Detection: Identifies whether tokens were issued in the future relative to the client clock, signaling server NTP desynchronization.
How to use the tool?
- Enter JWT: Paste your encoded
Header.Payload.SignatureJWT token into the text area or click Load Sample Token. - Execute Analysis: Click Analyze Token Validity to decode payload claims and calculate lifespan metrics.
- Inspect Claims: Review the live countdown status, timeframe parameters (
iat,nbf,exp), timeline progress bar, and raw payload JSON.
Related Developer Utilities
If you work with JWT authentication, Base64 encodings, and web security tokens, explore these complementary tools:
- JWT Token Decoder: Decode and format JWT header and payload claims into JSON.
- Base64URL to Base64 Converter: Convert URL-safe Base64 strings to standard Base64.
- Base64 to Base64URL Converter: Convert standard Base64 payloads into URL-safe strings.
- JSON Syntax Validator: Validate and inspect JSON payload structures.
REST API Integration
Blueutils provides a free REST API endpoint (POST https://blueutils.com/api/jwt/jwt-expiry-checker) to programmatically decode JSON Web Tokens and extract expiration timestamps.
API Request Parameters
| Name | Type | Description | Example |
|---|---|---|---|
rawToken |
String | Encoded header.payload.signature JWT string. |
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." |
API Request Payload Examples
cURL
curl -X POST https://blueutils.com/api/jwt/jwt-expiry-checker \
-H "Content-Type: application/json" \
-d '{
"rawToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiZXhwIjoxNzczNjYzMDAwfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"
}'Python
import requests
url = "https://blueutils.com/api/jwt/jwt-expiry-checker"
payload = {
"rawToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiZXhwIjoxNzczNjYzMDAwfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())Java
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) throws Exception {
String jsonPayload = """
{
"rawToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiZXhwIjoxNzczNjYzMDAwfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"
}
""";
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://blueutils.com/api/jwt/jwt-expiry-checker"))
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(jsonPayload))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}API Response Parameters
| Name | Type | Description | Example |
|---|---|---|---|
isValid |
Boolean | Indicates whether token decoding succeeded. | true |
exp |
Number | Expiry Unix timestamp (in seconds). | 1773663000 |
iat |
Number | Issue Unix timestamp (in seconds). | 1773659400 |
isExpired |
Boolean | Whether token expiration exceeds current time. | false |
remainingDuration |
Number | Seconds remaining until token expires. | 3600 |
payload |
Object | Decoded JWT payload claims dictionary. | { "sub": "123", "exp": 1773663000 } |
API Response Payload Examples
Success Response (HTTP 200 OK)
{
"isValid": true,
"exp": 1773663000,
"iat": 1773659400,
"nbf": null,
"nowSeconds": 1773659400,
"isExpired": false,
"isNotYetValid": false,
"isClockSkewed": false,
"totalDuration": 3600,
"elapsedDuration": 0,
"remainingDuration": 3600,
"payload": {
"sub": "1234567890",
"name": "John Doe",
"exp": 1773663000
}
}Validation Failure Response (HTTP 400 Bad Request)
{
"isValid": false,
"error": "Target token does not contain an \"exp\" (Expiration Time) claim payload."
}Rate Limit Exceeded Response (HTTP 429 Too Many Requests)
{
"error": "API rate limit exceeded. Please wait or contact support@blueutils.com."
}Why use an API to check JWT expiration?
Integrating the JWT Expiry Checker API into gateway routers, test automation scripts, or AI agent tool calling provides key benefits:
- Rapid Script Validation: Verifies bearer token lifespans before dispatching API calls to prevent avoidable 401 Unauthorized errors.
- Optimized Token Efficiency for AI Agents: LLMs frequently miscalculate Unix epoch durations and relative seconds. Calling the API computes remaining TTL and clock skew deterministically without token consumption.
- Deterministic Accuracy Without Hallucinations: Ensures 100% accurate Base64URL decoding and epoch timestamp comparison.
Native Usage
How to inspect JWT expiration locally in terminal environments or scripts:
Windows (CMD / PowerShell)
# Decode JWT payload and check exp in PowerShell
$token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwiZXhwIjoxNzczNjYzMDAwfQ.sig"
$parts = $token.Split('.')
$base64 = $parts[1].Replace('-', '+').Replace('_', '/')
$base64 = $base64.PadRight($base64.Length + (4 - $base64.Length % 4) % 4, '=')
$json = [System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($base64))
$payload = ConvertFrom-Json $json
Write-Output "Expires at epoch: $($payload.exp)"Linux / Unix (Bash)
# Decode JWT payload and check exp using jq in Linux
token="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwiZXhwIjoxNzczNjYzMDAwfQ.sig"
echo "$token" | cut -d'.' -f2 | base64 -d 2>/dev/null | jq .expPython
Using Python:
import base64
import json
import time
token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwiZXhwIjoxNzczNjYzMDAwfQ.sig"
payload_b64 = token.split('.')[1]
payload_b64 += '=' * (-len(payload_b64) % 4)
payload = json.loads(base64.urlsafe_b64decode(payload_b64))
remaining = payload['exp'] - int(time.time())
print(f"Token expires in {remaining} seconds.")Java
Using Java:
import java.util.Base64;
public class JwtExpiryExample {
public static void main(String[] args) {
String token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwiZXhwIjoxNzczNjYzMDAwfQ.sig";
String payloadJson = new String(Base64.getUrlDecoder().decode(token.split("\\.")[1]));
System.out.println("Payload: " + payloadJson);
}
}