DeveloperKit

JWT Encoder

Create and sign JSON Web Tokens for testing and development. Free, private, and 100% in your browser.

HeaderAlgorithm & token type

✓ Valid

Signing KeyHMAC with SHA-256

PayloadClaims

✓ Valid

Encoded Token

Enter a secret to sign the token.

Create a JWT Online

A JWT encoder builds a JSON Web Token from a header and a payload and signs it with a secret or private key. It is useful for testing APIs, reproducing authentication bugs, writing integration tests, and learning how tokens work, without writing any code.

The token is assembled as base64url(header) + "." + base64url(payload), and the signature is computed over that string. Open the result in the JWT Decoder to inspect and verify it.

Typical access token payload
{
  "iss": "https://auth.example.com",
  "sub": "user_12345",
  "aud": "https://api.example.com",
  "scope": "read:orders write:orders",
  "iat": 1767225600,
  "exp": 1767229200
}

Features

  • All common algorithms

    Sign with HS256/384/512, RS256/384/512, PS256/384/512, ES256/384/512, and EdDSA (Ed25519).

  • Live signing

    The token is re-signed as you edit the header, payload, or key, with exact line and column errors for invalid JSON.

  • One-click time claims

    Set iat and nbf to now, or exp to 15 minutes, 1 hour, 1 day, or 30 days from now, and see the dates in plain English.

  • Flexible keys

    Use a text or Base64 secret, a PEM private key (PKCS#8, PKCS#1, or SEC1), or a private JWK.

  • Test key pairs

    Generate an RSA, EC, or Ed25519 key pair in your browser and copy the public key to verify the token.

  • Private by design

    Signing uses the browser's Web Crypto API. Secrets, keys, and tokens never leave your device.

How to Create and Sign a JWT

  1. Choose the signing algorithm. The alg field in the header updates automatically.
  2. Edit the payload JSON and use the shortcuts to set iat, nbf, and exp.
  3. Enter a secret (HS algorithms) or paste a private key. Click Generate Key Pair to create a test key.
  4. Copy the signed token, or open it in the JWT Decoder to verify it.

Frequently Asked Questions

Is it safe to sign tokens with my secret here?

The secret and private key are used only inside your browser via the Web Crypto API and are never sent anywhere. Even so, use test keys whenever you can, and never paste production signing keys into a tool you do not control.

Which algorithm should I choose?

Use HS256 when the same service creates and verifies tokens and can keep a shared secret. Use RS256 or ES256 when other services must verify tokens without being able to create them: they only need the public key. ES256 and EdDSA produce much shorter signatures than RSA.

How long should an HS256 secret be?

At least 32 random bytes (256 bits) for HS256, 48 for HS384, and 64 for HS512, as RFC 7518 requires. The Random button creates a secret of the right length. Short or guessable secrets can be cracked offline from a single token.

Why does the token change every time with ES256 or PS256?

ECDSA and RSA-PSS signatures include randomness, so signing the same data twice gives different signatures. Both are valid. HS256, RS256, and EdDSA are deterministic and always produce the same token for the same input.

Is the payload encrypted?

No. A signed JWT is only base64url-encoded, so anyone with the token can read the payload. Never put passwords or other secrets in it. The signature only guarantees that the content has not been changed.

My key is in PKCS#1 or OpenSSL EC format. Does it work?

Yes. -----BEGIN RSA PRIVATE KEY----- (PKCS#1) and -----BEGIN EC PRIVATE KEY----- (SEC1, including output from openssl ecparam -genkey) are converted automatically. Password-protected keys must be decrypted first.

  • JWT Decoder

    Decode and debug JSON Web Tokens, see when they expire, and verify HS, RS, PS, ES, and EdDSA signatures.

  • Hash Generator

    Generate MD5, SHA-1, SHA-256, SHA-384, and SHA-512 hashes and HMACs of text or files, live as you type.

  • Bcrypt Generator

    Hash passwords with bcrypt at any cost factor and verify a password against an existing bcrypt hash.

  • UUID Generator

    Generate v4, v7, v1, v5, and v3 UUIDs / GUIDs in bulk, and inspect any UUID's version and timestamp.