JWT HS256 vs PASETO v4.local — Token Comparison Playground
Side-by-side: the same payload signed as JWT HS256 and encrypted as PASETO v4.local, using the same key — all in your browser.
What is the Token Comparison Playground?
When teams debate tokens, it is usually framed as "JWT versus PASETO" as if each were a single thing. In practice each format has two very different flavors, and mixing them up is where teams get burned.
This playground gets that distinction out of the abstract and onto the screen. You can see, not just read about, the three-part JWT with its negotiated `alg` header, and the versioned PASETO with its fixed algorithm, nonce, and authentication tag — and you can watch the byte sizes and timing sit side by side in real time.
Zero-Server Tool Data Guarantee
All comparison generation, JWT signing, PASETO encryption, and decryption happen entirely in your browser using the Web Crypto API and tweetnacl. Tokens, secrets, and keys never leave your device.
How to Use
Enter a JSON payload
Type or paste any JSON object, or load a ready-made template (basic, claims, or OIDC) to seed common claim shapes.
Set the shared key
Enter a 32-byte key as base64url, or click Random to generate one. The same key signs the JWT and encrypts the PASETO token.
Optionally add a PASETO footer
Add a footer such as a kid for key identification. JWT has no footer, which visually highlights the format difference.
Generate both tokens
Click Generate to produce the JWT HS256 and PASETO v4.local tokens from the same payload and key, with byte sizes and per-format timing.
Verify the round-trip
The tool checks the JWT signature and decrypts the PASETO token to confirm both recover the exact original payload.
JWT HS256 vs PASETO v4.local
| Property | JWT HS256 | PASETO v4.local |
|---|---|---|
| Structure | header.payload.signature | v4.local.nonce+ciphertext[.footer] |
| Primitive | HMAC-SHA256 | XChaCha20-Poly1305 (AEAD) |
| Payload visibility | Readable (Base64URL only) | Encrypted |
| Algorithm negotiation | Header alg (agility risk) | Fixed per version |
| Key ID | kid in header | kid in authenticated footer |
| Typical overhead | ~3 Base64URL segments | +24-byte nonce, +16-byte tag |
Production Best Practices & Security
Frequently Asked Questions
JWT HS256 is a signed, self-contained token: header.payload.signature, where the signature is an HMAC-SHA256 over those first two parts using a shared secret. Anyone who holds the token can read the payload — it is only Base64URL-encoded, never encrypted.
PASETO v4.local is an encrypted token: v4.local.nonce+ciphertext[.footer]. The payload is sealed with XChaCha20-Poly1305, so it is both confidential and authenticated. There is no header, and the cryptographic algorithm is fixed by the version rather than declared in the token.
That one design choice — signing vs. authenticated encryption — is the core difference this playground lets you feel side by side.