Skip to content

JWT Decoder & Encoder

Decode a JWT to read its header and claims, verify its signature with a secret or public key, and sign new tokens with HS, RS, PS and ES algorithms.

Mode

Signature not verified. The contents below are decoded only. Enter the secret under Verify signature to check it.

Expiry: 20 Nov 2286, 17:46:39 UTC.

Payload
sub
1234567890
name
Jane Doe
iat
1700000000 (14 Nov 2023, 22:13:20 UTC)
exp
9999999999 (20 Nov 2286, 17:46:39 UTC)
Header
alg
HS256
typ
JWT
Verify signature

The key is used in your browser to check the signature and is not sent to our server. The sample token is signed with the secret sample-secret.

Signature

FJSZYB9O5aGXpYIwbbvfIJcUsv1vXdymaPoKja3slJk

01 · Definition

What is a JWT?

A JSON Web Token (JWT) is a compact, signed piece of JSON used to pass claims such as a user ID and an expiry time between systems. It has three base64url parts separated by dots: a header naming the signing algorithm, a payload of claims, and a signature. Anyone can read the first two; only the signature proves who issued them.

02 · Overview

How the JWT Decoder & Encoder works

Paste a JSON Web Token to see its header and payload, with exp, iat and nbf shown as UTC times and a note on whether the token has expired. Enter the shared secret, or a public key as PEM, X.509 certificate or JWK, to check the signature for HS256/384/512, RS256/384/512, PS256/384/512 and ES256/384/512. The tool says valid, invalid or not verified, and never reports a signature as valid without checking it. Encode mode signs a payload with the same algorithms. Decoding, verifying and signing run in your browser with the jose library; tokens and keys are not sent to our server.

03 · Guide

Decoding a JWT vs verifying it

Decoding is base64url-decoding the header and payload. It needs no key and proves nothing: anyone can write a payload and encode it. Verifying recomputes the signature over the header and payload with a key and compares it with the third part of the token. Only a verified token can be trusted.

This tool separates the two. Without a key it shows the claims and labels the signature as not verified. With a key it reports the signature as valid or invalid. Expiry is reported on its own line, because a token can be correctly signed and expired at the same time.

04 · Guide

HS256 vs RS256 vs ES256

The alg header names how the token was signed. HMAC algorithms use one shared secret to sign and verify. RSA and ECDSA algorithms sign with a private key and verify with the public key, so services that only check tokens never hold a key that could mint them.

algTypeKey to signKey to verify
HS256, HS384, HS512HMAC with SHA-2Shared secretThe same secret
RS256, RS384, RS512RSA PKCS#1 v1.5RSA private keyRSA public key
PS256, PS384, PS512RSA-PSSRSA private keyRSA public key
ES256, ES384, ES512ECDSA (P-256, P-384, P-521)EC private keyEC public key
Signature algorithms this tool can sign with and verify

05 · Use cases

When to use the JWT Decoder & Encoder

  1. 01

    Debug a 401 by reading the token your client is sending

  2. 02

    Check a token's signature against your secret or your identity provider's public key

  3. 03

    See when a token expires in UTC

  4. 04

    Sign a test token with a known secret for local development

06 · Examples

JWT Decoder & Encoder examples

eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkphbmUgRG9lIiwiaWF0IjoxNzAwMDAwMDAwLCJleHAiOjk5OTk5OTk5OTl9.FJSZYB9O5aGXpYIwbbvfIJcUsv1vXdymaPoKja3slJk

ex 01

alg: HS256, typ: JWT · sub: 1234567890, name: Jane Doe, iat: 1700000000 (14 Nov 2023, 22:13:20 UTC), exp: 9999999999 (20 Nov 2286, 17:46:39 UTC)

The sample token the tool opens with. Without a key the signature is labelled not verified.

The sample token, with the secret sample-secret

ex 02

Signature valid (HS256)

The token was signed with that secret. Any other secret, or any change to the header or payload, gives Signature invalid.

A token whose exp is 1735689600

ex 03

Expired, on 1 Jan 2025, 00:00:00 UTC

exp is Unix seconds. The tool shows the UTC time and how long ago the token expired.

Encode: payload {"sub":"alex"}, HS256, secret supersecret

ex 04

eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhbGV4In0.…

A signed token, re-signed as you edit. A button sets iat to now and exp to one hour later.

07 · FAQ

JWT: frequently asked questions

Is it safe to paste a JWT here?

The token is decoded and verified by JavaScript in your browser and is not sent to our server; the same applies to any secret or key you enter. A JWT that is still valid is a credential, so the cautious habit with any online tool is to use test tokens, or revoke a production token after inspecting it.

How do I verify a JWT signature?

Paste the token, then enter the key under Verify signature. For HS256, HS384 or HS512 that is the shared secret, as text or base64. For RS, PS and ES algorithms paste the public key as PEM (BEGIN PUBLIC KEY), an X.509 certificate, a JWK or a JWKS. The tool reports Signature valid or Signature invalid. Until a key is entered it says the signature is not verified.

How is decoding different from verification?

Decoding reads the base64url header and payload and needs no key. Verification checks the signature with a key. A decoded but unverified token tells you what it claims, not whether the claims are genuine.

What is the difference between HS256 and RS256?

HS256 is HMAC with SHA-256: one shared secret both signs and verifies. RS256 is an RSA signature: a private key signs and the matching public key verifies. Use RS256 or ES256 when the services that verify tokens should not be able to issue them.

Why does my token say expired?

The exp claim is a Unix timestamp in seconds. If it is earlier than the current time the token has expired and verifiers should reject it. The tool shows exp, iat and nbf as UTC times and how long ago or how far ahead they are. Expiry is reported separately from the signature result.

Can I edit a payload and re-sign it?

Yes. Switch to Encode, edit the payload JSON, choose the algorithm and enter the secret, or a PKCS#8 PEM private key for RS, PS and ES algorithms. The token is re-signed as you type.

Does it support encrypted JWTs (JWE)?

No. It handles signed tokens (JWS), which have three parts. A five-part token is an encrypted JWE; the tool recognises it and says it cannot be decoded here.

08 · Guides

JWT guides

09 · Reference

Specs and further reading

These are the primary sources this tool follows. Where a specification defines the behaviour, we link the specification, not a summary of it.

10 · More

Tools that pair with JWT

Last updated .