01What is RSA Key Generator?
RSA Key Generator gives you a fresh RSA key pair as two PEM text blocks, ready to paste into a config file or a test. It exists for the moment when you need a key right now and don't want to remember OpenSSL flags. Under the hood it calls the browser's Web Crypto API, crypto.subtle.generateKey, with a modulus of 2048 or 4096 bits and the public exponent fixed at 65537. The key is created for RSA-OAEP with SHA-256, then exported in two standard shapes. The public key comes out as SubjectPublicKeyInfo, defined in RFC 5280, between -----BEGIN PUBLIC KEY----- lines. The private key comes out as an unencrypted PKCS#8 structure from RFC 5208, between -----BEGIN PRIVATE KEY----- lines. The base64 body is wrapped at 64 characters per line, the way RFC 7468 describes PEM text. Those are the formats OpenSSL, Node's crypto.createPrivateKey, Java's KeyFactory and most JWT libraries read without conversion. The exported files carry the generic rsaEncryption identifier rather than an OAEP-only one. In practice that means the same pair also works for RS256 or PS256 signing. Here's what a typical run looks like. Pick 2048-bit and click Generate Key Pair. The public key is seven lines of base64 that start with MIIBIjANBgkqhkiG9w0BAQEF. The private key runs to about 26 lines. Pick 4096-bit and the public key grows to twelve lines starting MIICIjANBgkq. The private key comes in at around 50 lines. We loaded our own generated private keys back into Node, and it reported an RSA key with the expected modulus length and exponent 65537. Each block has Copy and Download buttons, which save public_key.pem and private_key.pem. A Key Details panel repeats the size, algorithm, format and exponent so you can confirm what you made. The key material is created by your browser's own crypto engine and stays in that tab until you copy or download it. Still, treat a browser-made private key as a development key. There are clear limits. You only get 2048 or 4096 bits, and the exponent can't be changed. The private key has no passphrase. The tool doesn't output PKCS#1 (BEGIN RSA PRIVATE KEY) or OpenSSH formats. It doesn't compute fingerprints or build certificate signing requests either. OpenSSL and ssh-keygen cover those steps, and the how-to below shows the conversion commands. A 4096-bit key can take a few seconds, since the browser has to find two large primes.
Backend developers who need a PEM key pair for JWT or encryption tests and don't want to dig through OpenSSL flags to get one. The tool runs entirely in your browser, so your data never leaves your device.
02How to use RSA Key Generator
- Under Key Size, choose 2048-bit (faster) or 4096-bit (larger, slower to generate).
- Click Generate Key Pair and wait for the public and private PEM blocks to appear.
- Check the Key Details panel for size, algorithm, format and the 65537 exponent.
- Use Copy or Download on each block to get public_key.pem and private_key.pem.
- Convert if needed: openssl rsa -in private_key.pem -traditional gives PKCS#1, and ssh-keygen -i -m PKCS8 -f public_key.pem gives an OpenSSH public key.
03Worked examples
- Input:
Key Size 2048-bit, Generate Key Pair (public key) - Result:
-----BEGIN PUBLIC KEY----- MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A... (7 lines of base64) -----END PUBLIC KEY----- - Trimmed. Keys are random, so only the fixed prefix and line count repeat. Produced with the same Web Crypto calls the tool makes.
- Input:
Key Size 2048-bit, Generate Key Pair (private key) - Result:
-----BEGIN PRIVATE KEY----- MIIEvQIBADANBgkqhkiG9w0BAQEFAASC... (26 lines of base64) -----END PRIVATE KEY----- - Trimmed. The first few characters after MIIE can vary slightly between runs because the encoded length shifts by a byte or two.
- Input:
Key Size 4096-bit, Generate Key Pair (public key) - Result:
-----BEGIN PUBLIC KEY----- MIICIjANBgkqhkiG9w0BAQEFAAOCAg8A... (12 lines of base64) -----END PUBLIC KEY----- - Trimmed. The private key for this size is about 50 lines.
- Input:
Load the generated private_key.pem with Node's crypto.createPrivateKey - Result:
asymmetricKeyType: rsa modulusLength: 2048 publicExponent: 65537 - Shows the PKCS#8 output loads without conversion and carries the fixed 65537 exponent.
04Common use cases
- Creating an RS256 key pair to sign and verify JWTs in a local API before the real keys exist in a secrets manager
- Generating throwaway keys for unit tests and fixtures so the repo never holds a real private key
- Trying RSA-OAEP encryption with Web Crypto or Node.js and needing a matching public and private key fast
- Getting a PKCS#8 private key to feed into openssl req while practising CSR and self-signed certificate steps
- Setting up a staging OAuth or SAML integration that asks you to upload a PEM public key
- Showing students what a SubjectPublicKeyInfo block looks like and how it differs from PKCS#8
05Tips
- NIST SP 800-57 treats 2048-bit RSA (about 112-bit security) as acceptable through 2030. For keys that must outlive that, make 3072 bits or more with OpenSSL.
- The private key has no passphrase. Wrap it with openssl pkcs8 -topk8 -v2 aes-256-cbc, or store it in a secrets manager, before it touches a shared disk.
- For production signing keys, generate them where they will live (a KMS, an HSM or the server) so the private key never passes through a clipboard.
- Run openssl pkey -in private_key.pem -noout -text to see the modulus, exponent and primes you just generated.
- If a library rejects BEGIN PRIVATE KEY and wants BEGIN RSA PRIVATE KEY, it expects PKCS#1. Convert with the openssl rsa -traditional command rather than editing the header by hand.
06Related concepts
Public key cryptography, PEM format, PKCS#8, SubjectPublicKeyInfo, RS256.
Frequently Asked Questions
What is RSA Key Generator?
RSA Key Generator is a free, browser-based developer tool on AIDToolStack. Generate RSA public/private key pairs in PEM format using Web Crypto API. It requires no installation or sign-up and works entirely in your browser.
Is RSA Key Generator free to use?
Yes. No sign-up, no fees and no usage cap.
Does RSA Key Generator store my data?
No. It runs in your browser; nothing is uploaded.