JWT Generator

Sign a test JWT with HS256, HS384 or HS512 from your own claims and secret.

Header

Payload

Keep your secret key safe. Never expose it publicly.

JWT Structure

  • Header: Contains the algorithm and token type information
  • Payload: Contains claims (user data, expiration, etc.)
  • Signature: Generated from Header + Payload + Secret

The tool writes the header and payload as Base64URL and signs them with HMAC through the browser's Web Crypto API, so your secret and claims never leave the page.

In Form mode, enter 42 as sub, set the expiry to 30 minutes, and use + Add Claim for level / 3. The payload comes out as {"sub":"42","iat":1795000000,"exp":1795001800,"level":3}. The iat is the second you pressed Generate JWT, and exp is that plus 1,800 seconds. The sub, iss and aud boxes always produce strings, while an added claim value is parsed as JSON when it can be, so 3 becomes a number and true a boolean.

Expired tokens and array audiences

Form mode only sets an exp in the future. For an already expired token, or "aud": ["web","app"], switch to JSON mode and write the claims yourself. The header is fixed to your algorithm and typ: JWT, so there is no kid.

Generate Random draws 32 bytes and shows them as 64 hex characters. The signature uses that string as UTF-8 text, so a server that decodes the key from hex will compute a different signature. If signing fails, check that the page is open over https. Only HS256, HS384 and HS512 are supported, not RS256.