JWT HMAC signature
JWT = Base64URL(header) + '.' + Base64URL(payload) + '.' + Base64URL(HMAC(secret, signing input))
Generate an HMAC-signed JSON Web Token for testing: enter the header and payload as JSON, pick HS256, HS384 or HS512 and your secret; alg and typ are filled in automatically.
For testing and development: do not use a production secret on a shared or untrusted device.
The JWT encoder builds an HMAC-signed token from a header, a JSON payload and a shared secret. It is meant for developers and testers who need a custom token to call a local API, write an automated test or reproduce an edge case (expired token, missing role). It is designed for development and testing, not for issuing production tokens.
The tool checks that the header and payload are valid JSON objects, then sets alg in the header to the chosen algorithm and typ to JWT. Each object is serialized and Base64URL-encoded (RFC 4648, without = padding), and the two segments are joined by a dot. For example, the header {"alg":"HS256","typ":"JWT"} becomes eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.
The signature is an HMAC computed over the "header.payload" string with SHA-256, SHA-384 or SHA-512 depending on the algorithm (RFC 7518, section 3.2), using the Web Crypto API. The Base64URL-encoded result is the third segment of the JWT (RFC 7519). RFC 7518 requires a key at least as long as the hash output: 256 bits (32 bytes) for HS256, 384 bits for HS384 and 512 bits for HS512. The exp, iat and nbf dates in the payload must be Unix seconds, for example "exp": 1767225600 for January 1, 2026 at 00:00 UTC.
Edit the two prefilled JSON areas or import a .json file. Add your claims: sub, iss, aud, exp, roles or custom fields.
Select HS256, HS384 or HS512 and enter the shared secret. The alg and typ header fields are updated automatically.
Click Generate: the signed token appears and can be copied. An error is shown if the JSON is invalid or the secret is empty.
JWT = Base64URL(header) + '.' + Base64URL(payload) + '.' + Base64URL(HMAC(secret, signing input))
Create a token signed with your development environment’s secret to call a protected route with curl or Postman, without going through the whole login flow.
Set exp in the past or remove a roles claim to check that your middleware really returns a 401 or 403 error in these edge cases.
Generate stable tokens for your integration tests, then check them with the JWT verifier to make sure the secret and claims match what the server expects.
Input
Algorithm: HS256; JSON header: {"alg":"HS256","typ":"JWT"}; JSON payload: {"sub":"1234567890","name":"John Doe","iat":1516239022}; Secret: test-secretResult
Signed JWT: three dot-separated Base64URL segments; the signature uses HMAC-SHA256.A JWT is built by Base64URL-encoding a JSON header and a JSON payload, then signing the "header.payload" string with the chosen algorithm. Here you just enter both objects and a secret, then click Generate. In production this is done by your authentication server or a library such as jose or jsonwebtoken.
RFC 7518 requires a key of at least 256 bits, that is 32 bytes, for HS256; 48 bytes for HS384 and 64 bytes for HS512. A random secret of that size, for example from a secure token generator, prevents dictionary attacks on the signature.
These HMAC algorithms only need a shared secret, which is enough to create test tokens. RS256 or ES256 would require a private key, which should not be handled in a web tool. If several parties must verify your tokens without being able to issue them, use an asymmetric algorithm on the server.
Add the exp claim to the payload with a Unix timestamp in seconds, for example "exp": 1767225600. A timestamp converter helps you compute that value from a date. Also consider iat to record when the token was issued.
No, the tool is designed for development and testing. In production, tokens must be issued by a server that keeps the secret away from users, enforces short lifetimes and handles key rotation.
No. Encoding and the HMAC signature are computed in your browser with the Web Crypto API, without any network request. Still avoid entering a production secret, because anyone who knows it can sign tokens your API will accept.
Recommended workflow
Discover tools that naturally fit before, after, or alongside this one.
Decode a JWT to read its header, payload, claims and expiration dates.
Verify a JWT signature with an HMAC secret or a JWK, JWKS or PEM public key, then check exp, nbf, iss and aud.
Learn what a JWT contains, why decoding is not verification, how claims such as exp, nbf, iss and aud work, and common security mistakes.
Understand how OAuth 2.0, PKCE, JWT, JWK and JWKS fit together: authorization, tokens, public keys and verification.
Understand HSTS, CSP, X-Content-Type-Options, Referrer-Policy and Permissions-Policy and how to verify the headers actually returned.
Understand the layers that protect a website: HTTPS, HTTP security headers, CSP, SRI, authentication, passwords and integrity.