RSA Key Pair Generator

Generate an RSA public/private key pair in PEM format — 2048, 3072 or 4096 bits — entirely in your browser.

Protect your private key. Anyone who has it can decrypt your messages and impersonate you. Never share it, never paste it into websites you don't trust, and store it somewhere safe. This page does not save it: if you close the tab without downloading it, it is gone.

🔒 Your data is processed locally in your browser and is never uploaded to our servers.

How to generate an RSA key pair

  1. Choose the key size: RSA-2048, RSA-3072 or RSA-4096.
  2. Click Generate key pair. The public and private keys appear in PEM format.
  3. Copy or download each key. Save the private key somewhere safe: this page doesn't keep it, and it's gone when you close the tab.

Which key size?

SizeSecurity levelUse
2048 bitsabout 112 bitsMinimum today; fine for most uses and the most compatible
3072 bitsabout 128 bitsRecommended for keys that must stay safe beyond 2030
4096 bitsabout 140 bitsLong-term keys; slower to generate and to use

Generating a 4096-bit key can take several seconds, especially on a phone: the browser must find two very large random prime numbers.

Public key and private key

Both are standard formats read by OpenSSL, Node.js, Python, Java, Go and most libraries. The keys use the public exponent 65537 and are created with the Web Crypto API, from your device's secure random generator.

Generate RSA keys with OpenSSL

TaskCommand
Private key, 3072 bitsopenssl genpkey -algorithm RSA -pkeyopt rsa_keygen_bits:3072 -out private.pem
Public key from itopenssl pkey -in private.pem -pubout -out public.pem
Show key detailsopenssl pkey -in private.pem -text -noout
Key for SSHssh-keygen -t rsa -b 4096 (or -t ed25519)

For SSH logins and Git, use ssh-keygen: SSH uses its own key format. Modern setups often prefer Ed25519 keys, which are shorter and faster.

Security notes

FAQ

Is the key really generated on my device?

Yes. Generation and export happen in your browser; no network request is made with your keys.

How do I test my keys?

Encrypt and decrypt a message with RSA Encrypt / Decrypt, or sign and verify with RSA Sign / Verify.

RSA or elliptic curves?

Elliptic-curve keys (ECDSA, Ed25519) give the same security with much shorter keys. RSA remains the most widely supported. See ECDSA Sign / Verify.