RSA Key Pair Generator

Free RSA key pair generator. Create a 2048, 3072, or 4096-bit RSA key pair for signing or encryption, exported as PEM β€” generated entirely in your browser.

Public key (SPKI, PEM)
Private key (PKCS#8, PEM)

Frequently asked questions

Is it safe to generate an RSA key pair in a web page?

Key generation and export both run through the browser's native Web Crypto API (crypto.subtle) β€” the same cryptographic engine the browser itself relies on for HTTPS, not a hand-written implementation. Nothing is sent to any server: the private key is generated, displayed, and discarded entirely on your device. Still, for keys protecting something important in production, many teams prefer generating them with established tooling (e.g. OpenSSL) in an offline or controlled environment rather than a browser tab.

What is the difference between a signing key and an encryption key?

A signing key pair (RSASSA-PKCS1-v1_5) is used to prove authenticity β€” the private key signs data, and anyone with the public key can verify that signature came from the holder of the private key, without being able to forge one. An encryption key pair (RSA-OAEP) is used for confidentiality β€” anyone with the public key can encrypt a message that only the private key holder can decrypt. The two use different padding schemes and aren't interchangeable.

What modulus length should I use?

2048 bits is the current widely-accepted minimum for RSA and is still standard for most TLS certificates. 3072 bits roughly matches 128-bit symmetric security and is recommended for longer-term use. 4096 bits offers more margin but is noticeably slower to generate and to use β€” diminishing returns for most purposes, since 3072 is already considered strong for the foreseeable future.

What is PEM format?

PEM (Privacy-Enhanced Mail) is a text format for encoding cryptographic keys and certificates: base64-encoded binary data wrapped with "-----BEGIN ...-----" and "-----END ...-----" header/footer lines. It's the format most tools (OpenSSL, SSH, TLS libraries) expect when you paste in or load a key file.

What formats are the exported keys in?

The public key is exported as SPKI (SubjectPublicKeyInfo) and the private key as PKCS#8 β€” both standard, widely-supported encodings, wrapped as PEM text. These are the same formats produced by modern OpenSSL commands like openssl genpkey.