RSA Key Pair Generator

Generate RSA key pairs of 2048, 3072 or 4096 bits in your browser. Download PEM files in PKCS#8 or PKCS#1 format, or export as JWK.

RSA keys without installing anything

The generator uses your browser’s Web Crypto API to create an RSA key pair with the standard public exponent 65537, then exports the public key as SPKI and the private key as PKCS#8 PEM, the formats OpenSSL, Java, Node.js and most libraries expect. Switch to PKCS#1 for older software that wants BEGIN RSA PRIVATE KEY, or to JWK for JSON-based systems like JWKS endpoints.

Generation takes a moment, especially at 4096 bits, because the browser has to find large random primes.

Which key size?

  • 2048 bits is the minimum still considered acceptable and gives about 112 bits of security.
  • 3072 bits gives about 128 bits of security and is the recommended choice for keys that must stay safe beyond 2030.
  • 4096 bits adds margin at the cost of slower signing.

For new SSH keys and signatures, Ed25519 is usually a better choice than RSA: smaller, faster and simpler to use safely.

Frequently asked questions

Is it safe to generate an RSA private key in a browser?

The key is created and kept in this tab by the Web Crypto API, and nothing is sent anywhere. For keys that protect production systems, many teams still prefer generating them on the machine that will use them, with the openssl command on this page.

What is the difference between PKCS#1 and PKCS#8?

PKCS#1 is an RSA-only format (BEGIN RSA PRIVATE KEY). PKCS#8 wraps keys of any type with an algorithm identifier (BEGIN PRIVATE KEY). Both hold the same key, and OpenSSL converts between them.