RSA Key Pair Generator 🔒 Runs locally in your browser — nothing is uploaded.

Generate a general-purpose RSA key pair as PEM, for signing or encryption.

Your private key is generated locally in your browser using the WebCrypto API. It is never uploaded, transmitted, or sent to any server. Store it securely — anyone who obtains your private key can decrypt your data or forge your signature.

Click "Generate key pair" to create a new RSA key pair.

About this tool

RSA is an asymmetric algorithm: it produces a mathematically linked pair of keys, a public key you can hand out freely and a private key you must never share. Whatever one key encrypts, only the other can decrypt — and whatever the private key signs, the public key can verify. That asymmetry is the basis of TLS certificates, SSH authentication, PGP email, and countless signing schemes across the web.

This generator creates that pair entirely in your browser using the WebCrypto API — the same battle-tested cryptographic engine built into every modern browser, not a JavaScript reimplementation of RSA. Choose a key size (2048-bit is the current baseline, 3072 or 4096 bit for longer-term or higher-assurance use) and a usage mode: signing (RSASSA-PKCS1-v1_5 with SHA-256, for verifying authenticity) or encryption (RSA-OAEP with SHA-256, for confidentiality). The keys never leave your device — nothing is uploaded, and closing the tab discards them for good, so copy or download them before you navigate away.

Both keys are exported in standard PEM format: the public key as an SPKI block, the private key as PKCS8 — the same encodings produced by OpenSSL, ready to drop into a `.pem` file, a config file, or any library that expects standard RSA key material.

Frequently asked questions

Which key size should I choose?

2048-bit is the current widely-accepted minimum and is fine for most uses through at least the next decade; choose 3072 or 4096-bit for longer-term or higher-security needs, at the cost of slower key generation and slightly slower operations.

What's the difference between signing and encryption keys?

A signing key (RSASSA-PKCS1-v1_5) proves authenticity and integrity — you sign data with your private key and others verify it with your public key. An encryption key (RSA-OAEP) does the opposite — others encrypt data with your public key and only your private key can decrypt it. They use different WebCrypto algorithms and shouldn't be mixed.