RSA Key Pair Generator
Generate secure RSA public and private key pairs (up to 4096-bit) entirely in your browser. It runs entirely in your browser — no data is sent to any server, no account required, and it's completely free.
The Complete Guide to RSA Keys: Public-Key Cryptography Explained
RSA is the backbone of modern public-key cryptography. From TLS/HTTPS certificates to SSH authentication to PGP email encryption, RSA key pairs secure billions of connections every day. Our free RSA Key Generator creates 1024, 2048, or 4096-bit key pairs entirely in your browser — no server, no storage, no exposure.
How RSA Works
RSA is based on the mathematical difficulty of factoring the product of two large prime numbers. The process works as follows:
- Two large prime numbers (p and q) are randomly selected
- They are multiplied to produce the modulus n = p × q
- A public exponent (usually 65537) is chosen
- The public key is (n, e); the private key uses the modular inverse of e
- Anyone with your public key can encrypt data that only your private key can decrypt
RSA Key Sizes and Security Levels
- 1024-bit: Deprecated. Broken by well-funded attackers. Do not use for production.
- 2048-bit: Current standard. NIST-recommended until at least 2030. Used in most TLS certificates.
- 4096-bit: Future-proof. Significantly more secure but ~4× slower operations. Recommended for long-lived keys.
Common Use Cases
- SSH authentication: Replace password login with RSA key-pair authentication (more secure, more convenient)
- TLS/HTTPS certificates: Web servers use RSA keys in their TLS certificates
- JWT signing: RS256 JWTs use RSA private keys for signing and public keys for verification
- PGP/GPG email encryption: RSA keys encrypt email content end-to-end
- Code signing: Proving that software hasn't been tampered with
Private Key Security
Your private key is the crown jewel — losing it or exposing it compromises everything protected by the key pair. Best practices:
- Store private keys with filesystem permissions 600 (owner read-only)
- Encrypt private keys with a passphrase at rest
- Never commit private keys to version control (add *.pem to .gitignore)
- Rotate keys periodically — most organizations rotate annually
For general password generation, see our Password Generator. To hash data, use our Hash Generator.
How to Use the RSA Key Pair Generator
- 1
Select Key Size
Choose your desired key size (1024, 2048, or 4096 bits). 2048 bits is recommended for most applications.
- 2
Generate Keys
Click the Generate button. Your browser will instantly compute the public and private key pair.
- 3
Copy and Secure
Copy your generated public and private keys. Ensure you store your private key securely.
Frequently Asked Questions
Is this free RSA generator actually secure?
Yes. Our RSA generator relies entirely on your browser's native Web Crypto API. Because everything runs 100% locally on your device, your private keys are never transmitted over the internet or stored on our servers.
What RSA key size should I choose?
For standard use cases, 2048-bit keys provide an excellent balance of security and performance. 4096-bit keys offer maximum security but take slightly longer to generate securely.
What is PEM format and why do you use it?
PEM (Privacy Enhanced Mail) is the standard format for storing cryptographic keys, identifiable by the "-----BEGIN PRIVATE KEY-----" header. Because our free online generator outputs standard PEM format, your keys are instantly ready to be used with OpenSSL, SSH, and modern web applications.