JWK to PEM Converter
Convert keys between JWK (JSON Web Key) and PEM in either direction. Paste a JWK and get a PEM block, or paste a PEM key and get the equivalent JWK — the tool detects which you have and converts automatically. It supports RSA and EC (P-256/P-384/P-521) public and private keys, using the browser's built-in Web Crypto API, so your key material is processed entirely on your machine and never uploaded.
How to use the JWK to PEM Converter
Paste your key into the input box. If it begins with { the tool treats it as a JWK and produces a PEM block; if it begins with -----BEGIN it treats it as PEM and produces a JWK. There's nothing to configure — the key type (RSA or EC), the curve, and whether it's a public or private key are all read from the key itself, and the output appears below ready to copy.
For JWK input, a d field marks a private key, which exports as a PKCS#8 PRIVATE KEY block; otherwise you get an SPKI PUBLIC KEY block. For PEM input, the tool reads modern PRIVATE KEY (PKCS#8) and PUBLIC KEY (SPKI) blocks. Legacy RSA PRIVATE KEY (PKCS#1) and EC PRIVATE KEY (SEC1) blocks can't be imported by the Web Crypto API directly — the status line tells you the one-line OpenSSL command to convert them to PKCS#8 first.
JWK and PEM: two ways to write the same key
A cryptographic key is just a set of numbers, but those numbers need a container before they can travel between systems, and JWK and PEM are the two you'll meet most often. PEM is the older, ubiquitous format: base64-encoded binary (DER) wrapped between -----BEGIN----- and -----END----- lines. It's what OpenSSL, web servers, SSH and most of the TLS world speak. JWK is the JSON-native format from the JOSE family of standards (the same world as JWT) — a plain object with fields like kty, n and e for RSA, or crv, x and y for EC — designed to drop straight into a JSON config, a JWKS endpoint, or an API request body.
Underneath, both describe the identical key; only the packaging differs. The need to convert comes up constantly: a JWT library hands you a JWK but your TLS stack wants PEM, or you've generated a PEM keypair with OpenSSL and need to publish the public half as a JWK at a /.well-known/jwks.json endpoint. RSA and EC are the two key families in everyday use — RSA being the long-established choice and EC (elliptic curve) the smaller, faster modern one, with P-256 the most common curve — and a converter has to understand both. The fiddly part is the binary encoding rules (PKCS#8 for private keys, SPKI for public ones, with the older PKCS#1 and SEC1 layouts still floating around), which is exactly the kind of detail that's easy to get wrong by hand.
This converter offloads that to the browser's Web Crypto API, the same vetted implementation that powers HTTPS in the page. It imports your key, then re-exports it in the other format, which means the conversion is exact and the math is handled by code that's already trusted for production cryptography. Crucially, the API runs locally: your private key is never transmitted, logged or stored, so you can convert real keys — not just test ones — without the risk that comes from pasting secrets into a remote service.
Common use cases
- JWKS endpoints. Turn a PEM public key into the JWK you publish at
/.well-known/jwks.json. - JWT signing. Convert a JWK handed to you by an identity provider into the PEM your library expects.
- Cross-stack keys. Move a keypair between an OpenSSL/TLS world and a JOSE/JSON world.
- Inspection. Read a key's type, curve and parameters by converting it to the more legible format.