Free JWT Encoder / Generator

Build and sign a JSON Web Token from a header, payload and secret, entirely in your browser.

How to generate a JWT

  1. 1

    Edit the header and payload

    Adjust the JSON in the header and payload boxes — add whatever claims you need in the payload.

  2. 2

    Pick an algorithm and enter a secret

    Choose HS256, HS384 or HS512, and enter the shared secret the token should be signed with.

  3. 3

    Generate and copy

    Click "Generate JWT →" to sign it, then "Copy token" to grab the result.

Example use cases

1

Testing an API locally

Generate a signed token with the claims your backend expects, without spinning up an auth server just to get a token to test with.

2

Debugging signature verification

Sign the same header and payload with a known secret to confirm your server-side verification logic accepts it.

3

Learning how JWTs are built

See exactly how a header and payload turn into the three dot-separated segments of a real token.

Frequently asked questions

How is the token signed?

The header and payload are Base64URL-encoded, joined with a dot, and signed with HMAC (SHA-256, SHA-384 or SHA-512, matching the algorithm you pick) using your secret, via the browser's built-in Web Crypto API.

Does this support RS256 or other asymmetric algorithms?

No, only the HMAC family (HS256/HS384/HS512) is supported, since those only need a shared secret rather than an RSA or EC key pair.

Is my secret sent anywhere?

No. The header, payload and secret never leave your browser — signing happens entirely client-side with the Web Crypto API.

The "alg" in my header doesn't match the algorithm I picked — which one wins?

The algorithm dropdown is what's actually used to sign the token; update the "alg" field in the header text yourself so it matches what you intend to send.

Can I decode a token I already have?

Use the JWT Decoder tool to inspect the header and payload of an existing token — this page is for building and signing a new one.