Creating Your First JWT
Detailed guide on using the JWT Encoder.
Creating Your First JWT
This guide walks you through creating your first JSON Web Token using the JWT Encoder tool.
1. Set Up the Header
The header contains metadata about the token, including the signing algorithm and token type.
{
"alg": "HS256",
"typ": "JWT"
}alg specifies the signing algorithm (e.g., HS256, RS256). typ is typically "JWT".
2. Define the Payload
The payload contains the claims — statements about an entity and additional data.
{
"sub": "1234567890",
"name": "John Doe",
"iat": 1516239022
}Common registered claims include:
sub— Subject (who the token is about)iss— Issuer (who created the token)iat— Issued At (Unix timestamp)exp— Expiration Time (Unix timestamp)
3. Enter Your Secret
For HMAC algorithms (HS256/HS384/HS512), provide a secret key. For asymmetric algorithms, provide your private key in PKCS#8 PEM format.
4. Generate the Token
The tool automatically encodes and signs the token when valid input is detected. Copy the result and use it in your application.
5. Verify
Use the JWT Decoder to verify your token by pasting it and providing the same secret or public key.