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.
Generated keys
Choose your options and click “Generate key pair” to create a new RSA key pair.
Private key
This is a precomputed example key pair for demonstration only. Do not use it in production.
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.
RSA Key Pair Generator Help
How to use
- Choose a key size, a purpose (signing or encryption), and an export format.
- Click “Generate key pair” to create the keys in your browser.
- Copy the keys or download them as .pem or .json files.
Tips
- Everything runs locally in your browser; no key is ever uploaded.
- Use “Load example” to see a precomputed sample without generating one.
- Larger keys are more secure but take longer to generate.