Every coffee helps keep the servers running. Every book sale funds the next tool I'm dreaming up. You're not just supporting a site — you're helping me build what developers actually need.
A JSON Web Signature (JWS) represents content secured with digital signatures or Message Authentication Codes (MACs), as defined in RFC 7515. JWS is the foundation of JWT (JSON Web Tokens), providing integrity protection and authentication for JSON payloads in modern web applications, APIs, and security protocols like OAuth 2.0 and OpenID Connect.
A JWS token in compact serialization consists of three Base64URL-encoded parts separated by dots (.):
Contains metadata about the token: algorithm (alg), token type (typ), and optionally key ID (kid).
Contains the claims (data) being signed. Can include standard claims like sub, iat, exp and custom claims.
Cryptographic signature over the header and payload. Ensures integrity and authenticity of the token.
| Field | Name | Required | Description |
|---|---|---|---|
alg |
Algorithm | Required | Cryptographic algorithm used (e.g., HS256, RS256, ES256) |
typ |
Type | Optional | Media type of the token, typically "JWT" for JSON Web Tokens |
kid |
Key ID | Optional | Hint indicating which key was used to sign. Useful for key rotation |
jku |
JWK Set URL | Optional | URL to a JWK Set containing the public key for verification |
x5u |
X.509 URL | Optional | URL to X.509 certificate chain for the signing key |
x5c |
X.509 Chain | Optional | X.509 certificate chain (Base64-encoded DER certificates) |
crit |
Critical | Optional | List of header parameters that MUST be understood by the receiver |
When using JWS for JWT tokens, the payload typically contains these registered claims (defined in RFC 7519):
| Claim | Name | Description | Example |
|---|---|---|---|
iss |
Issuer | Who issued the token (URL or string identifier) | "https://auth.example.com" |
sub |
Subject | The principal that is the subject of the JWT (user ID) | "user123" |
aud |
Audience | Recipients the JWT is intended for (string or array) | "https://api.example.com" |
exp |
Expiration Time | Unix timestamp after which the JWT is invalid | 1735689600 |
nbf |
Not Before | Unix timestamp before which the JWT is not valid | 1704067200 |
iat |
Issued At | Unix timestamp when the JWT was issued | 1704067200 |
jti |
JWT ID | Unique identifier for the token (prevents replay attacks) | "abc123-def456" |
| Algorithm | Type | Key Size | Signature Size | Best For |
|---|---|---|---|---|
| HS256 | HMAC (Symmetric) | 256-bit secret | 32 bytes | Internal services, microservices |
| HS384/HS512 | HMAC (Symmetric) | 384/512-bit secret | 48/64 bytes | Higher security internal use |
| RS256 | RSA PKCS#1 | 2048+ bit key pair | 256 bytes | Legacy systems, wide compatibility |
| PS256 | RSA PSS | 2048+ bit key pair | 256 bytes | Modern RSA (recommended over RS256) |
| ES256 | ECDSA P-256 | 256-bit key pair | 64 bytes | Mobile, IoT, high performance |
| ES384/ES512 | ECDSA P-384/P-521 | 384/521-bit key pair | 96/132 bytes | High security requirements |
alg: none - This disables signature verification entirelyalg header - Whitelist expected algorithms to prevent algorithm confusion attacksexp) - Tokens should have a reasonable lifetimeiss, aud, exp, nbf on verificationkid headerThis JWS generator is developed and maintained by Anish Nath ( @anish2good), a Security Engineer and Cryptography Expert with extensive experience in network security and cryptographic implementations. The tool has been serving the developer and DevOps community since 2020, providing reliable JWS generation for testing and development.
Learn more about JWS and JWT standards:
Over 500,000 developers use 8gwifi.org tools monthly