Skip to content

JWT Encoder

Developer Tools•Client-Side & Private

Build and sign JSON Web Tokens in your browser — compose the header and claims, sign HS256, HS384 or HS512 with your secret, and get a ready token.

Tool workspace

Test tokens only: never sign a production token with a secret typed into any web page, including this one. HMAC-only v1 — RS256 (which needs a private key) is not supported here. The secret never leaves this browser.

Claims (payload)

Loading tool controls…

Files processed locally — never uploaded to our servers
Free Instant Private

Verify it yourself: press F12, open the Network tab, and use this tool — your files are never uploaded.

JWT Encoder at a glance

Price
Free
Account
Not required
File uploads
None — your files are never uploaded

Who uses Developer Tools?

Developers and engineers formatting JSON, testing regex, hashing data, encoding values or building API requests.

How to Use JWT Encoder

Follow these simple steps to get instant results in your browser.

1

Pick an Algorithm and Secret

Choose HS256, HS384 or HS512 and type a test secret — for example my-test-secret-123.

2

Fill in the Claims

Enter sub, iss and aud, pick exp and nbf dates (converted to epoch seconds for you), and add custom claims as JSON.

3

Sign and Verify

Click Sign token, copy the result, then click Verify round-trip to confirm the signature matches the secret.

💡

What is JWT Encoder & How Does It Work?

JWT Encoder builds and signs JSON Web Tokens in your browser. Compose the header and the claims — sub, iss, aud, exp, nbf, iat and any custom claims as a JSON object — pick HS256, HS384 or HS512, type a secret, and get a ready-to-use token: three Base64URL parts joined by dots, signed with Web Crypto (HMAC).

The token can be verified immediately: “Verify round-trip” re-checks the signature with the same secret, and the decoded header and payload are shown underneath. Paste the token into the JWT Decoder tool to read the claims back — the decoder is decode-only, so use the round-trip check for the signature itself.

This is HMAC-only v1: RS256 is not supported, because it needs a private key and this page does not accept one. And it is for test tokens only — the secret never leaves your browser, but never sign a production token with a secret typed into any web page, including this one.

⚡

Key Features & Capabilities

✓

HS256, HS384, HS512

HMAC signing with SHA-256, SHA-384 or SHA-512, via Web Crypto.

✓

Full Claims Editor

sub, iss, aud, exp, nbf, iat plus custom claims as a JSON object.

✓

Epoch Conversion

Pick exp and nbf as dates; the epoch-seconds value is shown under the field.

✓

Round-Trip Verify

Re-checks the signature with the same secret, in the browser.

✓

HMAC-Only, Labelled

RS256 is not supported here — the page says so plainly.

Pro Tips

  • •Bookmark this tool for instant one-click access anytime.
  • •Drag and drop files directly onto the input surface for fastest handling.
  • •All processing happens in your browser session for maximum speed and data safety.

🎯 Common Use Cases

Testing an APIMake a test token with the right sub, role and expiry to try against a local API that checks JWTs.
Learning JWTsSee how the header, payload and signature fit together, and what exp and nbf actually contain.
Debugging AuthCreate a token with a known secret and check whether your server accepts it — if not, the secret or algorithm differs.
Sharing a Test TokenSign a token with the sample secret and hand the exact three-part string to a teammate, so they can test the same auth flow.
📐

JWT Encoder - Token Structure

Formula Equation:
token = base64url(header) + "." + base64url(payload) + "." + base64url(HMAC-SHA256(base64url(header) + "." + base64url(payload), secret))

A JWT has three Base64URL-encoded parts joined by dots: the header ({"alg": "HS256", "typ": "JWT"}), the payload (the claims), and the signature — the HMAC of the first two parts, keyed with the secret. HS384 and HS512 use SHA-384 and SHA-512 in the same construction. Anyone can decode the first two parts; only the secret holder can make a valid signature.

✏️

Worked Example

  1. 1Header {"alg": "HS256", "typ": "JWT"} → eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9
  2. 2Payload {"sub": "user-123", "iss": "pixeltools-demo"} → eyJzdWIiOiJ1c2VyLTEyMyIsImlzcyI6InBpeGVsdG9vbHMtZGVtbyJ9
  3. 3Signature = HMAC-SHA256("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ1c2VyLTEyMyIsImlzcyI6InBpeGVsdG9vbHMtZGVtbyJ9", secret), Base64URL-encoded — the third part of the token
📚

Sources & Further Reading

Frequently Asked Questions about JWT Encoder

Frequently asked questions

Click “Verify round-trip” — it re-checks the signature with the same secret using Web Crypto. You can also paste the token into the JWT Decoder tool to read the header and claims back (the decoder is decode-only, so it does not verify the signature).

HS256, HS384 and HS512 — HMAC with SHA-256, SHA-384 and SHA-512, signed with a secret you type. RS256 is not supported in this version: it needs a private key, and this page does not accept one. That is labelled on the page as HMAC-only v1.

No — this is for test tokens only. The secret never leaves your browser, but never sign a production token with a secret typed into any web page, including this one. Use a throwaway test secret.

Pick a date and time in the exp (expires at) or nbf (not before) fields and the tool converts it to Unix epoch seconds for the claim — the epoch value is shown under the field so you can check it.

Yes, if it was signed with HMAC and you know the secret: paste the token and secret into the decode section and click “Verify round-trip” — it re-checks the signature with Web Crypto. Tokens signed with RS256 cannot be verified here, because the tool only supports HMAC.

Three Base64URL parts joined by dots: header.payload.signature. With the sample claims (sub user-123, iss pixeltools-demo, aud my-api, role admin, name Ayesha Khan) and the sample secret, the header is eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9 and the payload is eyJzdWIiOiJ1c2VyLTEyMyIsImlzcyI6InBpeGVsdG9vbHMtZGVtbyIsImF1ZCI6Im15LWFwaSIsInJvbGUiOiJhZG1pbiIsIm5hbWUiOiJBeWVzaGEgS2hhbiJ9 — the third part is the HMAC-SHA256 signature of the first two.

Complementary utilities for your workflow

View all →
You are here

JWT Encoder

Sign JWTs with HS256/384/512 — header, claims, secret in.

Current tool

JWT Decoder

Decode and inspect JWT header, payload, and expiry.

Try tool

Hash Generator

Generate MD5, SHA-1, SHA-256, and SHA-512 hashes.

Try tool

Hash Identifier

Identify a hash — ranked candidates + Hashcat modes.

Try tool