Use this free RSA key generator to create a key pair in your browser. Choose a key size and purpose, generate the keys, then copy or download them in PEM format. The keys are created with the browser's built-in cryptography and are never sent to a server.
A private key is the secret part of the pair. Keep it private, store it in a secure place, and never share it in a chat, email, or ticket.
How to use the RSA key generator
- Choose the purpose: signing keys use RSA-PSS to sign data. Encryption keys use RSA-OAEP to encrypt small secrets.
- Pick a size: 2048 bits is the minimum for new keys. 3072 or 4096 give more margin for long-lived keys.
- Generate: click Generate key pair. The public and private keys appear as PEM text.
- Save: copy or download the keys. Store the private key somewhere secure.
Key sizes at a glance
| Key size | Status | Typical use |
|---|---|---|
| 2048 bits | Minimum for new keys | Short to medium-term keys and most TLS and signing uses. |
| 3072 bits | Stronger margin | Keys that must stay secure for many years. |
| 4096 bits | Highest common size | Long-lived root or signing keys where speed is not critical. |
What the output looks like
The public key is exported in SPKI format and the private key in PKCS #8 format, both wrapped in PEM headers. The fingerprint is a SHA-256 hash of the public key, which lets you confirm that two copies match without comparing the whole key.
Worked example
A 2048-bit signing key produces a public key of about 400 Base64 characters between the PEM header lines. Signing a file with the private key and checking it with the public key confirms both who signed the file and that it has not changed since.
Common key mistakes
- Sharing the private key. Anyone with it can sign as you or read data encrypted to you.
- Using one key for two purposes. Keep signing and encryption keys separate.
- Losing the private key. Without it, data encrypted to the public key cannot be recovered. Keep a secure backup.
- Keeping keys in plain text files. Store production keys in a password manager, a secrets vault, or a hardware token.
Frequently asked questions
Is this RSA key generator free?
Yes. There is no sign-up and no limit on how many key pairs you create.
Are my keys sent or stored?
No. The keys are created in your browser and nothing is sent to a server. Clear the keys or close the page when you are finished, and keep your own copies safe.
Is it safe to generate production keys here?
For production systems, generate keys on a trusted machine or in a key management service, and store the private key in a secure vault. This tool is best for testing, learning, and personal use.
What is the difference between RSA-PSS and RSA-OAEP?
RSA-PSS is used for signatures. RSA-OAEP is used for encrypting small amounts of data, such as a symmetric key. Use each only for its purpose.
Why is the key generation slow?
Finding two large prime numbers takes time, and the larger the key, the longer it takes. Your device speed also matters.