Skip to content
BetterPass logo

OIDC ID Token Decoder & Verifier

Decode an OIDC ID Token (or a URL-encoded id_token_hint), auto-fetch the provider's JWKS to verify the RSA signature (RS256/384/512), and run a documented aud → iss → exp → nbf → nonce → sig validation checklist — all in your browser.

Decode / Verify
Paste a token to decode; add a JWKS URL or JWK to verify the signature.
Keys load automatically when a URL is entered.

What is OIDC ID Token?

An OIDC ID Token is a signed JWT issued by an OpenID Connect provider (like Google, Auth0, or Keycloak) that contains claims about an authenticated user. It is the core artifact of the OIDC protocol — your app receives it after a user successfully logs in.

Standard claims include sub (subject/user ID), iss (issuer), aud (audience), exp (expiration), iat (issued at), and optionally nonce (replay protection).
Always signed — typically RS256 (RSA + SHA-256); RS384 and RS512 are also supported. You verify it with the provider's public key.
Not an access token — ID Tokens prove who the user is; access tokens grant API access. A token carrying at_hash or azp is an ID Token; a token carrying a scope claim is likely an access token. Don't confuse them.

Zero-Server Tool Data Guarantee

All decoding, JWKS fetching, and signature verification happens entirely in your browser using the Web Crypto API. Your tokens and keys are never sent to any server — the only network request is the JWKS fetch from the URL you choose to enter.

How to Use

01

Paste Your ID Token

Input the OIDC ID Token (JWT) you want to inspect. Decoding is debounced, so it runs a moment after you stop typing.

02

Decode a URL-Encoded id_token_hint

Enable the 'id_token_hint' checkbox for URL-encoded tokens from logout requests. Percent-encoded hints are also auto-detected when pasted directly.

03

Add the Signing Key

Paste a JWKS URL and the keys load automatically, or switch to Manual and paste a JWK. The key matching the token's kid is used for RS256/384/512 verification.

04

Set Expected Values

Fill in the expected issuer, audience, and nonce to activate those checks in the validation checklist.

05

Review the Checklist

The documented validation order (aud → iss → exp → nbf → nonce → sig) is shown as a live checklist, with at_hash/azp/scope detection for ID vs access token identification.

Common Use Cases

Post-Login Debugging

Paste an ID Token right after login to inspect claims, confirm the issuer/audience, validate the nonce, and verify the signature before trusting it in your app.

Token Validation Debugging

Diagnose why a token is being rejected — check audience mismatch, issuer mismatch, expiration, or a nonce failure in seconds.

Integration Testing

Quickly verify that your OIDC provider is issuing correctly structured tokens with the expected claims.

Logout / id_token_hint Debugging

Decode a URL-encoded id_token_hint from your logout redirect to confirm which session the provider should terminate.

ID vs Access Token Auditing

Spot at_hash, azp, and scope claims to determine whether a captured token is an ID Token or an access token during a security review.

Security Auditing

Manually inspect tokens from production logs (redacted) to confirm claim values during a security review.

Implementation Examples

JavaScriptFetch JWKS & Verify (jose)
// Install: npm install jose
import * as jose from 'jose';
const issuer = 'https://accounts.google.com';
const audience = 'your-client-id';
const nonce = 'f47ac10b-58cc-4372-a567-0e02b2c3d479'; // what you sent in auth request
const { keys } = await fetch(issuer + '/.well-known/jwks.json')
.then(r => r.json());
const { payload } = await jose.jwtVerify(
token,
await jose.createLocalJWKSet({ keys }),
{ issuer, audience }
);
// Nonce validation — replay protection
if (payload.nonce !== nonce) throw new Error('Nonce mismatch');
console.log(payload.sub); // user ID

ID Token vs Access Token vs Refresh Token

PropertyID TokenAccess TokenRefresh Token
PurposeProve user identityAccess protected APIsGet new access tokens
FormatJWT (always)JWT or opaqueJWT or opaque
Contains user infoYes (claims)RarelyNo
LifespanMinutes (5-15 min)Minutes to hoursDays to months
Stored where?Secure memory / httpOnly cookieMemory / httpOnly cookiehttpOnly cookie only
Sent to APIs?NoYes (Authorization header)No

Production Best Practices & Security

Always verify the signature — a decoded token without signature verification is just untrusted data. Why:Without verification, an attacker could forge their own "ID Token" with fake user details and gain access to your application.
Fetch JWKS dynamically — use the provider's /.well-known/jwks.json endpoint and cache keys with proper rotation handling. Why:Providers rotate their signing keys periodically for security; this tool fetches and matches keys by kid automatically.
Validate the issuer (iss) — ensure the token was issued by the provider you expect, not a malicious actor. Why:This prevents "Issuer Confusion" attacks where a malicious OIDC provider issues a valid token that your app mistakenly accepts.
Check the audience (aud) — confirm your client_id is in the audience to prevent token misuse across apps. Why:If an attacker gets an ID token intended for another app, audience validation prevents them from using it to log into your app.
Validate the nonce — compare the token's nonce to the value you sent in the authorization request. Why:A mismatched or absent nonce means a replay attack is possible.
Enforce expiration (exp) and not-before (nbf) — reject expired or early tokens server-side. Why:Expired tokens are a security risk; once a token expires, the user must re-authenticate to prove they still have access.
Follow the documented validation order — aud, iss, exp, nbf, nonce, then signature (the final gate). Why:Ordering makes failures diagnosable and covers the same claims compliant libraries validate, with the signature as the final gate.
Don't store ID Tokens in localStorage — use httpOnly cookies or secure in-memory storage to prevent XSS theft. Why:LocalStorage is accessible by any JavaScript running on your page. If your site has an XSS vulnerability, attackers can steal your users' tokens instantly.

How the OIDC Authorization Code Flow Works

OIDC authorization code flowFour steps: the user opens the app, the app redirects to the provider, the provider returns an authorization code, and the app exchanges it for an ID Token.1User / BrowserOpens your app andclicks Sign in2Your AppRedirects to the provider'slogin page3OIDC ProviderUser signs in; providerreturns an auth code4Your AppExchanges code + secretfor an ID Token
  1. User opens your app and clicks Sign in.
  2. Your app redirects the browser to the provider's login page.
  3. After the user signs in, the provider redirects back with an authorization code.
  4. Your app exchanges the code (with its client secret) and receives an ID Token — the JWT this tool decodes.

Frequently Asked Questions

An OpenID Connect (OIDC) ID Token is a signed JWT that your identity provider issues after authenticating a user.

It contains claims defined by the OpenID Connect specification: sub (the user's unique identifier), iss (the issuer URL), aud (the intended client application), exp (expiration time), and optionally nonce, email, name, and picture.

Unlike an access token (which authorizes API access), the ID Token is specifically for your client application to authenticate the user. You must verify it by validating the signature using the issuer's public keys from the JWKS endpoint.