JWT Encoder — Create & Sign HS256 Tokens
About
A JWT is three Base64url parts joined by dots: header, payload, signature. This encoder builds the first two from your JSON (header fixed to {"alg", "typ":"JWT"}) and, for HS256, signs header.payload with HMAC-SHA256 via WebCrypto — the same operation your auth server performs. The decoder companion on this site inspects tokens; this page creates them, which is what local development and API testing constantly need. Two standing warnings: a JWT is signed, not encrypted — never put secrets in the payload; and a test secret typed here is fine, but production keys belong in your secrets manager, not in any browser tool, including this local one.
Frequently Asked Questions
What is the iat in the sample?
Issued-at time as a Unix timestamp (seconds). Servers check exp/nbf/iat claims; the NumericDate format is always seconds since the epoch.
Why does the signature change if I edit one character?
The signature covers the exact bytes of header.payload; any change invalidates it — that is the integrity guarantee JWTs exist for.