RSA PEM to JWK

Import RSA PKCS8 private or SPKI public PEM and export a JWK.

Your workspace

Processed in your browser

Enter your values or try the example.

This utility converts RSA keys from standard PEM (Privacy-Enhanced Mail) format into the JSON Web Key (JWK) format. This is useful for integrating RSA keys into web applications, APIs, or libraries that require the JWK structure (RFC 7517).

How to convert your RSA key

  1. Paste your RSA PEM block into the input area. The tool accepts standard SPKI public keys or PKCS8 private keys.
  2. The tool automatically detects the key type and outputs the corresponding JWK JSON object, which you can copy for use in your application.

Supported formats and limitations

This tool strictly supports RSA keys in SPKI (Subject Public Key Info) or PKCS8 (Private-Key Information Syntax) formats. It does not support legacy PKCS1 formats, OpenSSH keys, or encrypted PEM files. Because this operation runs entirely within your browser using the Web Crypto API, your private keys are never transmitted to a server.

Example input and output

-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG...\n-----END PUBLIC KEY-----

{"kty":"RSA","n":"...","e":"AQAB"}

Questions about RSA to JWK conversion

Why does my key fail to convert?

Ensure your PEM block is properly formatted with the correct headers (e.g., '-----BEGIN PUBLIC KEY-----'). This tool does not support PKCS1 keys (which start with '-----BEGIN RSA PUBLIC KEY-----') or encrypted keys.

Is the output JWK safe to use?

Yes, the output is a standard JSON representation of your key. If you are converting a private key, ensure you handle the resulting JWK with the same security precautions as the original PEM file.

Continue your workflow

Explore more tools in this category for your next step.