API Toolkit

JWT Generator

All tools

Mint a test token with exactly the claims you need for a local API or unit test.

How it works

Four simple steps

1

Set the subject

Enter the sub claim for the token.

2

Add claims

Write extra claims such as exp or role as JSON.

3

Choose signing

Enter a secret for HS256 or leave it empty for alg none.

4

Generate

Press Run, then copy or download the token.

JWT Generator

About JWT Generator

You are writing integration tests for an endpoint that checks a role claim, and the identity provider is not available in the test environment. A locally signed HS256 token with a known secret and hand-picked claims lets the tests run without it.

Enter the subject in the sub field, add other claims as a JSON object (exp, aud, iss, role, tenant and so on) and optionally type a secret. Press Run to build the token. The payload always gets an iat set to the current Unix time, and your JSON claims are merged on top, so you can override sub or iat there when you need fixed values. With a secret, the header is HS256 with typ JWT and the signature is computed with Web Crypto. Without one, alg is none and the token ends with an empty signature segment.

No exp is added unless you include it, and tokens that never expire are a classic finding in security reviews, so add an exp claim holding a Unix timestamp a few minutes ahead; the timestamp converter gives you that number. Unsigned alg none tokens are only for demonstrations. A correctly configured verifier rejects them, which also makes them a useful negative test. Confirm what you built with JWT Verify and the same secret.

Tokens are assembled and signed in your browser and can be downloaded as token.jwt. Use test secrets here, never production signing keys.

Keyboard shortcut

Ctrl Enter - Run tool
FAQ

Frequently asked questions

See all FAQs

Answers for this tool. For site-wide help, open the FAQ hub.

No. Only HS256 is available, because asymmetric signing needs a private key that should not be pasted into a web page. Generate those tokens with your identity provider or a script.

The iat claim is set to the current second on each run, which changes the payload and therefore the signature. Put a fixed iat in the extra claims JSON if you need a reproducible token.

Not from the form. The header contains only alg and typ. If your verifier selects keys by kid, build those test tokens in code with a JWT library.

View more FAQs

Related tools

View all

Webhook HMAC Signer

Sign and verify GitHub, Stripe, and Slack webhook signatures locally.

Open

Webhook Replay Diff Lab

Compare webhook payload timelines, re-check HMAC digests, and spot idempotency gaps locally.

Open

JSONPath Playground

Query JSON with JSONPath and JMESPath-style paths side by side.

Open

GraphQL Studio

Format, validate, and cost-estimate GraphQL documents with cURL export.

Open

Explore 321 free tools

Everything you need as a developer, marketer or creator - in one beautiful place.

Browse all tools