JWK to PEM Converter (and back)
Turn a JWK or a whole JWKS into PEM public keys and back, with the RFC 7638 thumbprint for each — computed in your browser.
Public keys only. Private members are dropped before the key is read, and nothing is uploaded.
Paste a JWK, a JWKS or a PEM public key to convert it.
How to use
- Paste a JWK, a JWKS document, or a PEM public key.
- Read the details: key type, size or curve, and the declared algorithm.
- Copy the PEM for a library that wants one, or the JWK for a JWKS.
- Use the thumbprint to check that two copies really are the same key.
- Paste several PEM blocks at once to convert a whole set.
About this tool
ShowHide
Identity providers publish their signing keys as a JWKS: a JSON document full of base64url numbers. Almost every library that verifies a token wants a PEM instead, and the two describe the same key in completely different shapes, so the gap has to be bridged by hand more often than it should be.
This converts either way. Paste a JWK, a whole JWKS, or one or more PEM public keys, and each key comes back in the other form along with what it actually is: key type, RSA size or elliptic curve, the algorithm and use if the key declares them, and the RFC 7638 thumbprint — the canonical fingerprint that identifies a key regardless of which fields happen to travel with it.
The conversion itself is done by the browser's own WebCrypto implementation rather than by hand-assembling ASN.1, so the bytes come from the same code that verifies signatures in your browser. Nothing is uploaded, and if a pasted JWK contains private key material the private members are dropped before anything else happens, with a note saying so.
Frequently asked questions
What is the RFC 7638 thumbprint?
A SHA-256 hash over a canonical JSON object containing only the members that define the key — for RSA that is e, kty and n, in that order, with no whitespace. Because everything else is excluded, two copies of the same key produce the same thumbprint even if one carries a kid, an alg and a use and the other does not.
Is the thumbprint the same as the kid?
Not necessarily. A kid is whatever the issuer chose to call the key, and it can be anything at all. Many issuers use the RFC 7638 thumbprint as the kid, which is why the two often match, but nothing requires it.
Can I convert a private key?
No. If a pasted JWK contains private members they are removed before the key is read, and only the public key is converted. Nothing is uploaded either way, but a private key does not belong in a web page.
Which key types work?
RSA and the NIST curves P-256, P-384 and P-521, plus Ed25519 where the browser supports it. Curves outside what WebCrypto implements — secp256k1, for instance — cannot be converted here.
Why does the output JWK not have an alg?
Because a PEM does not carry one. The importer has to be told an algorithm to read the key at all, so any alg in the result would be this tool's assumption rather than something the key stated, and it is removed instead.
Is my key uploaded?
No. The conversion runs in your browser using its built-in WebCrypto, and nothing is sent to a server.
Related tools
Keypair Generator (RSA, EC, Ed25519)
Generate an RSA, ECDSA, ECDH, Ed25519 or X25519 keypair in your browser and export it as PKCS#8 and SPKI PEM or as JWK.
Developer
Ed25519 Sign & Verify (RFC 8032)
Sign a message with an Ed25519 key or verify a signature in the browser, with the public key derived from the seed and R and S shown.
Developer
SSH Public Key Inspector
Read an SSH public key, authorized_keys or known_hosts line: algorithm, key size, SHA256 and MD5 fingerprints, comment and options.
Developer
PGP Public Key Inspector
Read an armored OpenPGP public key: full fingerprint, key ID, algorithm, size, creation and expiry dates, user IDs and subkeys.
Developer
JSON Canonicalize (RFC 8785 JCS)
Canonicalize JSON per RFC 8785 and hash it: UTF-16 key order, ECMAScript number form, no whitespace, with a SHA-256 of the exact bytes.
Developer
PBKDF2 Key Derivation
Derive a key from a password with PBKDF2-HMAC in your browser — pick the hash, iteration count and output length, and read the result as hex or Base64.
Developer