Free RSA Key Pair Generator
Generate a cryptographic RSA public/private key pair in your browser. Choose 2048 or 4096 bits and export both keys in PEM format for use with OpenSSL, Node.js, SSH and web servers.
RSA gives you a key pair for asymmetric work, while AES handles bulk symmetric encryption. Once generated, tidy the output with the Key Formatter.
How to use the RSA Keys
- 1 Choose the key size — 2048 bits is the current minimum for anything real.
- 2 Generate the pair and wait while the browser does the maths.
- 3 Copy the public key to share, and keep the private key secret.
- 4 Store the private key somewhere safe; it cannot be recovered if lost.
How to Use
Select a key size and click Generate. Your private key is shown first — keep it secret and never share it. The public key can be distributed freely. Copy or download each key as a .pem file.
- RSA 2048-bit and 4096-bit options
- Private key exported as PKCS#8 PEM
- Public key exported as SPKI PEM
- Download as .key and .pub files, or copy
- Generated locally — your private key never leaves the browser
Keeping your private key safe
A private key is like a password — anyone who has it can impersonate you or decrypt your messages. Store it with restrictive file permissions, never commit it to source control, and rotate it if it may have been exposed.
Frequently asked questions
Is 2048 bits still enough?
Yes for now — 2048-bit RSA is still accepted by every major certificate authority and is estimated to hold until well past 2030. Many organisations have moved to 4096 for longer-lived keys, but the larger key makes every operation slower.
Is it safe to generate a key in a browser?
The generation uses the Web Crypto API, which draws from the operating system cryptographic random source, and the private key never leaves your device. That is safer than an online service that generates a key server-side, where you would have to trust it to discard its copy.
What is the difference between the public and private key?
The public key can be shared freely and is used to encrypt messages or verify signatures. The private key must never leave your control, because it decrypts those messages and creates the signatures. Anyone holding it can impersonate you completely.
Related Security & Cryptography Tools
You might also need
Tools from other categories that people pair with the RSA Keys: