JWT Sign

Sign JSON Web Tokens (JWT) with various algorithms including HMAC and RSA for secure authentication.

This tool lets you craft and sign JSON Web Tokens (JWTs) using HMAC algorithms — HS256, HS384, and HS512 — directly in your browser. Paste your header and payload, supply a shared secret, and get a compact, cryptographically signed token ready for use in authentication flows or API access control. Because all signing is performed client-side via WebAssembly, your secret key and token payload are never transmitted to any server, making this safe to use with real credentials during development and testing.

  • API Auth During Development — Developers generate signed HS256 tokens on the fly to test protected API endpoints without spinning up an auth service.
  • Learning JWT Structure — Security students inspect how the header, payload, and signature combine into a compact dot-separated token by experimenting with different claims and secrets.
  • Custom Claims Prototyping — Backend engineers prototype JWT payloads with custom claims (roles, tenant IDs, scopes) before committing the shape to code.
  • Debugging Auth Failures — Teams recreate exact token conditions — specific expiry, issuer, or subject values — to reproduce and diagnose token validation errors in staging.
  • CI/CD Test Fixtures — QA engineers sign tokens with known secrets to create deterministic test fixtures for integration tests that require authenticated requests.

How It Works

1

Configure Token Payload

Enter your JWT header and payload data, including claims like user ID, expiration time, and custom fields.

2

Choose Signing Algorithm

Select the signing algorithm (HS256, RS256, etc.) and provide the appropriate secret key or private key.

3

Generate Signed JWT

The tool creates a cryptographically signed JWT token that you can use for authentication and authorization.

Frequently Asked Questions

What is a JWT and why sign it?

A JSON Web Token (JWT) is a secure way to transmit information between parties. Signing ensures the token hasn't been tampered with and verifies the issuer's identity.

Which signing algorithm should I use?

HS256 (HMAC) is simpler and uses a shared secret. RS256 (RSA) is more secure for distributed systems as it uses public/private key pairs. Choose based on your security requirements.

Is my secret key secure?

Yes, all JWT signing happens locally in your browser. Your secret keys and private keys never leave your device or get sent to any servers.

What claims should I include?

Common claims include 'sub' (subject/user ID), 'exp' (expiration time), 'iat' (issued at), and 'iss' (issuer). You can also add custom claims specific to your application.

How long should a JWT be valid?

JWT expiration depends on your use case. Short-lived tokens (15-30 minutes) are more secure, while longer-lived tokens (hours/days) are more convenient. Consider using refresh tokens for longer sessions.