Skip to content

Menu

JWK to PEM Converter

Convert RSA and EC P-256/P-384 keys between JWK and PEM (SPKI or PKCS#8) and get the RFC 7638 JWK thumbprint. Uses Web Crypto in your browser.

Runs entirely in your browserCrypto & HashingFree, no sign-up
Loading tool

01What is JWK to PEM Converter?

JOSE libraries, JWKS endpoints and OAuth servers describe keys as JSON Web Keys (RFC 7517). OpenSSL, Nginx, Java and most TLS tooling expect PEM files instead. This converter moves a key between the two and computes its JWK thumbprint. It helps when you need to check a token signature with OpenSSL, or publish an existing PEM key in a JWKS. Paste either format and the tool detects which one it is. A JWK becomes a PUBLIC KEY block (SubjectPublicKeyInfo). If the JWK holds a private key, you also get a PRIVATE KEY block in unencrypted PKCS#8. A PEM public or private key becomes a public JWK, plus a private JWK when the input is private. The PEM labels and base64 layout follow RFC 7468, which defines these text encodings. Supported keys are RSA and elliptic curve keys on P-256 and P-384. RFC 7518 defines how these keys appear in a JWK, such as n and e for RSA and crv, x and y for EC. The conversion itself is done by the browser's Web Crypto API, which imports the key and exports it in the other format. The tool reads only the algorithm identifier from the DER so it can tell Web Crypto what kind of key it is. The thumbprint follows RFC 7638. It hashes only the required public members (e, kty and n for RSA; crv, kty, x and y for EC) in sorted order with no whitespace, using SHA-256, and encodes the result as base64url. A private key and its public key give the same thumbprint. That makes the thumbprint useful as a stable kid value. As an example, load the built-in RFC 7638 RSA sample. It is a public JWK with alg RS256 and kid 2011-04-29. The tool outputs a PUBLIC KEY PEM block and the thumbprint NzbLsXh8uDCcd-6MNwXF4W_7noWXFZAfHkxZsRGC9Xs. That value matches the worked example in RFC 7638. No private PEM appears, since the input holds no private members. We also compared output with Node's OpenSSL-backed crypto module for freshly generated RSA 2048, P-256 and P-384 keys in both directions, and the JWK members and SPKI bytes matched. Limits: PKCS#1 (BEGIN RSA PRIVATE KEY), SEC 1 (BEGIN EC PRIVATE KEY) and encrypted PKCS#8 files are refused, with the OpenSSL command to convert them first. Ed25519, P-521, secp256k1 and symmetric oct keys are not supported. Optional members such as alg, kid, use and key_ops are dropped, because PEM cannot hold them. Keys never leave your browser.

Developers working with JWT, OAuth, OpenID Connect or JOSE who need to move keys between JSON-based libraries and PEM-based tooling. The tool runs entirely in your browser, so your data never leaves your device.

02How to use JWK to PEM Converter

  1. Paste a JWK object or a PEM block that starts with -----BEGIN PUBLIC KEY----- or -----BEGIN PRIVATE KEY-----
  2. Check the detected format and key type shown under the input
  3. Copy the thumbprint if you need a key ID
  4. Copy the converted PEM or JWK output
  5. If you see an error about PKCS#1 or SEC 1, run the OpenSSL command it gives and paste the result

03Worked examples

Input: {"kty":"RSA","n":"0vx7agoebGcQ...KnqDKgw","e":"AQAB","alg":"RS256","kid":"2011-04-29"} (RFC 7638 example key)
Result: RSA 2048-bit public key Thumbprint: NzbLsXh8uDCcd-6MNwXF4W_7noWXFZAfHkxZsRGC9Xs -----BEGIN PUBLIC KEY----- MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0vx7agoebGcQSuuPiLJX ... gwIDAQAB -----END PUBLIC KEY-----
The thumbprint matches the value printed in RFC 7638 section 3.1. The PEM body is trimmed.
Input: {"kty":"EC","crv":"P-256","x":"pxqfiaqE7GTHl8kMjBwr9QA85oqTHufwvmIonf1697Q","y":"7WQy-sUMH8KxxUvgEtcYI2otoesb6MNeCL54K5J0hlE"}
Result: EC P-256 public key Thumbprint: pq4M7QzlAOVfeDF8f8FkngGrSkw4Hk-IRXupH6Tq6Lk -----BEGIN PUBLIC KEY----- MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEpxqfiaqE7GTHl8kMjBwr9QA85oqT HufwvmIonf1697TtZDL6xQwfwrHFS+AS1xgjai2h6xvow14IvngrknSGUQ== -----END PUBLIC KEY-----
A P-256 public JWK becomes a short SPKI PEM block. The full output is shown.
Input: -----BEGIN PUBLIC KEY----- MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0vx7agoebGcQSuuPiLJX ... gwIDAQAB -----END PUBLIC KEY-----
Result: { "kty": "RSA", "n": "0vx7agoebGcQSuuPiLJX...KnqDKgw", "e": "AQAB" } Thumbprint: NzbLsXh8uDCcd-6MNwXF4W_7noWXFZAfHkxZsRGC9Xs
Going the other way gives back the same modulus and thumbprint as the RFC JWK. The n value is trimmed.
Input: {"kty":"oct","k":"GawgguFyGrWKav7AX4VKUg","alg":"HS256"}
Result: Symmetric (oct) keys have no PEM form
HMAC secrets are not public/private key pairs, so there is nothing to put in a PEM block.
Input: -----BEGIN RSA PRIVATE KEY----- ... -----END RSA PRIVATE KEY-----
Result: RSA PRIVATE KEY is PKCS#1, which Web Crypto cannot import. Convert it with: openssl pkey -in key.pem (private) or openssl rsa -RSAPublicKey_in -pubout (public).
Older OpenSSL output uses the PKCS#1 header. The tool tells you the openssl command that rewrites it as PKCS#8.
Input: {"kty":"EC","crv":"P-521","x":"AQ","y":"AQ"}
Result: Unsupported curve P-521. Only P-256 and P-384 are supported.
Curves outside P-256 and P-384 are rejected before any import is tried.

04Common use cases

  • Turning a key from a JWKS endpoint into a PEM file for OpenSSL or a JWT library that wants PEM
  • Converting a PEM private key into a JWK for a JOSE library or a DPoP client
  • Computing a key's RFC 7638 thumbprint to use as a kid value
  • Checking which public key a private PEM file belongs to by comparing thumbprints
  • Inspecting the curve and modulus size of a key before deploying it

05Tips

  • Paste one key from a JWKS, not the whole keys array
  • Add your own kid, use or alg back to the JWK output if your system needs them
  • The thumbprint is the same for a private key and its public key, so it is a safe way to match them
  • Avoid pasting production private keys into any web page you do not control, even one that runs locally

06Related concepts

JSON Web Key, JWK thumbprint, PEM, SubjectPublicKeyInfo, PKCS#8, Web Crypto API.

Frequently Asked Questions

What is JWK to PEM Converter?

JWK to PEM Converter is a free, browser-based developer tool on AIDToolStack. Convert RSA and EC P-256/P-384 keys between JWK and PEM (SPKI or PKCS#8) and get the RFC 7638 JWK thumbprint. Uses Web Crypto in your browser. It requires no installation or sign-up and works entirely in your browser.

Is JWK to PEM Converter free to use?

Yes. No sign-up, no fees and no usage cap.

Does JWK to PEM Converter store my data?

No. It runs in your browser; nothing is uploaded.

Related Tools

Reviews and commentsShow

Reviews

Sign in to leave a review.

Loading reviews…

Comments

Sign in to leave a comment.

Loading comments…

What changed in AI dev tools, once a month

Renames, shutdowns, pricing changes and new MCP setups, each with a source.

Subscribe