RSA Key Pair Generator

Generate RSA public and private key pairs in your browser, export them as JWK or PEM, and copy or download them instantly.

Key options

Your keys are generated and stored only in this browser tab. The private key never leaves your device.

Generated keys

Choose your options and click “Generate key pair” to create a new RSA key pair.

When to use RSA Key Pair Generator

Common ways to use RSA Key Pair Generator:

  • SSH and API key setup

    Create a fresh RSA key pair for SSH access or API authentication, then export the public key to a server and keep the private key secure.

  • Code and document signing

    Generate a signing key pair to produce verifiable signatures for software releases, documents, or messages using RSASSA-PKCS1-v1_5.

  • Encryption workflows

    Create an RSA-OAEP key pair to encrypt data with the public key and decrypt it with the private key in your own applications.

  • Testing and development

    Produce throwaway key pairs for local development, integration tests, and demos without touching your production keys.

  • Key rotation and audits

    Generate replacement key pairs during rotation or audits and compare sizes, exponents, and formats before deploying.

Frequently Asked Questions

Is my private key safe?
Yes. Keys are generated with your browser's Web Crypto API and stay in memory for the current tab only. Nothing is sent to a server, and the private key never leaves your device.
What is the difference between JWK and PEM?
JWK is a JSON representation of the key, convenient for APIs and JavaScript. PEM is the base64-encoded DER format wrapped in header lines, the standard for files and command-line tools.
Can I use the same key for signing and encryption?
This tool generates a key pair for one purpose at a time, because the Web Crypto API requires a specific algorithm per key. Choose signing for RSASSA-PKCS1-v1_5 or encryption for RSA-OAEP, and generate a separate pair if you need both.
Which key size should I choose?
2048 bits is the current minimum for most uses. 3072 bits offers a stronger margin, and 4096 bits is the most conservative choice. Larger keys take longer to generate.
Why does generation take a moment?
RSA key generation involves finding large prime numbers, which is computationally intensive. Larger key sizes take noticeably longer, especially 4096 bits.