DevToolbox

How to Decode a JWT (and Why You Should Never Trust an Unverified One)

By Editorial team · 2026-06-14

In short: A JWT is three Base64URL-encoded parts (header.payload.signature) joined by dots. You can decode the header and payload to read them — they are encoded, not encrypted — but decoding proves nothing about authenticity. Only verifying the signature with the issuer's key tells you the token is genuine and untampered, and that check belongs on your server, never in the browser.

A JSON Web Token (JWT) is a compact, URL-safe way to carry signed claims between two parties — most often between an authentication server and your API. If you have ever inspected an Authorization: Bearer ... header and seen a long string with two dots in it, that is a JWT. This guide shows you how to read one, what each part means, and the single most important security rule: decoding is not verifying.

You can paste any token into our JWT decoder to follow along — it runs entirely in your browser and never transmits your token.

What are the three parts of a JWT?

A signed JWT (technically a JWS) has exactly three parts separated by dots:

eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIxMjMiLCJleHAiOjE3ODA0MDB9.Qm9iSXNNeUF1bnQ
└──── header ────┘ └──────── payload ────────┘ └─ signature ─┘
PartWhat it holdsEncoding
HeaderThe signing algorithm (alg) and token type (typ)Base64URL JSON
PayloadThe claims — data about the user and tokenBase64URL JSON
SignatureA keyed hash of header.payloadBase64URL bytes

The first two parts are just Base64URL-encoded JSON. They are not encrypted. Anyone who has the token can decode and read them, which is the whole point of this article.

How do you decode a JWT by hand?

To decode the header or payload manually:

  1. Split the string on the dots into three pieces.
  2. Take the first piece (header) or second piece (payload).
  3. Base64URL-decode it. Base64URL is standard Base64 with +-, /_, and the = padding removed.
  4. Read the resulting JSON.

Because Base64URL drops padding, you may need to re-add = characters until the length is a multiple of four before a standard Base64 decoder will accept it. If you would rather not do this in your head, the JWT decoder handles the padding and pretty-prints the JSON for you, and our Base64 encode/decode tool explains the alphabet difference in detail.

What do the standard JWT claims mean?

The payload is a set of claims. Some are registered (standardised in RFC 7519); the rest are application-defined. The most common registered claims:

ClaimNameMeaning
issIssuerWho created and signed the token
subSubjectWho the token is about (usually a user id)
audAudienceWho the token is intended for
expExpirationReject after this Unix time (seconds)
nbfNot beforeReject before this Unix time
iatIssued atWhen the token was created
jtiJWT IDUnique identifier, useful for revocation lists

The time claims (exp, nbf, iat) are Unix timestamps in seconds. If you want to translate one into a human-readable date, drop it into the Unix timestamp converter.

Why should you never trust an unverified JWT?

Here is the part developers get wrong. Decoding the payload tells you what the token claims, but a token is trivial to fabricate or edit because the payload is plain Base64URL. The only thing standing between a real token and a forged one is the signature.

Verification means:

If you skip verification and act on a decoded claim like "role": "admin", an attacker can simply edit that claim and re-encode the payload. Real-world classes of attack make this concrete:

Because signature verification needs your secret or private key, it must happen server-side. Never paste a signing secret into a web page, and never verify in client-side JavaScript that ships the key to the browser.

Decode vs. verify at a glance

DecodeVerify
What it doesReads header + payloadConfirms authenticity + integrity
Needs a key?NoYes (secret or public key)
Proves the token is genuine?NoYes
Where to do itAnywhere (browser is fine)Server only
ToolJWT decoderYour backend auth library

Practical checklist

Sources

Frequently asked questions

Is decoding a JWT the same as verifying it?

No. Decoding only reverses the Base64URL encoding so you can read the header and payload. Verifying recomputes the signature with the secret or public key and confirms the token was issued by who it claims and has not been altered. Always verify before trusting any claim.

Can anyone read the data inside a JWT?

Yes, unless the token is a JWE (encrypted JWT). A standard signed JWT (JWS) only encodes its payload in Base64URL, so anyone holding the token can read every claim. Never put secrets such as passwords or full card numbers in a JWT payload.

Is it safe to paste a JWT into an online decoder?

A purely client-side decoder that runs in your browser and sends nothing to a server is safe for inspection. As a habit, avoid pasting live production tokens into tools you do not control, because a leaked valid token can be replayed until it expires.

What does the exp claim mean?

exp is the expiry time as a Unix timestamp in seconds. After that instant the token should be rejected. Related time claims are iat (issued-at) and nbf (not-before, the earliest time the token is valid).

Related articles

Last updated: 2026-06-14