Skip to content
IT glossary
SecurityUpdated December 3, 2026

JWT

A JSON Web Token is a compact way to carry claims, such as a user ID or an expiration time. When the token is signed, the receiver can verify who issued it and whether its contents have changed.

Also known as: JSON Web Token

What a JWT tells you

A JWT (JSON Web Token) carries a set of JSON fields called claims. Think of an access token issued for an orders API: it can name the account it represents, identify the intended API, and say when it expires. JWT defines how those claims are packaged. It does not define how someone signs in, how a client obtains the token, or what permissions an API should grant.

What is inside a signed JWT?

The usual compact signed form has three dot-separated segments: header.payload.signature. The header describes the cryptographic algorithm. The payload contains the claims: iss identifies the issuer, sub identifies the subject, aud identifies the intended audience, and exp gives the expiration time in seconds since the Unix epoch. Depending on the algorithm, the last segment is a digital signature verified with a public key or a message authentication code checked with a shared secret.

The header and payload use Base64URL encoding. That makes them easy to transport, not secret: anyone holding a signed token can read its payload without a key. Do not put passwords or other secrets in it. An encrypted JWT uses a different representation, based on JSON Web Encryption (JWE).

Example: validating a token at an API

A client sends Authorization: Bearer <access_token> over HTTPS. The API uses a JWT library with trusted keys and an allowed algorithm configured in advance. It verifies the signature, then checks that the token comes from the expected issuer, is meant for this API, has not expired, and satisfies the other claim requirements for this token type. A token issued for a billing API is not valid at the orders API just because the two APIs trust the same issuer. Even after validation, the orders API still has to check whether this user may edit this particular order.

Where JWTs fit and what they cost

JWT access tokens are useful when multiple services need to validate tokens without calling the issuer on every request. But OAuth 2.0 does not require this format: an access token can also be an opaque string whose meaning is looked up by the backend. In OpenID Connect, an ID token is a JWT that tells the client about an authentication event; it is not a substitute for an API access token.

Local validation also has a trade-off: the claims describe what was true when the token was issued. Deleting a token on logout does not invalidate a copy of it, and a role change does not rewrite a token already in circulation. Short-lived access tokens limit how long stale claims can be accepted. If changes must take effect immediately, the API needs an additional server-side check, such as a revocation list or a lookup of current permissions.

What interviewers look for

Distinguish parsing the token, validating it, and authorizing the request. Saying that a JWT is signed does not explain who is allowed to use it, where it is accepted, or whether its claims still reflect the user's current permissions.