JWK to PEM Converter
Convert JSON Web Keys (JWK) to PEM format and back using the Web Crypto API. Supports RSA, EC (P-256, P-384, P-521), and Ed25519 keys, 100% client-side.
Loading tool...
What is JWK to PEM Converter?
The JWK to PEM Converter transforms keys between JSON Web Key (JWK) format and PEM-encoded format using the native Web Crypto API, entirely in your browser. JWK is the JSON-based key representation used in JWT, JWKS endpoints, and OAuth/OIDC ecosystems, while PEM is the base64-encoded DER format standard for OpenSSL, SSH, and X.509 certificates. The tool supports RSA keys, elliptic curve keys (P-256, P-384, P-521), and Ed25519 keys in both public and private forms, auto-detecting the key type and producing standards-compliant SPKI or PKCS#8 PEM output. Nothing ever leaves your device.
Key Benefits
- Bridges the two most common asymmetric key formats without any server-side processing
- Uses the native Web Crypto API for standards-compliant, audited key import and export
- Supports RSA, EC (P-256/P-384/P-521), and Ed25519 β covering virtually all modern key types
- Auto-detects public vs. private keys and produces correct SPKI or PKCS#8 PEM output
- Bidirectional with a Swap button for instant round-trip verification
Common Use Cases
- β’Converting a JWKS endpoint key to PEM for use with OpenSSL or a backend TLS library
- β’Transforming an OpenSSL-generated PEM key into JWK for a JWT signing or JWKS endpoint
- β’Developers debugging OAuth/OIDC flows that involve both JWK and PEM key representations
- β’Students and engineers learning the relationship between JSON Web Keys and ASN.1/PEM formats
- β’Anyone who needs to move keys between browser-based crypto (Web Crypto, jose libraries) and command-line tools (openssl, ssh-keygen)
How to Use the JWK to PEM Converter
- Choose a Direction: Select JWK β PEM to convert a JSON Web Key into PEM format, or PEM β JWK to go the other way. The input and output labels update automatically.
- Paste Your Key: For JWK β PEM, paste a valid JWK JSON object (must include a "kty" field). For PEM β JWK, paste a PEM key with proper BEGIN/END headers.
- Click Convert: The tool imports your key via the Web Crypto API and re-exports it in the target format. RSA, EC, and Ed25519 keys are all supported.
- Copy or Swap: Copy the result to your clipboard, or use Swap to feed the output back as input and convert it back to verify a perfect round-trip.
Key Features
- Bidirectional JWK β PEM conversion with a single click
- Supports RSA, EC (P-256, P-384, P-521), and Ed25519 key types
- Auto-detects public vs. private keys from JWK fields or PEM headers
- Standard SPKI (public) and PKCS#8 (private) PEM output with 64-char wrapping
- Uses native Web Crypto API for standards-compliant key import/export
- 100% client-side β no network calls, keys never leave your device