RANA
Web Crypto HMAC Token Signer

JWT Encoder & Token Generator

Construct, sign, and encode JSON Web Tokens (JWT) using HMAC algorithms (HS256, HS384, HS512) with custom claims, expiration helpers, and zero-latency client-side privacy.

SignedToken Status
HS256Algorithm
0Token Length
0Active Claims
Quick Expiry Helpers:
Auto-Synced
Header.Payload.Signature
Inspect in JWT Decoder↗

Understanding JSON Web Token Generation & Cryptographic Signatures

A JSON Web Token (JWT) constructed under RFC 7519 is an open, stateless serialization format designed for identity propagation and API authorization. Unlike stateful database sessions, a JWT encapsulates its own identity assertions, authorization claims, and expiration dates. To prevent unauthorized mutation of these claims, the token is appended with a cryptographic signature calculated over the combined header and payload.

HMAC-SHA256 (HS256) Signing

HMAC (Hash-based Message Authentication Code) is a symmetric signing algorithm that combines a secret key with the SHA-256 hash function. Both the token issuer and the validating service must know the shared secret to authenticate the signature.

Base64URL Encoding Standard

Each segment of the token is encoded using URL-safe Base64: + is replaced with -, / is replaced with _, and trailing = padding is omitted. This ensures safe transmission within HTTP Authorization: Bearer headers.

JWT Signing Algorithms Comparison

AlgorithmKey TypeHash OutputCommon Architecture Scenario
HS256Symmetric Shared Secret256-bit signatureSingle-service APIs & internal microservices
HS384 / HS512Symmetric Shared Secret384 / 512-bit signatureHigh-security internal infrastructure
noneNo Key (Unsigned)Empty signatureDebugging & environments with external transport security
RS256 / ES256Asymmetric (Private/Public)Varies (RSA / ECDSA)OpenID Connect, third-party OAuth providers

Frequently Asked Questions

How does this tool sign JWT tokens securely in the browser?

The encoder utilizes the native browser Web Crypto API (window.crypto.subtle). It imports your shared secret key into a cryptographic HMAC key object and generates a genuine SHA-256/384/512 signature over the Base64URL-encoded header and payload.

Does the “exp” claim require milliseconds or seconds?

Under the RFC 7519 specification, all JWT timestamp claims (including exp, iat, and nbf) must be represented as NumericDate values in integer seconds since the UNIX epoch (January 1, 1970 00:00:00 UTC), not milliseconds.

Is my secret signing key sent to any backend server?

No. All cryptographic HMAC operations, Base64URL encoding, and JSON parsing execute strictly inside your local browser memory via Web Crypto. Your secret key and payload never touch any network connection.