JWK to PEM Converter (and PEM to JWK)

Converts between JWK and PEM for RSA, elliptic-curve and Ed25519 keys. Accepts a JWK, a JWKS or PEM blocks.

Use the tool

Why this tool exists

JWKS endpoints and JOSE libraries use JWK. OpenSSL, nginx and many SDKs want PEM. Converting by hand means working with Base64url and ASN.1, which is easy to get wrong.

Paste a JWK or JWKS and get PKCS#8 and SPKI PEM, plus the RSA-specific PKCS#1 forms. Paste PEM and get a JWK with an RFC 7638 thumbprint as kid. The conversion uses WebCrypto, so it uses your browser's own key parsing. Results were checked against OpenSSL for RSA and EC keys.

How to use it

  1. Paste a JWK, a JWKS or one or more PEM blocks.
  2. Read the converted keys.
  3. Copy what you need.
  4. Delete private keys from the page afterwards.

Frequently asked questions

Which key types work?

RSA, EC with P-256, P-384 and P-521, and OKP with Ed25519. SEC1 "EC PRIVATE KEY" and encrypted PEM are rejected with a hint.

Why does the JWK from PEM have no alg?

A PEM key does not say which signing algorithm it will be used with, so alg and use are left out. Add them yourself.

Is my private key uploaded?

No. All conversion runs locally. Still, paste real production keys only on a machine you trust.

Are other curves such as secp256k1 supported?

No. WebCrypto does not support them.