JWT Verifier & Decoder Online | HS256, RS256, ES256 Signature
Digital Signaturesiss, aud, and exp claims on the server side. For encrypted tokens, use JWE.
How It Works
What Is JWT (JSON Web Token)?
JWT (JSON Web Token), defined in RFC 7519, is a compact, URL-safe token format for representing claims between parties. A JWT consists of three parts: a header (algorithm and token type), a payload (claims as JSON), and a signature (proving authenticity). The signature can use symmetric algorithms (HMAC with a shared secret) or asymmetric algorithms (RSA, ECDSA with public/private key pairs).
This tool has two modes: Sign creates a JWT from a payload JSON and your secret or private key; Parse & Verify splits the three base64url-encoded segments, decodes the header and payload as JSON, and verifies the signature. Supports HS256/384/512, RS256/384/512, PS256/384/512, and ES256/384/512. All operations run locally in your browser.
When to Use JWT
- API authentication — JWT is the standard for stateless authentication in REST APIs and microservices
- Single Sign-On (SSO) — OAuth 2.0 and OpenID Connect use JWT for identity tokens
- Information exchange — Securely transmit claims between parties with signature verification
- Mobile / IoT — Compact token format ideal for bandwidth-constrained environments
- Session management — Replace server-side sessions with stateless JWT tokens
- When NOT to use — For confidential data, use JWE (encrypted JWT) instead; JWT payload is only encoded, not encrypted
Algorithm Comparison
| Algorithm | Type | Key Size | Signature Size | Best for |
|---|---|---|---|---|
| HS256/384/512 | Symmetric (HMAC) | Shared secret | 32-64 bytes | Internal APIs, simple auth |
| RS256/384/512 | Asymmetric (RSA) | 2048-4096 bit | 256-512 bytes | Legacy compatibility |
| PS256/384/512 | Asymmetric (RSA-PSS) | 2048-4096 bit | 256-512 bytes | Modern RSA (recommended) |
| ES256/384/512 | Asymmetric (ECDSA) | 256-521 bit | 64-132 bytes | Mobile, IoT, JWT standard |
Standards Compliance
- RFC 7519 — JSON Web Token (JWT) specification
- RFC 7515 — JSON Web Signature (JWS) — signature algorithms
- RFC 7518 — JSON Web Algorithms (JWA) — HS, RS, PS, ES algorithms
- OpenID Connect Core 1.0 — JWT used as ID Token for authentication
- OAuth 2.0 — JWT used for access tokens and client authentication
Last updated:
Code Examples
Create and verify JWT in multiple languages:
JavaScript — jose library (Browser / Node.js)
import { SignJWT, jwtVerify } from 'jose';
// Sign with HS256
const secret = new TextEncoder().encode('your-256-bit-secret');
const jwt = await new SignJWT({ sub: '1234567890', name: 'John Doe' })
.setProtectedHeader({ alg: 'HS256' })
.setIssuedAt()
.setExpirationTime('2h')
.sign(secret);
console.log('JWT:', jwt);
// Verify
const { payload } = await jwtVerify(jwt, secret);
console.log('Verified payload:', payload); Python — PyJWT
import jwt
secret = 'your-256-bit-secret'
# Sign
payload = {'sub': '1234567890', 'name': 'John Doe'}
token = jwt.encode(payload, secret, algorithm='HS256')
print('JWT:', token)
# Verify
decoded = jwt.decode(token, secret, algorithms=['HS256'])
print('Decoded:', decoded) Go — golang-jwt
import "github.com/golang-jwt/jwt/v5"
claims := jwt.MapClaims{
"sub": "1234567890",
"name": "John Doe",
"exp": jwt.NewNumericDate(time.Now().Add(2 * time.Hour)),
}
token := jwt.NewWithClaims(jwt.SigningMethodHS256, claims)
signed, _ := token.SignedString([]byte("your-256-bit-secret")) Rust — jsonwebtoken
use jsonwebtoken::{encode, decode, Header, EncodingKey, DecodingKey, Validation};
use serde::{Serialize, Deserialize};
#[derive(Serialize, Deserialize)]
struct Claims {
sub: String,
name: String,
exp: usize,
}
let claims = Claims { sub: "1234567890".into(), name: "John Doe".into(), exp: 1234567890 };
let token = encode(&Header::default(), &claims, &EncodingKey::from_secret(b"secret"))?; Node.js — jsonwebtoken (CommonJS)
const jwt = require('jsonwebtoken');
// Sign
const payload = { sub: '1234567890', name: 'John Doe' };
const secret = 'your-256-bit-secret';
const token = jwt.sign(payload, secret, { algorithm: 'HS256', expiresIn: '2h' });
console.log('JWT:', token);
// Verify
const decoded = jwt.verify(token, secret);
console.log('Decoded:', decoded); Common Pitfalls
exp claim on the server side. Without expiration validation, tokens remain valid indefinitely, even after revocation.
alg header from the client. Always specify the expected algorithm on the server side to prevent "none" algorithm or RS256/HS256 confusion attacks.
iss (issuer) and aud (audience) claims match your expected values. This prevents tokens from one service being used in another.
Security Notes
exp to 5-15 minutes for access tokens. Use refresh tokens for longer sessions. This limits the window of exposure if a token is compromised.
Disclaimer
This tool is provided for educational and development purposes. JWT security depends on proper implementation of validation, expiration, and key management — all of which are the user's responsibility. For production systems, use well-audited JWT libraries and follow RFC 7519 security considerations.
Further Reading
- RFC 7519 — JSON Web Token (JWT)
- RFC 7515 — JSON Web Signature (JWS)
- RFC 7518 — JSON Web Algorithms (JWA)
- OpenID Connect Core 1.0
Related Concepts
- JWE Encrypt/Decrypt — Encrypted JWT tokens (confidentiality + integrity)
- ECC Key Generator — Generate keys for ES256/ES384 signing
- RSA Key Generator — Generate keys for RS256/PS256 signing
Related Tools
Need to generate ECC keys for ES256? Try the ECC Key Generator. For RSA keys used with RS256/PS256, see the RSA Key Generator. You can also exchange shared secrets securely using the ECDH Key Exchange tool.
Frequently Asked Questions
How does JWT signature verification work?
Verification recomputes the signature from the header and payload using the specified algorithm and a key, then compares it to the provided signature. For HMAC, a shared secret is used. For RSA/ECDSA, a public key is used.
Is the payload encrypted?
No. JWT payload is base64url-encoded, not encrypted. Anyone who has the token can read its contents. The signature only guarantees authenticity and integrity, not confidentiality. Never put sensitive data in a JWT payload.
Can I create (sign) a JWT?
Yes. Switch to the Sign mode, edit the payload JSON, choose an algorithm (HS/RS/PS/ES family), and provide the shared secret or PKCS#8 private key. Signing happens entirely in your browser — your keys never leave your device.
What is the Claims Breakdown?
The Claims Breakdown is a human-readable table that shows each claim in the payload with its name, value, and description. Standard registered claims (iss, sub, aud, exp, nbf, iat, jti) are described per RFC 7519; custom claims are marked as such.
Which algorithm should I choose?
For symmetric signing (shared secret), use HS256/384/512. For asymmetric signing, PS256 is recommended over RS256 (probabilistic, more resistant to certain attacks). ES256 offers compact signatures ideal for mobile and IoT. Choose based on your security requirements and key infrastructure.
Privacy: This tool runs entirely in your browser — nothing is uploaded or stored. · Disclaimer: For educational purposes only. Not professional security advice.
More in Signatures
Digital Signature & Verify
Create and verify digital signatures online with RSA (PSS, PKCS#1 v1.5) or ECDSA (P-256, P-384, P-521, secp256k1). Text/hex/Base64 input.
Ed25519 Sign / Verify
Sign and verify with Ed25519 or Ed25519ph (EdDSA) online. PEM and raw hex keys, built-in key pair generator, public key derivation.
ML-DSA Sign / Verify
Generate ML-DSA (FIPS 204) post-quantum key pairs, sign messages, and verify signatures online. ML-DSA-44/65/87, hex and Base64 output.