Skip to content
D DocNectar

Free RSA Public/Private Key Pair Generator

Generate a new RSA public/private key pair in standard PEM format, ready to use with any RSA encryption or signing tool.

100% Free No Signup Works on all devices

Built and fact-checked by the DocNectar team — see our editorial standards

Thanks for rating!

Key Features

Instant Calculation

Get accurate results in real time with our optimized algorithm.

Mobile Friendly

Fully responsive design. Works on all devices & screen sizes.

Privacy Focused

Your data stays on your device. We don't store any inputs.

100% Free

No hidden costs. This tool is completely free forever.

RSA public-key cryptography starts with generating a key pair — a public key you can share freely, and a private key you must keep secret.

This tool generates a fresh RSA key pair in standard PEM format, ready to paste into the RSA Encryption Tool or any other software that accepts PEM-formatted RSA keys.

How it works

Choose a key size (2048-bit is the current standard for most uses; 4096-bit is stronger but slower) and the tool generates two large prime numbers, then derives a matching public and private key from them. Both are shown in PEM format — the standard, widely supported text format for cryptographic keys, beginning with lines like "-----BEGIN PUBLIC KEY-----".

  1. Enter key Size.
  2. Click Calculate to see your results.

Examples

Generating a 2048-bit key pair

Selecting 2048-bit produces a public key and private key pair suitable for most encryption and signing needs — the same size widely used across the web today.

Who should use it

  • Generating a key pair to use with the RSA Encryption Tool.
  • Learning what RSA public and private keys actually look like in PEM format.

Industry applications

  • SSH key-based authentication
  • Digital signatures and public-key infrastructure (PKI)

Advantages

  • Generates real, standards-compliant PEM keys usable in real software, not just a simulation.
  • Offers a choice between the current standard (2048-bit) and a stronger option (4096-bit).

Limitations

  • Keys aren't stored — you're responsible for saving them securely yourself.
  • 4096-bit generation and later use is noticeably slower than 2048-bit.

Common mistakes to avoid

  • Sharing the private key instead of the public key — only the public key is meant to be given out.
  • Losing the private key after closing the page — since nothing is stored, save both keys somewhere safe before navigating away.

Best practices

  • Save both keys to a secure location immediately after generating them, since they aren't stored anywhere on this site.
  • Use 4096-bit keys for long-term or especially sensitive use cases where the extra computation cost is acceptable.

Tips

  • Generate a fresh key pair for each distinct purpose rather than reusing the same one everywhere — that way, if one is ever compromised, it doesn't affect everything else.

Frequently asked questions

Yes, with no signup and no limit on how many key pairs you generate.
2048-bit is the current standard and is considered secure for the foreseeable future. 4096-bit offers a larger security margin but is noticeably slower to generate and to use for encryption — most tools and systems today default to 2048-bit.
No — each key pair is generated fresh for your request and isn't retained afterward. Since anyone with your private key can decrypt anything encrypted with the matching public key, treat it as sensitive and store it securely yourself.
The public key can be shared with anyone and is used to encrypt data (or verify a signature). The private key must be kept secret and is used to decrypt data (or create a signature) — never share your private key.
Yes — PEM is a standard, widely supported format, so these keys work with OpenSSL, most programming languages' crypto libraries, and many other tools, not just this site.

Get new calculators and guides in your inbox

No spam — just new tools like RSA Key Pair Generator and practical guides.

Favorites