Skip to content

PEM ↔ JWK Converter

Convert PEM-encoded keys to JSON Web Keys (JWK) and back using the Web Crypto API. Supports RSA and EC (P-256 / P-384 / P-521). Everything runs in your browser — nothing is sent to a server.

PEM ↔ JWK controls

How it works

Paste a PEM block or a JWK, choose the direction (PEM → JWK or JWK → PEM), and convert using the browser Web Crypto API. Supported material includes RSA and elliptic-curve keys on P-256, P-384, and P-521 in common SPKI / PKCS#8 (and related) PEM wrappers.

Pretty-print controls JSON readability for JWK output. You can include or omit private fields when exporting JWK. Encrypted PEM is not supported — decrypt locally first if needed.

Keys are not uploaded to Formattly. Still treat private keys carefully: clear the page when done and avoid pasting production private keys into any shared machine.

When to use this tool

Tips

Frequently asked questions

What are PEM and JWK?

PEM is a Base64 text encoding of ASN.1 DER keys (BEGIN/END PUBLIC KEY or PRIVATE KEY blocks), widely used by OpenSSL and TLS. JWK (JSON Web Key) is a JSON representation of the same cryptographic key material, common in JOSE/JWT and Web Crypto APIs.

Which key types does this PEM ↔ JWK converter support?

RSA and elliptic-curve keys on P-256, P-384, and P-521. PEM input accepts SPKI (PUBLIC KEY), PKCS#8 (PRIVATE KEY), and common PKCS#1 wrappers (RSA PUBLIC/PRIVATE KEY; EC PRIVATE KEY when a named curve is present). Encrypted PEM is not supported.

Does my key leave my browser?

No. Conversion runs entirely in your browser with JavaScript and the Web Crypto API. Keys are not uploaded to a server. Prefer local tools for production secrets when possible.

Is this PEM ↔ JWK converter free?

Yes. The Formattly PEM ↔ JWK converter is free to use with no signup required.

Can I convert encrypted PEM files?

No. Encrypted PEM is not supported. Decrypt the key with a local tool (for example OpenSSL) first, then paste the unencrypted PEM if you still want a browser-side conversion.