RSA Key Pair Generator

Generate a new RSA public and private key pair in your browser and get both keys as PEM text. The keys are created locally and are not uploaded anywhere.

1 Pick your options

2 Your answer

Press Generate and your answer shows here.

How to use the RSA Key Pair Generator

  1. Choose a key size. 2048 bits is the common default, and 3072 or 4096 bits are stronger but slower to create.
  2. Pick whether the key pair is for encryption or for signing.
  3. Click Generate and wait a moment while the keys are created.
  4. Copy the public key for others to use, and keep the private key secret.

Frequently asked questions

What key size should I use for RSA?

2048 bits is the widely used minimum today. NIST guidance recommends 3072 bits or more for keys that must stay secure beyond about 2030.

What is the difference between SPKI and PKCS#8?

SPKI (SubjectPublicKeyInfo) is the standard format for public keys and uses the BEGIN PUBLIC KEY header. PKCS#8 is the standard format for private keys and uses the BEGIN PRIVATE KEY header. Both are encoded as PEM text here.

Are the generated keys safe to use?

The keys are created with the browser's built-in Web Crypto API and are not sent to any server. Store the private key securely, and never share it or commit it to source control.

Can I use the same key pair for encryption and signing?

It is better to use separate key pairs for each purpose. This tool creates a pair for either RSA-OAEP encryption or RSASSA-PKCS1-v1_5 signing.

Wrote something with AI? Slop Monkey rewrites it so it sounds like you, and keeps your facts.