JWT Generator

Generate and sign JSON Web Tokens with custom claims and expiry time. Supports HS256 algorithm.

Frequently Asked Questions

What is the difference between HS256 and RS256?

HS256 uses a shared secret (symmetric). RS256 uses a private/public key pair (asymmetric). RS256 is more secure for distributed systems.

Can I set custom claims in the payload?

Yes, add any JSON data to the Custom Claims field. Common claims: iss (issuer), sub (subject), aud (audience), exp (expiry).

Is this production-ready?

This is a demo tool for testing. For production, use server-side JWT signing with proper cryptographic libraries like jsonwebtoken or jose.

JWT Signing Algorithms

AlgorithmTypeKeyBest for
HS256Symmetric (HMAC)Shared secretSingle-service auth where both sides share the same key
HS384Symmetric (HMAC)Shared secretSame as HS256 with longer hash (384-bit)
HS512Symmetric (HMAC)Shared secretSame as HS256 with longest hash (512-bit)
RS256Asymmetric (RSA)Private/public key pairDistributed systems; token issuer signs, consumers verify
ES256Asymmetric (ECDSA)Private/public key pairLike RS256 but smaller keys/signatures, faster
PS256Asymmetric (RSA-PSS)Private/public key pairStronger padding than RS256; preferred for high-security

How JWT Authentication Works

  1. User logs in — client sends credentials to the auth endpoint.
  2. Server signs a JWT — server validates credentials, creates a payload with sub, exp, and any custom claims, signs it with the secret/private key.
  3. Client stores the JWT — in memory (safest), localStorage, or an HttpOnly cookie.
  4. Client sends JWT with each requestAuthorization: Bearer <token> header.
  5. Server verifies the signature — if valid and not expired, request is authorized.

⚠️ Production Security Warning

This tool is intended for development and testing only. For production applications, always sign JWTs server-side using a well-audited library:

  • jsonwebtoken (Node.js — most popular)
  • jose (Node.js, Web/Edge runtime — fully spec-compliant)
  • PyJWT (Python)
  • java-jwt (Java)
  • golang-jwt/jwt (Go)