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

Sign a JSON Web Token with HS, RS, PS or ES, generate a key pair, and check the result against the verifier

Runs locally in your browserMore converters & encodersJump to full guide

Related reading

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

Initializing in your browser…

You might also like

JWT Decoder

Decode a JSON Web Token and, given the secret or public key, actually verify its signature. Refuses alg: none and algorithm confusion

PDF Signature Tool

Add your signature to PDF documents. Draw, type, or upload your signature, then position it anywhere on the page. Perfect for contracts, agreements, and official documents.

Color Palette Generator

Build a colour harmony that holds its lightness by rotating hue in OKLCH, with the contrast of every pair, a perceptually even tint and shade ramp, and what a colour blind reader sees

An example conversion

You are testing an authorization guard and need a real signed token with a specific subject, an hour of validity, and the key id your server matches on.

Settings

alg      HS256
secret   a-development-secret-of-at-least-32-bytes  (read as text)
kid      key-2026-01
payload  {"sub":"user_42","role":"admin","iat":1700000000,"exp":1700003600}
What JWT Builder produces

Signed token, 196 characters

eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6ImtleS0yMDI2LTAxIn0
.eyJzdWIiOiJ1c2VyXzQyIiwicm9sZSI6ImFkbWluIiwiaWF0IjoxNzAwMDAwMDAwLCJleHAiOjE3MDAwMDM2MDB9
.64-aXuzcAlKBrV_UZNCq3nhdUCRIthvTbCFqjRHXt8k

The three parts are the header, the payload and the HMAC-SHA256 of the first two joined by a dot, each in base64url. The kid ends up in the header, which is how a server holding several keys picks the right one. Two things this checks that most builders do not: how the secret should be read, because a secret published as base64 signed as its own characters produces a token the issuing service rejects and the failure looks exactly like a wrong secret, and whether the key is long enough, because RFC 7518 wants at least 256 bits for HS256 and a shorter one still produces a signature that verifies. RS, PS and ES are offered too, with a key pair generator, so the tool hands you the public key to give to whoever verifies.

What this converter does

Mint a signed JSON Web Token: pick an algorithm, supply a key, edit the claims as JSON, and the token is rebuilt as you type. Twelve algorithms are offered, HS256/384/512, RS256/384/512, PS256/384/512 and ES256/384/512, and for the asymmetric ones the tool will generate a key pair so you get both the private key it signs with and the public key to give to whoever verifies. `alg: none` is deliberately not on the list.

How it works

Two things decide whether a token you build here will actually be accepted, and both of them are usually left silent.

The first is how the secret is read. Most services publish an HMAC secret in base64, and their server decodes it to bytes before signing. A builder that always reads the secret as text signs against completely different bytes, so the token is well formed, verifies against itself, and is rejected by the service, and the failure looks exactly like a wrong secret. The encoding is therefore a setting here (text, base64, base64url or hex), the panel states how many bytes the key turned out to be and which reading produced them, and the tests check that a base64 secret read as base64 gives a token node:crypto verifies against the decoded bytes while the same secret read as text does not.

The second is key length. RFC 7518 section 3.2 says a key at least as large as the hash output MUST be used, so 256 bits for HS256, 384 for HS384 and 512 for HS512. A shorter key still produces a signature that verifies perfectly well, which is exactly why nobody notices; the tool signs anyway and says so, with the numbers. There is a generator that produces a secret of the right length.

The algorithm in the header is not a field you can edit: it is written from the algorithm the signature was actually made with, so the two can never disagree. That matters because a token whose header claims one algorithm and whose signature is another is what a confused verifier trips over, and it is the shape of the algorithm confusion attack the decoder refuses. A key id can be set and goes into the header, which is how a server holding a JWKS picks which key to check against.

The payload is edited as JSON and checked against RFC 7519 section 4.1 as you type, without ever refusing to build: exp, nbf and iat have to be numbers of seconds rather than strings or milliseconds; iss, sub and jti have to be strings; aud has to be a string or an array of strings; and the tool points out an exp that has already passed, an nbf in the future, an exp that is not after iat, and a payload with no exp at all. Minting an already-expired token on purpose is a legitimate thing to want, so those are notes rather than refusals.

Every token is signed with the platform’s Web Crypto and then decoded and verified again with the same verifier the decoder tool uses, and the panel reports the result while being clear about what that proves: it is the tool checking itself, not evidence your server will agree. The tests go further and verify every token with node:crypto, a different implementation, in both directions.

Signing is asynchronous and several runs can be in flight while you type. Each run carries a sequence number and only the latest may write its result, so the token on screen always belongs to the payload in the box rather than to whichever run happened to finish last. Thirty rapid payload changes in the browser tests end with the token matching the thirtieth.

How to use

  1. 1Pick an algorithm. HS is a shared secret; RS, PS and ES use a private key and let you hand out only the public one.
  2. 2For HS, paste the secret and set the encoding to match how it was given to you, or press Generate for one of the right length.
  3. 3For RS, PS or ES, paste a PKCS#8 PEM private key, or press Generate a key pair and copy the public key for whoever verifies.
  4. 4Optionally set a key id, which goes into the header for a server that matches against a JWKS.
  5. 5Edit the claims as JSON. Anything that would trip a verifier is flagged as you type.
  6. 6Copy the token. The line underneath says whether it verifies against the key you gave.

Key features

  • Twelve algorithms: HS256/384/512, RS256/384/512, PS256/384/512, ES256/384/512
  • A key pair generator for the asymmetric ones, giving both the private key and the public key in PEM
  • A secret encoding setting (text, base64, base64url, hex), because a base64 secret signed as text produces a token the service rejects
  • The key described back to you: how many bytes it turned out to be and which reading produced them
  • A warning when the HMAC key is under the RFC 7518 minimum, with the numbers
  • A generator for a shared secret of exactly the right length
  • A key id that goes into the header
  • The header algorithm written from the signature, so the two cannot disagree, and alg: none not offered at all
  • Claim checks against RFC 7519: types, exp in the past, nbf in the future, exp before iat or nbf, no exp at all
  • The token verified back against the key and the result shown, with an honest note on what that proves
  • Rapid edits cannot leave a token belonging to an earlier payload
  • Everything runs in the browser and nothing is sent anywhere

Where this fits

  • Testing an authorization guard

    Mint a token with the exact claims a route expects, or deliberately expire it, and watch the guard accept or reject it.

  • Reproducing a signature mismatch

    If a service rejects your token, try the same secret read as base64 rather than text. That one setting is the usual cause, and the two tokens are visibly different.

  • Trying an asymmetric setup

    Generate a key pair, sign with the private key here, and give the public key to the verifier. Nothing that can mint a token ever leaves this page.

  • Checking an example in documentation

    Build the exact token an API doc shows, with a kid and the claims it lists, and confirm it verifies before publishing it.

Frequently asked questions

My token is rejected by the service. What is usually wrong?

How the secret is read. Most providers publish it in base64, and signing it as text uses different bytes entirely. Switch the encoding and compare the two tokens; they will not be the same.

Why does it warn about my secret when the token clearly works?

Because it does work. A short HMAC key produces a valid signature, so nothing breaks and nothing tells you. RFC 7518 section 3.2 requires a key at least the size of the hash output, and the warning gives you both numbers.

Can I set alg to none?

No. It is not on the list. A token with alg: none carries no signature at all and any verifier that honours it accepts anything the sender wrote; there is no legitimate reason to mint one here.

Why can I not paste my "BEGIN RSA PRIVATE KEY" file?

That is PKCS#1, and Web Crypto only reads PKCS#8. The error message gives you the openssl command to convert it: openssl pkcs8 -topk8 -nocrypt -in key.pem -out key8.pem

Is the green line proof my server will accept the token?

No, and it says so. It means this tool signed a token and then verified it with its own verifier, so the two halves agree. Paste the token into a decoder of your own before relying on it.

Is it safe to type a real secret here?

Nothing is sent anywhere and the whole thing runs in the page. That said, a production signing key does not belong in a browser tab; if the verifier is not you, use RS, PS or ES so only the public key has to travel.

Related tools and how they differ

  • JWT Decoder: Reads a token back and verifies its signature against a key you supply, refusing alg: none and algorithm confusion. Use it for a token you received rather than one you are minting.

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.