How to use the JWK / JWKS / PEM Converter
Convert public and private keys between PEM and JWK, validate and clean up a JWKS for publication at .well-known/jwks.json, generate RFC 7638 kid thumbprints, and match a JWT's kid against a key set. Supports RSA, EC (P-256 / P-384 / P-521), and Ed25519. Useful for OAuth / OIDC providers, microservices doing token verification, and key rotation. Runs locally in your browser — no network calls, no remote JWKS fetches.
What it does
- PEM ↔ JWK conversion (RSA, EC, Ed25519; public and private).
- JWKS generation from one or more keys, with
kid, use, alg.
- RFC 7638 thumbprint generator for stable, content-derived
kid values.
- Public-only cleanup: strips
d, p, q, dp, dq, qi, and k from a JWK / JWKS so it is safe to publish.
- x5c → PEM certificate chain extraction.
- JWT ↔ JWKS matching: paste a token and a JWKS to identify which key matches by
kid / alg.
- JWKS validation: required fields,
kty / alg coherence, duplicate kid warnings.
When to use it
- Publish a public JWKS while ensuring private fields are removed.
- An OIDC provider gives a JWKS and your service needs a public PEM key for verification.
- Generate a deterministic
kid (RFC 7638) so rotated keys are unambiguous.
- Convert an
x5c certificate chain in a JWK to a PEM bundle.
- Debug a "kid not found" or "key not matched" verification failure.
- Rotate signing keys and publish the new public JWK alongside the old one.
How to use it
- Pick the operation: PEM → JWK, JWK → PEM, JWKS generator, kid thumbprint, or JWT ↔ JWKS match.
- Paste the input (PEM block, JWK JSON, or JWKS).
- Set optional fields (
kid, use, alg) and choose public-only cleanup if publishing.
- Copy the converted output. For publication, host it at
.well-known/jwks.json.
- For full token sign / verify, hand off to the JWT & OAuth Toolkit.
Tips & pitfalls
- Public keys verify; private keys sign. Never publish a private JWK.
oct symmetric keys are secrets — do not place them in a published JWKS.
- Do not trust
kid, jku, or x5u alone — always apply issuer, audience, and allowed-algorithm checks in the verifier.
- RFC 7638 thumbprints are deterministic — same public key always yields the same
kid. Good for rotation.
- Keep both old and new public keys in the JWKS during a rotation window so existing tokens still verify.
- Some libraries cache JWKS aggressively — bust the cache when rotating.
FAQ
- How do I convert a PEM public key to JWK? Paste the PEM block into PEM → JWK and copy the JWK output.
- How do I publish a JWKS? Generate the JWKS from one or more public keys, run the public-only cleanup, and host the resulting JSON at
https://your-domain/.well-known/jwks.json.
- What is an RFC 7638 thumbprint? A SHA-256 hash of a canonical JWK representation, used as a stable
kid.
- How do I match a JWT to a JWKS key? Paste both — the tool finds the key by
kid and confirms alg compatibility.
- Is anything uploaded? No. All conversion and matching runs locally in your browser. The tool never fetches a remote JWKS URL.
- What algorithms are supported? RSA (
RS256, RS384, RS512, PS256, PS384, PS512), EC (ES256, ES384, ES512), and EdDSA.
Runs locally in your browser. No uploads. No remote JWKS fetches. Always strip private fields before publishing a JWKS.