RSA key pair generator

Generate an RSA key pair (public and private) in standard PEM format for your encryption or signing tests. Generation uses your browser's native WebCrypto API: the private key is created locally and is never sent to a server, including the one hosting this page.

Example:

How it works

RSA is an asymmetric encryption algorithm based on a pair of mathematically linked keys: what the public key encrypts (or what the private key signs) can only be decrypted (or verified) with the other key of the pair. This tool calls crypto.subtle.generateKey directly, the browser's native, audited RSA implementation, then exports both keys in PEM format (Base64 wrapped between -----BEGIN...----- headers), ready to use with most libraries and tools (OpenSSL, Node.js, Python).

Which key size should I choose?

2048 bits is today the commonly recommended minimum and remains more than sufficient for most uses for several years to come. 3072 or 4096 bits offer an additional safety margin, at the cost of slower operations, for data that must stay protected over the very long term.

Should I choose "signing" or "encryption"?

In practice, a given RSA key pair should normally be dedicated to a single technical use: "signing" (RSASSA-PKCS1-v1_5) is used to prove the authenticity of a document without making it secret; "encryption" (RSA-OAEP) is used to make content unreadable to anyone who does not have the private key. Choose the option that matches your actual need.

Privacy: generation happens 100% locally via your browser's WebCrypto API — the private key is never sent to or stored on a server, at any point.