JWT Decode Guide: How to Read JWT Tokens Online

JWT token decoding explained: header, payload, and signature overview

Need to jwt decode a bearer token and see what is inside? A JWT is three Base64URL segments joined by dots. Anyone can read the header and payload without a key. This guide explains the structure, the difference between decoding and verifying, and how to inspect tokens safely with our free JWT Decoder.

3

Token Parts

0 Keys

Needed To Decode

RFC 7519

JWT Standard

100%

Local Browser Decode

What is a JWT and why decode it?

A JSON Web Token (JWT) is a compact, URL-safe string defined in RFC 7519. Apps use JWTs for OAuth access tokens, session cookies, API authorization headers, and service-to-service auth. Decoding is useful when you need to debug claims, check expiration, confirm the algorithm, or inspect what a client is sending.

Diagram of JWT header, payload, and signature with Base64URL decode versus signature verification

Figure 1: Decoding reads header and payload. Verification needs a secret or public key.

JWT structure: header, payload, signature

Every compact JWT looks like header.payload.signature. Each part is Base64URL-encoded (URL-safe Base64 using - and _, usually without = padding).

Important: Base64URL is encoding, not encryption. Anyone who has the token can decode jwt contents. Never put passwords, API keys, or unredacted secrets in JWT claims. Use JWE if you need confidentiality.

Decode vs verify: methods compared

People often confuse reading a token with trusting a token. Use the right approach for the job:

Approach What It Does Needs Key? Best For
Online JWT Decoder (client-side) Base64URL-decodes header and payload in the browser No (decode) Quick inspection and HMAC checks with a test secret
CLI / Node one-liner Decodes locally in your terminal No (decode) Scripts, CI logs, offline debugging
Server JWT library Verifies signature and validates claims Yes Production auth decisions
Server-side web debugger May upload your token to a remote host Depends Avoid for production tokens

Method 1: Decode JWT online with the free JWT Decoder (easiest)

The fastest way to decode jwt online without installing anything is our free JWT Decoder & Verifier. Decoding runs in your browser. Tokens are not sent to our servers.

Steps:

  1. Open the tool and stay on the Decode tab.
  2. Paste your JWT into the JWT Token field (or use the sample token to explore the UI).
  3. Header and payload decode automatically. Check the formatted JSON and claim explanations (alg, exp, iat, sub, and more).
  4. Optionally enter a Signing Secret to verify HS256, HS384, or HS512 signatures. RS256/ES256 need a public key and should be verified in your backend.
  5. Review expiration status badges, then copy a Permanent Link if you need to share the same decoded view with a teammate (prefer test tokens).

Treat production tokens like credentials. Prefer test tokens. Even with local processing, shared machines, screen shares, and browser extensions can expose session data.

Method 2: Decode a JWT from the command line

When you want everything offline, decode locally with tools you already have.

Node.js one-liner (payload)

node -e "const t=process.argv[1]; console.log(JSON.parse(Buffer.from(t.split('.')[1], 'base64url').toString()))" 'YOUR_JWT_HERE'

jq pipeline (header and payload)

echo 'YOUR_JWT_HERE' | jq -R 'split(".") | .[0],.[1] | gsub("-";"+") | gsub("_";"/") | @base64d | fromjson'

These commands only decode. They do not prove the token is authentic. For production verification, use a maintained library such as jose (Node), firebase/php-jwt (PHP), or your framework's auth stack, with an explicit algorithm allow-list.

Method 3: Decode in the browser console

For a quick one-off check on a non-production token already in DevTools:

JSON.parse(atob(
  'YOUR_JWT_HERE'.split('.')[1]
    .replace(/-/g, '+')
    .replace(/_/g, '/')
));

Note: atob expects standard Base64. Convert Base64URL characters as shown. Padding may be required for some tokens. Prefer a dedicated decoder when segments are long or Unicode-heavy.

Tips and common mistakes

Related free tools

Frequently Asked Questions

How do I decode a JWT online safely?

Use a client-side jwt decoder that processes the token in your browser and does not upload it to a server. Prefer test tokens. Treat any production JWT like a password because it can grant API or session access.

Does decoding a JWT require a secret key?

No. Header and payload are Base64URL-encoded JSON. Anyone with the token can decode them. A secret or public key is required only to verify the signature.

What is the difference between decoding and verifying a JWT?

Decoding reads the claims. Verifying recomputes the signature with the issuer key and confirms the token was not tampered with. Authentication decisions must always verify, not only decode.

Why does my JWT fail to decode?

Common causes are missing dots, truncated copy/paste, invalid Base64URL characters, or non-JSON header/payload content. A valid compact JWT has exactly three parts separated by dots.

Can an online decoder steal my signing secret?

The signing secret is never inside the JWT, so decoding alone cannot reveal it. The real risk is exposing the token itself (a usable credential) or pasting an HMAC secret into an untrusted verifier. Keep production secrets server-side.

JWTs are readable by design. Decode to inspect claims, verify on the server before you trust them, and keep secrets out of payloads. When you need a quick, private look at a token, open the free JWT Decoder above and paste a test token to explore header, payload, and expiry in seconds.