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 GeneratorSteps
- 1
Open the RSA Key Generator tool
Go to the RSA key generator.
- 2
Choose a purpose
Pick encryption (RSA-OAEP) or signing (RSA-PSS), depending on what you need the keys for.
- 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
Generate and copy your keys
Get both the public and private key in standard PEM format.
Frequently asked questions
RSA-OAEP keys are for encrypting and decrypting data; RSA-PSS keys are for signing data and verifying those signatures — the two use different padding schemes and aren't interchangeable.
No — the key pair is generated and stays entirely within your browser's memory; nothing is transmitted during generation.
2048-bit is still considered secure for most practical purposes and is faster; 4096-bit is a more conservative choice if you specifically need a larger security margin.
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.

