RSA Key Pair Generator
Generate RSA public/private key pairs in PEM format (1024, 2048, 4096-bit). Powered by the Web Crypto API and runs entirely in your browser.
How to use RSA Key Pair Generator?
- 1
Select the RSA key size (2048-bit is recommended for most uses).
- 2
Click Generate Key Pair. Larger keys take longer to compute.
- 3
Copy the PEM-formatted public and private keys.
- 4
Keep the private key secret — never share or commit it to source control.
Frequently Asked Questions
Is it safe to generate keys here?
Yes. Keys are generated locally in your browser using the Web Crypto API (crypto.subtle.generateKey). The private key never leaves your device and is not transmitted anywhere.
Which key size should I choose?
2048-bit is the modern standard and offers a strong balance of security and performance. 4096-bit provides extra security margin at the cost of speed. 1024-bit is considered weak and should only be used for legacy testing.
What format are the keys in?
Public keys are exported in SPKI (X.509 SubjectPublicKeyInfo) PEM format and private keys in PKCS#8 PEM format — the standard formats accepted by most libraries and tools.
Generate RSA Key Pairs Online
Quick Answer: RSA is an asymmetric algorithm using a public key to encrypt and a private key to decrypt. This tool generates a fresh key pair in PEM format locally in your browser.
RSA is one of the most widely used public-key cryptosystems, powering TLS/SSL, SSH, JWT signing, and secure messaging. In asymmetric cryptography you hold two mathematically linked keys: anyone can encrypt a message with your public key, but only your private key can decrypt it.
Public Key vs Private Key
- Public key: Safe to share. Used to encrypt data or verify signatures.
- Private key: Must stay secret. Used to decrypt data or create signatures.
- Security tip: Never paste a production private key into any online tool you don't trust. This tool runs client-side, but always treat private keys with care.