JWT Generator — Sign JWTs with HS / RS / PS / ES Algorithms
Create signed JSON Web Tokens with HS256/384/512 (HMAC), RS256/384/512 (RSA), PS256/384/512 (RSA-PSS), or ES256/384/512 (ECDSA). Paste a raw secret, a PEM private key, or a JWK — signing runs entirely in your browser via the Web Crypto API.
Last updated:
CommentsSet your header, payload claims, algorithm, and secret above to generate a signed JWT (HS256/384/512). Signing uses the Web Crypto API in your browser — the secret never leaves your device.
Uses a shared string secret. Fast, symmetric — same secret verifies. Recommended: 32+ random bytes for HS256, 48+ for HS384, 64+ for HS512.
Recommended: 32+ random bytes for HS256, 48+ for HS384, 64+ for HS512.
Security: the secret / private key is processed locally in your browser via the Web Crypto API. Never paste production keys into online tools you don’t fully trust — including this one.
What is JWT Generator?
A JWT (JSON Web Token) is a compact, URL-safe token that carries signed claims between parties. This generator builds and signs tokens with HMAC-SHA algorithms (HS256, HS384, HS512): you provide the claims and a shared secret, and it produces the three dot-separated Base64URL segments — header, payload, and signature. It's ideal for creating test tokens for local development, API testing, and learning how JWTs are structured.
How to generate a signed JWT
- 1Choose an algorithm (HS256 is the common default).
- 2Edit the payload to include your claims — sub, exp, iat, and any custom fields.
- 3Enter your signing secret (a shared string for HMAC algorithms).
- 4Copy the generated token and use it as a Bearer token in Authorization headers.
Use Cases
Create test tokens for local dev
Generate a valid signed token to test protected endpoints without spinning up your full auth server.
Reproduce auth bugs
Craft a token with specific claims or an expired exp to reproduce and debug authorization edge cases.
Learn JWT structure
See exactly how header, payload, and signature combine — great for understanding the format hands-on.
Code Examples
Payload claims
{
"sub": "1234567890",
"name": "Ada",
"iat": 1516239022,
"exp": 1516242622
}Token shape
header.payload.signature
eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIxMjM0In0.SIGNATUREKey Concepts
- Registered claims
- Standard fields: iss (issuer), sub (subject), aud (audience), exp (expiry), iat (issued-at), nbf (not-before). Use them for interoperability.
- HMAC vs RSA/ECDSA
- HS256/384/512 use one shared secret for both signing and verification. RS256/ES256 use a private/public key pair — better when many parties must verify but not sign.
- exp (expiration)
- A Unix timestamp after which the token is invalid. Always set a short exp for access tokens to limit blast radius if leaked.
Tips & Best Practices
- ▸Use secrets of at least 32 bytes for HS256, 48 for HS384, and 64 for HS512 — shorter secrets weaken the signature.
- ▸Never put sensitive data in the payload: it's Base64URL-encoded, not encrypted, and anyone can read it.
- ▸Always set exp. Tokens without expiry are a common security finding.
- ▸Generate test tokens only with throwaway secrets — never paste production signing keys into any web tool.
Frequently Asked Questions
Which JWT algorithms are supported?
All four families defined in RFC 7518: HS256/384/512 (HMAC with shared secret), RS256/384/512 (RSA PKCS#1 v1.5 with private key — most common in enterprise SSO), PS256/384/512 (RSA-PSS, modern replacement for RS*), and ES256/384/512 (ECDSA with P-256/P-384/P-521). Same RSA key material works for both RS* and PS*; different EC curves are required for each ES* variant.
What key format should I paste?
For HS*, paste the raw shared secret string. For RS*/PS*/ES*, paste a private key in either PEM PKCS#8 (-----BEGIN PRIVATE KEY-----) or JWK JSON format. Legacy openssl 'RSA PRIVATE KEY' PKCS#1 format is not accepted — convert it with `openssl pkcs8 -topk8 -nocrypt -in old.pem -out new.pem`. Need a fresh key pair? Try our RSA or ECDSA Key Generator.
Is my secret / private key sent to any server?
No. All signing happens in your browser using the Web Crypto API (crypto.subtle.sign). Neither the header, payload, secret, nor private key leaves your device. You can verify this in your browser's DevTools Network panel — no request is made when the token is generated.
When should I use ES256 vs RS256?
ES256 produces much smaller signatures (64 bytes vs ~256 bytes for RS256) and is faster to sign. Prefer ES256 for new systems, especially anywhere bandwidth or storage matters (browser cookies, mobile apps, service-to-service tokens). Stick with RS256 for legacy interop where the verifier only supports RSA. PS256 is a drop-in modernization of RS256 with better security properties, but still uses RSA keys.
How should I choose an HS* secret?
Use at least 32 random bytes for HS256, 48 for HS384, and 64 for HS512. Anything shorter than the digest size weakens the security guarantee. Use a cryptographically random source (openssl rand -base64 32 or crypto.getRandomValues), not a memorable phrase.
Try Next
AES Encrypt / Decrypt
Encrypt and decrypt text with AES (128 / 192 / 256, GCM authenticated or CBC legacy) using a password. PBKDF2 key derivation with 200,000 iterations. 100% local — the Web Crypto API runs entirely in your browser.
Related Tools
JWT Decoder
Decode JSON Web Tokens (JWT) to inspect the header, payload, and signature. Runs entirely in your browser — tokens are never sent to any server.
Hash Generator
Generate MD5, SHA-1, SHA-256, and SHA-512 hashes of any text online. Free, no signup — all hashing runs entirely in your browser via the Web Crypto API, so nothing is uploaded.
HMAC Generator
Compute HMAC signatures with SHA-1, SHA-256, SHA-384, or SHA-512 online. Verify API requests, sign webhooks, and authenticate messages. Free, no signup — signing runs locally via the Web Crypto API, secrets never leave your browser.
HMAC-SHA256
Compute HMAC-SHA256 signatures with any secret key. Outputs hex, base64, and base64url encodings. Verify a signature against an expected value in one click. Used by AWS SigV4, JWT HS256, Stripe / GitHub / Slack webhooks. 100% local via Web Crypto API.
Bcrypt Generator
Generate and verify bcrypt password hashes online. Configurable cost factor (4–15), shows computation time so you can pick a cost matching your server hardware. Parses and displays hash version and cost from any pasted hash. 100% local — passwords never leave your browser.
HMAC-SHA1
Compute HMAC-SHA1 signatures with any secret key. Outputs hex, base64, and base64url. Still used by OAuth 1.0, AWS S3 signature v2, and some older webhook schemes. 100% local via Web Crypto API.