EN
My tools

JWT Encoder / Generator (HS256, RS256, ES256)

Create and sign a JSON Web Token: HS256/384/512 with a secret, or RS, PS and ES 256/384/512 with a PEM private key. Adds iat and exp, and verifies the result.

"alg" is always set to the algorithm chosen above.
Keys are used only in this page. Use a throwaway or test key when you can.
My tools →
Advertisement

A JSON Web Token carries claims — who the user is, when the token expires — in a compact string signed by the issuer. This encoder builds and signs one in your browser: HS256/384/512 with a shared secret, or RS, PS and ES 256/384/512 with a private key in PEM or JWK form. It can stamp the current time as iat, add an exp a set number of minutes later, and verifies every token it makes before showing it.

How to use this tool

  1. Choose the algorithm your API expects.
  2. Edit the header and the payload JSON; "alg" is filled in for you.
  3. Enter the shared secret, or paste the private key for RS, PS or ES algorithms.
  4. Optionally set iat to now and an expiry in minutes, then copy the token.

Formula

token = Base64URL(header) + "." + Base64URL(payload) + "." + Base64URL(signature over the first two parts)

HS algorithms use HMAC with SHA-256/384/512. RS uses RSASSA-PKCS1-v1_5, PS uses RSASSA-PSS with a salt as long as the hash, and ES uses ECDSA on P-256, P-384 or P-521 with the signature written as raw r‖s (RFC 7518). JSON is serialised compactly, keeping your key order.

Example

With the default header {"alg":"HS256","typ":"JWT"}, the payload {"sub":"1234567890","name":"John Doe","iat":1516239022} and the secret "your-256-bit-secret", the token is eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIi….SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c — the well-known jwt.io sample.

Frequently asked questions

Is it safe to paste a private key here?

Signing happens in your browser with the Web Crypto API and nothing is sent anywhere. Still, treat production signing keys as secrets: use test keys here, and sign real tokens on your server.

Why is a PEM key refused for HS256?

HS256 needs a shared secret. Using a public key as an HMAC secret is the "algorithm confusion" attack that lets anyone who knows the public key forge tokens, so the encoder refuses it. Pick RS256 or ES256 for key pairs.

Why does my ES256 token change every time?

ECDSA and RSA-PSS signatures use fresh randomness for each signature. Each version is valid; HS and RS tokens are deterministic and stay the same.

Which algorithm should I use?

HS256 is simple when one service both issues and checks tokens. Use RS256 or ES256 when other parties must verify tokens without being able to create them.

Sources

Last updated:

Cite or embed this tool
APA

kakaoCalc. (2026, November 8). JWT Encoder / Generator (HS256, RS256, ES256). https://kakao.mobile/tools/jwt-encoder/

MLA

“JWT Encoder / Generator (HS256, RS256, ES256).” kakaoCalc, 8 Nov. 2026, kakao.mobile/tools/jwt-encoder/.

Paste this code into your page. The widget runs in your visitors' browsers, shows no ads and keeps a link back to this page. Embedding terms

Advertisement