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 Key (JWK) is a JSON data structure that represents a cryptographic key, as defined in RFC 7517. JWK format provides a standardized way to represent cryptographic keys in JSON, making them easy to exchange between systems, particularly in modern web applications, APIs, and security protocols like JWT, OAuth 2.0, and OpenID Connect.
{
"kty": "EC",
"crv": "P-256",
"x": "f83OJ3D2xF1Bg8vub9tLe1gHMzV76e8Tus9uPHvRVEU",
"y": "x_FEzRu9m36HLN_tue659LNpXW6pCyStikYjKIWI5a0",
"kid": "my-ec-key-2025",
"use": "sig",
"alg": "ES256"
}
{
"kty": "RSA",
"n": "0vx7agoebGcQSuuPiLJXZptN9nndrQmb...",
"e": "AQAB",
"kid": "my-rsa-key-2025",
"use": "sig",
"alg": "RS256"
}
n parameter is the modulus, e is the public exponent (typically 65537).
{
"kty": "OKP",
"crv": "Ed25519",
"x": "11qYAYKxCrfVS_7TyWQHOg7hcvPapiMlrwIaaPcHURo",
"kid": "my-ed25519-key-2025",
"use": "sig",
"alg": "EdDSA"
}
{
"kty": "oct",
"k": "AyM1SysPpbyDfgZld3umj1qzKObwVMkoqQ-EstJQLr_T-1qS0gZH75aKtMN3Yj0iPS4hcgUuTwjAzZr1Z9CAow",
"kid": "my-hmac-key-2025",
"use": "sig",
"alg": "HS256"
}
| Key Type | kty Value | Use Cases | Security Level | Key Size | Recommendation |
|---|---|---|---|---|---|
| Elliptic Curve | EC |
JWT signing, OAuth 2.0, modern APIs | 128-256 bit | 256-521 bits | Highly Recommended Best for new projects |
| RSA | RSA |
JWT signing, encryption, legacy systems | 112-140 bit | 2048-4096 bits | Recommended Widely compatible |
| Octet Key Pair | OKP |
Ed25519/Ed448 signatures, modern JWT | 128-224 bit | 256-456 bits | Excellent Modern alternative to EC |
| Octet Sequence | oct |
HMAC signatures, AES encryption | 128-256 bit | 128-512 bits | Symmetric Keep secret! |
RSA keys in JWK format contain the following fields (all Base64URL encoded):
kty - Key type (always "RSA" for RSA keys)
n - Modulus (the public key component)
e - Public exponent (typically "AQAB" = 65537)
kid - Key ID (optional, for key identification)
use - Key use (optional: "sig" for signing, "enc" for encryption)
alg - Algorithm (optional: "RS256", "RS384", "RS512")
d - Private exponent (secret)
p - First prime factor (secret)
q - Second prime factor (secret)
dp - First factor CRT exponent: d mod (p-1)
dq - Second factor CRT exponent: d mod (q-1)
qi - First CRT coefficient: q^-1 mod p
JWK is used to represent the public keys for verifying JWT signatures.
JWK Sets (JWKS) are commonly exposed at endpoints like /.well-known/jwks.json
for token verification.
OAuth 2.0 providers use JWK Sets to publish their public keys, allowing clients to verify ID tokens and access tokens without pre-sharing keys.
APIs can use JWK for key-based authentication, allowing clients to register public keys and sign requests with corresponding private keys.
JWK format simplifies key exchange between systems, making it easy to share public keys via JSON APIs, configuration files, or key management systems.
This JWK to PEM converter 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 2018, with over 756 verified reviews averaging 4.6/5 stars.
Learn more about JWK and cryptographic key formats:
Over 500,000 developers use 8gwifi.org tools monthly