JWT Token Generator

Build and sign RFC 7519 JSON Web Tokens locally in your browser using Web Crypto HMAC (HS256, HS384, HS512) with registered and custom JSON claims.

No uploadsNo sign-upInstant results
HS256 · HS384 · HS512 · noneQuick Claims (iat / exp / jti)100% Local • Zero Uploads
Create & Sign JWT
Offline engine ready100% private in-browser workspace • Zero cloud uploads
100% Private • Zero Server File Uploads

Why Use Utiliome's Free JWT Token Generator?

Built from the ground up for strict privacy, instant execution, and zero friction. No subscriptions, paywalls, or account registrations required.

In-Browser Web Crypto HMAC Signing

Computes HS256, HS384, and HS512 JWS signatures locally via SubtleCrypto so test secrets and claim payloads never leave your machine.

RFC 7519 Registered & Custom Claims

Configure standard iss, sub, aud, exp, nbf, iat, and jti fields alongside nested custom JSON claims, RBAC role arrays, and OAuth2 scopes.

Strict Unpadded Base64URL Serialization

Serializes UTF-8 JSON headers, payloads, and binary MAC tags using the RFC 4648 URL-safe alphabet with trailing padding stripped per RFC 7515.

Deterministic Auth & Edge-Case Fixtures

Mint active, backdated, expired, or future-dated nbf tokens on demand to test API gateway middleware, clock-skew leeway, and authorization rules.

Utiliome vs Traditional Cloud Alternatives

Compare our local-first WebAssembly engine against legacy cloud tools.

Feature Utiliome (Local Browser) Legacy Cloud Converters
Supported JWS Signing Algorithms Native Web Crypto signing for HS256, HS384, HS512, and unsigned alg: "none" test tokens Single HS256 option with broken Base64 padding on non-ASCII claims
Interactive Standard Claim Helpers One-click presets for iss, sub, aud, jti, and relative exp/iat offsets Requires manually calculating Unix timestamps in a separate tab
Secret Key Format Support Sign using plain UTF-8 strings or Base64/Hex-encoded cryptographic keys Plain ASCII secret input only
100% Local Signing Pipeline Mints and signs JWTs entirely inside your browser with zero network requests Sends private signing secrets and payload claims to a remote API server
How it works

How to Use JWT Token Generator in 3 Easy Steps

No software installation required. Everything runs directly inside your web browser.

1

Select HMAC Algorithm & JOSE Header

Choose HS256, HS384, or HS512 to populate the JOSE protected header (alg and typ: JWT), along with any optional header parameters such as kid.

2

Configure Registered & Custom Claims

Set Unix NumericDate timestamps (iat, nbf, exp) and standard identity fields (iss, sub, aud, jti), or paste and upload custom JSON claims.

3

Sign with Secret Key & Copy Token

Enter your shared HMAC secret to generate the cryptographic signature in-browser and copy the compact JWT for Authorization Bearer headers.

How to Build and Sign an RFC 7519 JSON Web Token

Quick Answer: Serialize the JOSE header and JSON claims payload as minified UTF-8 strings, encode each segment using unpadded Base64URL, join them with a period to form the ASCII signing input, compute the HMAC-SHA2 digest using your secret key, and append the Base64URL-encoded signature.

Generating a standards-compliant JWT in JWS Compact Serialization (RFC 7515 Section 3.1) transforms a JOSE header, a JSON claims set, and a symmetric secret key into a three-part string formatted as <header>.<payload>.<signature>.

1. Construct the JOSE Header and API Claims Payload

Start with an HS256 protected header and a JSON payload combining RFC 7519 registered claims (iss, sub, aud, iat, exp) with custom application claims (role):

{
  "alg": "HS256",
  "typ": "JWT"
}
{
  "iss": "https://auth.example.com",
  "sub": "usr_9481",
  "aud": "api.example.com",
  "iat": 1767225600,
  "exp": 1767229200,
  "role": "admin"
}

Here 1767225600 represents 2026-01-01T00:00:00Z and 1767229200 represents 2026-01-01T01:00:00Z (a 1-hour token lifetime).

2. Build the Unpadded Base64URL Signing Input

Each JSON object is minified to UTF-8 bytes without extra whitespace, encoded with Base64URL (- and _ alphabet, = padding stripped), and joined with an ASCII period (.):

eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJodHRwczovL2F1dGguZXhhbXBsZS5jb20iLCJzdWIiOiJ1c3JfOTQ4MSIsImF1ZCI6ImFwaS5leGFtcGxlLmNvbSIsImlhdCI6MTc2NzIyNTYwMCwiZXhwIjoxNzY3MjI5MjAwLCJyb2xlIjoiYWRtaW4ifQ

3. Reproducible HMAC-SHA256 Signing Vector

Web Crypto imports your secret bytes via crypto.subtle.importKey("raw", secretBytes, { name: "HMAC", hash: "SHA-256" }, false, ["sign"]) and signs the exact ASCII <base64url-header>.<base64url-payload> bytes. You can verify deterministic parity across OpenSSL, Node.js crypto, Python PyJWT, and this generator using the canonical HS256 test vector with UTF-8 secret your-256-bit-secret:

{
  "sub": "1234567890",
  "name": "John Doe",
  "iat": 1516239022
}

Signing the {"alg":"HS256","typ":"JWT"} header and the payload above with your-256-bit-secret always yields this exact 147-character token, ready for an HTTP Authorization: Bearer <token> header or round-trip verification in JWT Decoder & Inspector:

eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c

JWS HMAC Signing Pipeline, Claim Semantics, and Key Entropy Rules

Quick Answer: RFC 7518 mandates that HMAC signing keys match or exceed the hash output length: at least 256 bits (32 bytes) for HS256, 384 bits (48 bytes) for HS384, and 512 bits (64 bytes) for HS512. Weak ASCII passphrases leave symmetric JWTs vulnerable to offline brute-force dictionary attacks.

Implementing or testing JWT issuance requires strict adherence to RFC 7515 (JWS), RFC 7518 (JWA), and RFC 7519 (JWT) byte-level rules.

Exact JWS Signing Input and Binary Digest Encoding

Per RFC 7515 Section 5.1, the JWS signature is computed over the ASCII bytes of the Base64URL-encoded segments, never over raw JSON strings:

SigningInput = ASCII(BASE64URL(UTF8(Header))) || '.' || ASCII(BASE64URL(UTF8(Payload)))
Signature    = BASE64URL(HMAC_SHA2(SecretKeyBytes, SigningInput))

Two serialization nuances affect cross-language interoperability:

  1. Binary Digest vs Hex String: HMAC_SHA2 outputs raw binary bytes (32 bytes for HS256, 48 bytes for HS384, 64 bytes for HS512). You must Base64URL-encode those raw bytes directly (yielding 43, 64, or 86 characters respectively), not an intermediate lowercase hexadecimal string.
  2. JSON Serialization Determinism: While RFC 8259 JSON objects are unordered key-value maps, JWS signs the exact UTF-8 byte sequence serialized at creation time. Re-ordering keys or pretty-printing whitespace alters the Base64URL payload and produces a completely different signature.

HMAC Algorithm Sizing & Brute-Force Resistance (RFC 7518 Section 3.2)

  • HS256 (SHA-256, 512-bit internal block): 256-bit (32-byte) digest, 43-char Base64URL signature. Minimum 32-byte CSPRNG secret.
  • HS384 (SHA-384, 1024-bit internal block): 384-bit (48-byte) digest, 64-char Base64URL signature. Minimum 48-byte CSPRNG secret.
  • HS512 (SHA-512, 1024-bit internal block): 512-bit (64-byte) digest, 86-char Base64URL signature. Minimum 64-byte CSPRNG secret.

Because every client holding a JWT possesses both the plaintext signing input (<header>.<payload>) and the resulting MAC tag, an attacker can test candidate secrets entirely offline at millions of hashes per second without triggering API rate limits. Always generate secrets from a cryptographically secure random number generator rather than human-memorable words.

RFC 7519 Section 4.1 Registered Claim Types

  • iss (Issuer) & sub (Subject): Case-sensitive StringOrURI identifying the authority that minted the token and the principal (user ID or service account) it represents.
  • aud (Audience): Case-sensitive StringOrURI or JSON array of StringOrURI values identifying intended recipients. Per RFC 8725, resource servers must validate aud to stop a valid token issued for Service A from being replayed against Service B.
  • exp (Expiration), nbf (Not Before) & iat (Issued At): NumericDate values in Unix epoch seconds (Math.floor(Date.now() / 1000)).
  • jti (JWT ID): Unique case-sensitive token identifier (such as a UUIDv4) used for revocation denylists and one-time replay prevention.

JWT Generator vs JWT Decoder vs HMAC Generator: Choosing the Right Tool

Quick Answer: Use JWT Token Generator to build and sign new three-part RFC 7519 Bearer tokens from JSON claims. Use JWT Decoder & Inspector to parse and verify existing JWTs, or use HMAC Generator when you need raw hex or Base64 keyed-hash signatures for webhook payloads like Stripe or GitHub.

Although all three utilities rely on browser-native Web Crypto hashing, each targets a distinct protocol format and stage of API engineering.

Feature JWT Token Generator (This Tool) JWT Decoder & Inspector HMAC Generator
Primary Goal Author JSON claims and mint a signed JWT Decode, inspect timestamps, and verify an existing JWT Compute a standalone keyed-hash MAC over arbitrary input
Input Required Header alg + JSON claims + secret key Compact three-part JWT + optional secret key Raw text or JSON message + secret key
Output Format Three-part Base64URL JWT (<header>.<payload>.<signature>) Decoded JSON header/payload, expiry status, validity check Standalone hexadecimal or Base64 digest string
Governing Spec RFC 7519 (JWT) & RFC 7515 (JWS) RFC 7519 (JWT) & RFC 7515 (JWS) RFC 2104 (HMAC) & FIPS 198-1
Ideal Use Case Creating Bearer tokens for local API & middleware tests Troubleshooting 401 errors, OIDC ID tokens, and TTLs Verifying webhook X-Hub-Signature-256 or API request MACs

After minting a test fixture here, you can paste the resulting token into JWT Decoder & Inspector to simulate downstream verification and inspect how its exp and nbf countdowns behave.

FAQ

JWT Token Generator FAQ and Technical Guide

Everything you need to know about using Utiliome's free online jwt generator.

What is the minimum secret key length required for HS256, HS384, and HS512?

RFC 7518 Section 3.2 mandates that an HMAC key must have a size greater than or equal to the hash output length: at least 32 bytes (256 bits) for HS256, 48 bytes (384 bits) for HS384, and 64 bytes (512 bits) for HS512. Strict backend libraries such as Nimbus JOSE+JWT, jjwt, and PyJWT throw weak-key exceptions or warnings if you supply shorter ASCII strings.

Why does my custom HS256 code produce an 86-character signature instead of 43 characters?

An 86-character HS256 signature happens when code converts the 32-byte HMAC-SHA256 digest into a 64-character hexadecimal string first and then Base64URL-encodes those 64 ASCII characters. RFC 7515 requires Base64URL-encoding the raw 32 binary bytes directly, which always produces exactly 43 unpadded Base64URL characters.

When should I choose symmetric HMAC (HS256) over asymmetric RSA or ECDSA (RS256 or ES256)?

Use symmetric HS256, HS384, or HS512 when the same trusted backend service (or local test harness) both signs and verifies the token, since both operations share a single secret key and execute with minimal CPU overhead. When multiple downstream microservices or third-party clients need to verify tokens without gaining the power to mint new ones, use asymmetric ES256, RS256, or EdDSA where only the identity provider holds the private signing key.

How should I format exp, nbf, and iat timestamps when generating a JWT?

Format exp, nbf, and iat as numeric Unix epoch seconds (for example, 1767225600), never as quoted ISO 8601 date strings and never as 13-digit JavaScript milliseconds. For a 15-minute access token, set iat to the current epoch time in seconds and set exp to iat + 900.

Can I generate expired or future-dated JWTs to test API error handling?

Yes. Unlike production OAuth2 servers that only issue currently valid tokens, this client-side generator lets you deliberately set exp in the past or nbf in the future. That makes it straightforward to write deterministic integration tests confirming that your auth middleware rejects expired or premature tokens with 401 Unauthorized while honoring configured clock-skew leeway.