JWT Encoder / Decoder

Easily decode, verify, and encode JSON Web Tokens (JWT) directly from your browser.

Signature

Rate this tool

How useful was this tool?

JWT Encoder / Decoder

Paste a JSON Web Token into Token, or load the Example, and it’s decoded at once:

  • the Header and Payload shown as readable JSON
  • every claim explained in a Claims table, with dates converted
  • the token’s expiry shown at a glance
  • the Signature checked, once you give the secret or the key

It works the other way round too. Edit the header or the payload and the token is re-signed as you type, with a secret or a key. For key-based algorithms you can generate a key pair on the spot.

Everything happens in your browser with the Web Crypto API. No token, secret or key is sent anywhere.

Example

eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c

The tool shows it as three parts, 155 bytes, and decodes the first two:

{
  "alg": "HS256",
  "typ": "JWT"
}
{
  "sub": "1234567890",
  "name": "John Doe",
  "iat": 1516239022
}

With the secret your-256-bit-secret, the result reads “Signature verified with HS256.” A second line adds: “No exp claim: the token never expires on its own.”

The Claims table explains each value:

Claim Value Meaning
alg HS256 Signature algorithm
typ JWT Token type
sub 1234567890 Subject: whom the token is about
name John Doe  
iat 1516239022 Issued at

Dates are shown in your own time zone, then in UTC, then relative to now. For a visitor in New York, iat reads Jan 17, 2018, 8:30 PM / 2018-01-18 01:30:22 UTC. It was still the evening of the 17th in New York when it was already the 18th in UTC.

name has no meaning listed, because it isn’t one of the standard claims: the issuer made it up, which JWTs allow.

This is the token from jwt.io’s demo, and its secret is public. That makes it perfect for trying things out, and a reminder never to use a demo secret for real.

What’s inside a JWT

A JWT is three parts, separated by dots:

  1. The header says how the token is signed (alg) and what it is (typ).
  2. The payload holds the claims: who the token is about, who issued it, when it expires, and anything else the issuer adds.
  3. The signature is calculated over the first two parts.

The header and payload are just JSON written in URL-safe Base64, so anyone can read them. You can decode them with Base64 to Text too. Only the signature says who made the token and that nobody changed it.

So never put anything secret in a payload: no passwords, and no personal data you wouldn’t show the user.

The standard claims

Claim Meaning
iss Issuer: who created the token
sub Subject: whom the token is about, usually a user ID
aud Audience: which service the token is meant for
exp Expiration time: after this, the token must be refused
nbf Not before: the token isn’t valid before this time
iat Issued at: when the token was created
jti JWT ID: a unique ID, so a token can be revoked or used only once

Times are Unix timestamps in seconds. For any other timestamp, use the Timestamp Converter.

Expiry at a glance

The line under the token says straight away whether the token can be used right now, based on exp and nbf. Here’s how each case looks to a visitor in New York:

Colour Message
green Valid for another 60 min (expires Oct 28, 2026, 5:40 AM / 2026-10-28 09:40:00 UTC).
amber Not valid yet: usable from Oct 28, 2026, 5:40 AM / 2026-10-28 09:40:00 UTC (in 60 min). That’s an nbf in the future.
amber No exp claim: the token never expires on its own.
red Expired 6 years ago (exp Sep 13, 2020, 8:26 AM / 2020-09-13 12:26:40 UTC).

A token without exp is shown in amber, not green, because a token that never expires works forever if it leaks.

Servers usually allow a minute or so of leeway for clocks that don’t quite agree. So a token that expired seconds ago may still be accepted.

Verifying the signature

Choose the Algorithm in the Signature card. How you verify depends on it:

  • HS256, HS384, HS512 sign with a shared secret. The same secret creates and verifies the signature, so anyone who can verify can also create tokens. Type it under Secret. If the secret is stored in Base64, tick The secret is base64url encoded.
  • RS, PS, ES and EdDSA sign with a private key and verify with the matching public key. The issuer keeps the private key, and everyone else can check tokens with the public one. Paste either into Key. If you paste a private key, the public part is worked out from it.

The families differ in the maths behind them:

Family Uses
RS RSA
PS RSA with the newer PSS padding
ES Elliptic curves, with much shorter keys and signatures
EdDSA The Ed25519 curve, fast and hard to get wrong

Try changing one letter in the payload, say “John” to “Jane”. The signature no longer matches, and the tool says so. That’s exactly what a server checks before it trusts a token.

Building and signing a token

There’s no Sign button: signing happens as you type. Edit the Header or Payload, and the token is re-signed at once. With a secret in place, the green line reads “Token signed with HS256.”

Until there’s something to sign with, the tool says so:

  • “The token is not signed yet: enter a secret.” (HS algorithms)
  • “The token is not signed yet: paste or generate a private key.” (RS, PS, ES and EdDSA)

For the key-based algorithms, Generate a key pair creates one in your browser (“Generating…” while it works). The tool then confirms, for example: “A new RS256 key pair was generated in your browser; the private key is in the Key field and the token is signed with it.”

The matching public key appears under Public key of the generated pair, with its own Copy. Give that to whatever needs to verify your tokens, and keep the private key to yourself.

That’s useful for:

  • testing how an API handles an expired token, a wrong audience or a missing claim
  • creating tokens for local development
  • checking that your own code produces the same token for the same input

The “none” algorithm

The algorithm list also includes none, which produces a token with no signature at all. When a token uses it, or you select it, a red line warns:

alg is “none”: this token carries no signature and proves nothing. Anyone can write one; a verifier must reject it.

It’s there for testing how a server reacts. A real server must never accept one.

Mistakes that make JWTs unsafe

  • Accepting alg: none. A server that trusts the header’s algorithm can be handed an unsigned token and accept it. The server should decide which algorithm it expects, never the token.
  • Algorithm confusion. If a server that expects RS256 also accepts HS256, an attacker can sign a token with HS256 using the server’s public key as the secret. Again, the server must fix the algorithm.
  • Weak HS secrets. An HS256 secret can be guessed offline from any token, as fast as the attacker’s hardware allows. Use at least 32 random bytes, never a word or a demo value like your-256-bit-secret.
  • No expiry. A token without exp works forever if it leaks. Short-lived tokens, minutes rather than days, limit the damage.
  • Secrets in the payload. Anyone holding the token can read it.

Is it safe to paste a token here?

Yes. This page doesn’t send anything anywhere. Decoding, verification, signing and key generation all run in your browser, and nothing is stored.

Still, treat a live token like a password: anyone who has it can use it until it expires. Be careful with tools that send tokens to a server to decode them.

FAQ

What’s the difference between decoding and verifying?

Decoding only reads the header and payload, which anyone can do. Verifying checks the signature with the secret or the public key, and proves who created the token and that it wasn’t changed. Never trust a decoded payload until it’s verified.

Why does it say the signature is invalid?

The usual reasons:

  • the wrong secret or key
  • the base64url encoded setting doesn’t match how the secret is stored
  • an extra space or line break copied with the token
  • the token really was altered

For RS, PS, ES and EdDSA, check that the key belongs to the same key pair the issuer used.

How long should a token last?

As short as the application allows. Access tokens often last 5 to 60 minutes, and a longer-lived refresh token is used to get new ones. The exp claim sets the limit, and the line under the token shows how much time is left.

Is a JWT encrypted?

No. A normal JWT is only signed, not encrypted, and its contents are readable by anyone who has it. Encrypted tokens exist, under the name JWE, but they’re a different format.

Note: All processing is done client-side. We do not store or see your data.

Contact

Missing something?

Feel free to request missing tools or give some feedback using our contact form.

Contact Us