RSA Key Pair Generator

Pick a key size, click once, and get a matching RSA public and private key in PEM format ready to copy or download. The RSA keygen runs in your browser — no key ever leaves the page.

This RSA key generator creates a fresh public/private key pair online without a terminal or an openssl command in sight. Choose 2048, 3072 or 4096-bit, generate, and copy the RSA public and private key as standard PEM blocks — SPKI for the public key, PKCS#8 for the private one. It’s useful for local testing, seeding a dev environment, or learning how a key pair fits together. The generation uses the browser’s Web Crypto API, so the private key is produced on your machine and never transmitted.

Public key (PEM)
Click “Generate key pair” to create a fresh RSA-OAEP key.
Private key (PEM, PKCS#8)
The matching private key appears here. Keep it secret.
Keys are generated in your browser with the Web Crypto API and never sent anywhere. Larger sizes are stronger but slower to create — 4096-bit can take a few seconds.

How it works

  1. 1

    Pick a key size

    Choose 2048, 3072 or 4096-bit. Bigger keys are stronger but take longer to generate.

  2. 2

    Generate the pair

    Click generate and the matching public and private keys appear as PEM blocks.

  3. 3

    Copy or download

    Copy either key or save it to a .pem file. Keep the private key secret.

Instant & 100% private — nothing is uploaded

Everything runs locally in your browser. Your code, text and files are processed on your own device and are never sent to a server — so there are no upload waits, no size limits from us, and nothing is ever stored or logged.

Frequently asked questions

What format are the keys in?
PEM — the base64 blocks wrapped in BEGIN/END lines. The public key is SPKI and the private key is PKCS#8, which is what most libraries and tools expect.
Is this RSA keygen safe to use for real keys?
The keys are generated locally with the browser’s Web Crypto API and are never uploaded. For high-value production keys many teams still prefer generating on a hardened server, but for testing and development this is fine.
Which key size should I choose?
2048-bit is the common baseline and generates quickly. 3072 and 4096-bit are stronger and slower — 4096-bit can take a few seconds in the browser.
What can I do with the RSA public and private key?
The public key can encrypt data or verify signatures; the private key decrypts or signs. This pair is generated for RSA-OAEP encryption with SHA-256.
Are the same keys generated for everyone?
No. Each click produces a brand-new random key pair. Regenerating gives you a completely different public and private key.