Generate RSA public and private keys locally
Choose the key size, refresh the pair, and copy PEM output instantly — all in your browser

The RSA Key Pair Generator creates a public key and a private key for you, using your browser. You can copy them in PEM format and paste them into tools like OpenSSH, JWT libraries, or TLS test setups.
It’s especially useful when you need a quick key pair for development, local testing, demos, or learning — without installing OpenSSL or running shell commands.
Developers, DevOps engineers, and security-minded users who need RSA keys for SSH, signing, or encrypted messages.
Key generation runs locally in your browser. Still, treat private keys as secrets: don’t paste them into chat apps, issue trackers, or public repos.
If you plan to encrypt or sign text after generating keys, you may also like Encrypt / Decrypt Text and Hash Text for quick sanity checks.
Choose the key size in Bits.
Common choices are or .
Click the refresh icon to generate a new pair.
You’ll see a new Public key and Private key in PEM format.
Copy what you need.
Use the copy icon on the right side of each key box.
A quick way to reason about size is converting bits to bytes.
So the RSA modulus is about bytes.
Larger keys can be slower to generate, but the same conversion applies.
Expect larger PEM blocks and slower operations.
The Public key can be shared. The Private key must stay secret. In most workflows you keep the private key in a secure location and distribute the public key to anyone who needs to verify signatures or encrypt messages to you.
You want to understand how public/private keys work before using OpenSSH.
Input: .
Result: a public key you can distribute and a private key you protect.
You need a temporary RSA key pair to test RS256 token signing locally.
Input: .
Tip: use Hash Text to sanity-check encoded payloads.
You want to demonstrate that signatures verify with the public key, not the private key.
Input: .
Result: share the public key and show verification in your app.
You need multiple independent key pairs for test fixtures.
Tip: refresh to generate a fresh pair each time.
Create keys for dev-only configs and local services.
Show the relationship between public keys and private keys.
Copy and distribute only the public key.
RSA is often used to protect small secrets (like symmetric keys), not large files.
Practice key rotation workflows before doing them in production.
Compare PEM headers and check whether your library expects PKCS#1 or PKCS#8.
When you need to protect passwords or API secrets, avoid “rolling your own crypto”. For password storage, use Bcrypt instead.
Keep private keys out of logs. If you ever printed a private key into CI logs, assume it’s compromised and rotate it immediately.
RSA is commonly used for key exchange or signatures. For encrypting large text blobs directly, a hybrid approach (RSA + symmetric encryption) is typically faster.
For quick symmetric encryption demos, try Encrypt / Decrypt Text.
RSA key generation is not a simple “calculator formula”, but the core relationships are worth knowing. Conceptually, RSA builds a modulus from two large primes.
The generator picks suitable primes and computes the private exponent. The Bits setting mainly controls the approximate size of .
PEM is a text encoding with headers like . It’s widely supported, easy to copy, and friendly for configuration files.
Many systems display a short fingerprint of a public key. It’s a compact identifier, not a secret.
RSA is asymmetric. Symmetric ciphers (AES, etc.) are much faster for large data. In practice you often combine them.
Rotation means replacing a key pair with a new one, updating all consumers of the public key, and retiring the old private key.
For development and testing, it’s usually fine. For production, prefer generating keys on a trusted machine and storing them in a secrets manager or HSM.
A common baseline is bits. If you want a bigger margin, use . Higher values can be slower.
The private key encodes additional parameters needed for signing/decryption. The public key mainly includes and .
Yes. That’s the point. The private key is the one that must remain secret.
RSA key generation requires finding large primes. Larger means more work.
This tool outputs a public key as (SPKI) and a private key as (PKCS#1). Some libraries expect PKCS#8, so you may need conversion.
Check whether it expects PKCS#1 vs PKCS#8, and whether it wants a public key in SPKI vs PKCS#1 format. Also ensure you copied the full header and footer lines.
This tool is meant for education, demos, and development workflows. It does not replace professional security guidance.
Want to keep everything in-browser? Pair RSA key generation with lightweight checks like HMAC Generator and Hash Text to validate payloads and signatures in test flows.
Use a simple chronometer (stopwatch) to track elapsed time down to milliseconds. Runs locally in your browser.
Normalize email addresses to a standard format for easier comparison. Useful for deduplication and data cleaning. Runs locally in your browser.
Estimate the time needed to consume a total amount at a constant rate, and get an expected end time. Runs locally in your browser.
Parse and decode your JSON Web Token (JWT) and display its content. All computation runs locally in your browser.
Know which file extensions are associated to a MIME type, and which MIME type is associated to a file extension. Includes a full MIME types table.
Generate random Lorem Ipsum placeholder text with customizable paragraphs, sentences, and word counts. Runs locally in your browser.