How to Generate an RSA Key Pair

Published September 14, 2026 · 2 min read

Whether you need an RSA key pair for encrypting data or for signing and verifying it, this generates a real key pair using your browser's native Web Crypto API and exports both keys in standard PEM format.

Try RSA Key Generator

Steps

  1. 1

    Open the RSA Key Generator tool

    Go to the RSA key generator.

  2. 2

    Choose a purpose

    Pick encryption (RSA-OAEP) or signing (RSA-PSS), depending on what you need the keys for.

  3. 3

    Choose a key size

    2048-bit is standard for most uses; 4096-bit offers a larger security margin at the cost of speed.

  4. 4

    Generate and copy your keys

    Get both the public and private key in standard PEM format.

Frequently asked questions

Because generation happens locally using the Web Crypto API's own secure random source, you can create a fresh key pair without trusting a third-party key-generation service.

← Back to blog