Skip to main content
L
Loopaloo
Buy Us a Coffee
All ToolsImage ProcessingAudio ProcessingVideo ProcessingDocument & TextPDF ToolsCSV & Data AnalysisConverters & EncodersWeb ToolsMath & ScienceGames
Guides & BlogAboutContact
Buy Us a Coffee
L
Loopaloo

Free online tools for developers, designers, and content creators. Your files are processed in your browser and are never uploaded - no accounts required. A few network utilities (like What's My IP and Currency Converter) call public APIs to do their job and say so on their pages.

support@loopaloo.com

Tool Categories

  • Image Tools
  • Audio Tools
  • Video Tools
  • Document & Text
  • PDF Tools
  • CSV & Data
  • Converters
  • Web Tools
  • Math & Science
  • Games

Company

  • About Us
  • Contact
  • Blog
  • FAQ

Legal

  • Privacy Policy
  • Terms of Service
  • Disclaimer

Support

Buy Us a Coffee

© 2026 Loopaloo. All rights reserved. Built with privacy in mind.

Privacy|Terms|Disclaimer
  1. Home
  2. Converters & Encoders
  3. JWT Builder
Add to favorites

JWT Builder

Build and sign a JSON Web Token with HS, RS, PS or ES algorithms, generate secrets or key pairs, and verify the result in your browser.

Runs locally in your browserMore converters & encodersJump to full guide
Related readingUnderstanding JWT Tokens: Structure, Security, and Validation11 min

Initializing in your browser…

You might also like

JWT Decoder

Decode a JSON Web Token instantly, check its expiry and claims, and verify the signature with a secret, PEM key or JWKS, all in your browser.

PDF Signature Tool

Sign a PDF: draw, type or upload your signature, tap where it goes, and download. Transparent, so it never hides the signature line.

Color Palette Generator

Generate colour palettes from one base colour, with tints and shades, contrast and colour-blindness checks, and CSS, Tailwind or JSON export.

An example conversion

You are testing an API route that checks roles, and need a valid token for user_42 with the tester role that lasts one hour.

Settings

Algorithm  HS256
Secret     a-development-secret-of-at-least-32-bytes (text)
Key ID     key-2026-10
Payload    {"sub":"user_42","role":"tester","iat":1792483200,"exp":1792486800}
What JWT Builder produces

Signed token, 198 characters

eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6ImtleS0yMDI2LTEwIn0
.eyJzdWIiOiJ1c2VyXzQyIiwicm9sZSI6InRlc3RlciIsImlhdCI6MTc5MjQ4MzIwMCwiZXhwIjoxNzkyNDg2ODAwfQ
.fln7LrTZ6s05V5r_u9bZH5aOxLrPzSxlKQOrOy-j7p8

Verified: this token checks out against the secret with HS256.

The header records the algorithm and the key ID, the payload holds the claims, and the third part is the HMAC-SHA256 of the first two. iat is 08:00 UTC and exp 09:00 UTC on 20 October 2026, so the token is valid for exactly one hour. The secret is 41 bytes, 328 bits, comfortably above the 256-bit minimum for HS256; a shorter one such as your-256-bit-secret (152 bits) would still sign but triggers a warning. Paste the token into the JWT Decoder with the same secret and it verifies, while changing a single character of the payload makes it fail.

What this converter does

Create a signed JSON Web Token from your own payload with HS256 to HS512, RS256 to RS512, PS256 to PS512 or ES256 to ES512, and copy it straight into an API request or a test. The tool can generate a strong secret or a key pair for you, warns about secrets that are too short, and verifies every token it produces.

How it works

A JWT is three base64url parts joined by dots: a header naming the algorithm, a payload of claims, and a signature over the first two. To build one, choose an algorithm, provide a key, edit the JSON payload, and the signed token appears below as you type, colour-coded by part. Buttons add the standard claims (iss, sub, aud, exp, nbf, iat and a random jti) and set an expiry five minutes, an hour, a day or thirty days ahead, filling in the current time for iat.

HMAC algorithms (HS256, HS384, HS512) use one shared secret for signing and verifying. The secret can be typed as text or supplied as base64, base64url or hex, and the choice matters: many services publish their HMAC secret in base64, and signing with those characters as plain text gives a token the service rejects as if the secret were wrong. RFC 7518 requires a secret at least as long as the hash, 256 bits for HS256, and the tool warns when yours is shorter, because a short secret still produces a signature that verifies and is otherwise easy to overlook. Generate creates a random secret of the right length.

RSA (RS and PS) and elliptic curve (ES) algorithms sign with a private key and verify with the public key, so the party that checks tokens never holds the power to create them. Paste a private key in PKCS#8 PEM format, or press Generate a key pair to create one in your browser for the selected algorithm: a 2048-bit RSA key, or a P-256, P-384 or P-521 key for ES256, ES384 or ES512. The matching public key is shown so you can copy it to the verifying service.

The header is built for you and always names the algorithm the signature was really made with; you can add a key ID (kid) so a server holding several keys knows which one to use. The payload is checked as you type: invalid JSON, a time claim written as a string or in milliseconds, or an exp that is already in the past are pointed out. After signing, the tool verifies the new token against the secret or public key, which confirms the key and token belong together.

Keys and tokens never leave your browser. Even so, a secret typed into any web page should be treated as a development or test secret; keep production signing keys in your server's secret store.

How to use

  1. 1Choose an algorithm. HS256 is the simplest; RS256 or ES256 when another service verifies the tokens.
  2. 2Enter a secret (set whether it is text, base64 or hex) or paste a private key, or press Generate for a new one.
  3. 3Edit the payload JSON, or use the buttons to add standard claims and an expiry.
  4. 4Copy the signed token. For RS, PS and ES, also copy the public key for the verifying service.
  5. 5Optionally add a key ID under Header and key ID.

Key features

  • HS256, HS384, HS512, RS256, RS384, RS512, PS256, PS384, PS512, ES256, ES384 and ES512
  • Secrets as text, base64, base64url or hex, with a random secret generator
  • Warnings for HMAC secrets shorter than RFC 7518 requires
  • Key pair generation for RSA and elliptic curve algorithms, with the public key to share
  • One-click claims (iss, sub, aud, exp, nbf, iat, jti) and expiry presets
  • Payload checks for invalid JSON and badly formed time claims
  • Optional kid in the header
  • Every token verified straight after signing
  • Colour-coded output with the length of each part
  • Runs entirely in your browser

Tips & best practices

  • Always include exp. A token without an expiry stays valid until the key is changed.
  • Keep payloads small; every request carries the whole token.
  • Never put passwords or personal data in the payload; anyone with the token can read it.
  • Use the expiry presets to produce tokens for testing both valid and expired cases.

Where this fits

  • Testing a protected API

    Make a token with the exact subject, roles and expiry your endpoint expects, and paste it into an Authorization: Bearer header.

  • Testing expiry handling

    Create a token that expires in five minutes, or one with exp already in the past, to check that your app rejects stale tokens.

  • Setting up public-key verification

    Generate an ES256 key pair, sign a test token with the private key and give the public key to the service that will verify it.

  • Learning how signing works

    Change one character of the payload and watch the whole signature change, then check the result in the JWT Decoder.

Frequently asked questions

Which algorithm should I choose?

HS256 when the same service creates and checks the tokens. RS256 or ES256 when other services must verify tokens without being able to create them, because they only need the public key. ES256 gives much shorter signatures than RS256.

How long should an HMAC secret be?

At least as long as the hash: 256 bits (32 bytes) for HS256, 384 for HS384 and 512 for HS512, as RFC 7518 requires. The Generate button creates a random secret of exactly the right size.

My server rejects the token although the secret is right. Why?

Most often the secret encoding. If the secret you were given is base64, choose Base64 so the decoded bytes are used. Also check the algorithm, the audience and issuer claims, and the server clock against exp and nbf.

What format does the private key need?

PKCS#8 PEM, the block that starts with -----BEGIN PRIVATE KEY-----. Generate a key pair creates one in that format along with the matching public key.

Is it safe to sign tokens in a browser?

Nothing is sent anywhere, but you should still treat any secret entered in a web page as a test secret. Production signing keys belong in your server's secret management, not in a browser tab.

Related tools and how they differ

  • JWT Decoder: Reads and verifies a token you already have, including tokens you did not create.

Further reading

  • Understanding JWT Tokens: Structure, Security, and Validation11 min read

Private by design

Conversions run on your device in JavaScript. The values you enter are never sent over the network.