JWT Generator & Decoder

Build a signed JWT, decode one you already have, or check a signature against a secret — all in your browser. Signing uses the browser's own HMAC over exactly the bytes between the dots, so the token matches what a server library would produce byte for byte. Verification takes the algorithm from you rather than from the token, which is the difference between a check and a formality: a token declaring alg "none" is refused outright, and one whose header disagrees with your selection fails with the mismatch named. Signature and claims are reported separately, because a token can be perfectly signed and long expired. Nothing is uploaded — which matters, because a real token is a credential.

The three parts

PartContentsSecret?
HeaderAlgorithm and typeNo — readable by anyone
PayloadYour claims, Base64 onlyNo — readable by anyone
SignatureHMAC over header.payloadProves integrity, hides nothing

When to use it

  1. Build a test token for an API you are developing.
  2. Check why a token your service issued is being rejected.
  3. Read the claims out of a token you were sent.
  4. Confirm a secret matches the signature on a token.
  5. Check whether a token has expired.

How to Use

  1. Pick sign, decode or verify.
  2. Enter your claims or paste a token, and the secret if you need one.
  3. Copy the token, or read the signature and claim results.

Features

  1. Sign with HS256, HS384 or HS512
  2. Decode without a secret
  3. Verify with the algorithm taken from you, not the token
  4. Refuses alg "none"
  5. Names an algorithm mismatch instead of a bare failure
  6. exp, nbf and iat checked against the clock
  7. Signature and claims reported separately
  8. Runs entirely in your browser

FAQs

Is a JWT encrypted?

No, and this is the most common misunderstanding about them. The payload is Base64, not ciphertext — anyone holding the token can read every claim in it without a secret, which this tool demonstrates by decoding without one. The signature proves the token has not been altered; it hides nothing. Never put a secret in a JWT payload.

Why does it refuse alg "none"?

Because that is the classic JWT attack. An unsigned token declares its own algorithm as none, and a verifier that trusts the header dutifully checks nothing and accepts it. Any verifier that accepts one is broken.

Why do I choose the algorithm instead of it reading the header?

For the same reason. If the token picks its own algorithm, an attacker can switch an RS256 token to HS256 and sign it with the public key — which is public. Taking the algorithm from you and reporting a mismatch is what makes the check real.

Why is my signature different from my server's?

Almost always the exact bytes. The signature covers the literal Base64url text, so the same claims in a different key order, or with different whitespace, sign differently. This tool signs exactly the JSON it shows you.

Is RS256 supported?

No. Asymmetric signing means handling a private key, and making that convenient in a web page is not a good idea. HS256, HS384 and HS512 cover testing and debugging.

Is my token or secret uploaded?

No. Everything happens in the page. That matters here more than most places, since a real token is a live credential.

Is the signature valid but the token still rejected?

Check the claims panel. exp in the past, nbf in the future, or an iss or aud the server does not accept will all fail after a perfectly valid signature check — which is why the two are reported separately.

Technical Details

Signing and verification both use the browser's Web Crypto HMAC, over exactly the bytes between the dots. That precision matters more than it sounds: the signature covers the literal Base64url text of the header and payload, so re-serialising a decoded token — even with identical claims in a different key order, or with a space after a colon — produces a different signing input and therefore a different signature. That is the usual reason a hand-built token is rejected by a library that built its own, and it is why this tool signs the exact JSON it shows you. The header is written with `alg` before `typ`, which is the conventional order the reference implementations emit. The security decision in the verifier is where the algorithm comes from: it is taken from the caller, never from the token's own header. Trusting the header is the `alg: none` class of vulnerability — an attacker who can set the algorithm can tell the verifier to check nothing at all, or to treat an RSA public key as an HMAC secret and forge with public information. So a token declaring `alg: none` is refused outright with that explained, and a token whose header disagrees with the algorithm you selected fails with the mismatch named rather than with a bare "invalid signature". Claims are checked separately from the signature and presented that way, because they are a different question: a token can be perfectly signed and long expired. `exp`, `nbf` and `iat` are compared against the current time and shown as absolute timestamps, with `iat` given a minute of tolerance since a token issued slightly in the future is a clock problem rather than a forgery. Decoding works without a secret, because reading a token is not the same as trusting it — and the page says plainly that a JWT payload is Base64, not encryption, so anyone holding the token can read every claim in it. RS256 and the other asymmetric algorithms are not offered: generating and handling a private key in a web page is not something to make convenient.

Security Tools

Security Tools

  • CSP Generator
  • security.txt Generator
  • AES Encryption
  • Bcrypt Hash Generator
  • BIP39 Mnemonic Generator
  • CVSS Calculator
  • CORS Debugger
  • RSA Key Generator