RSA Key Pair Generator

Share:
Cybersecurity Tools

RSA Key Pair Generator

Generate 2048/3072/4096-bit RSA keypairs in PEM and JWK formats, in-browser.

By Last reviewed CRYPTO PEM RSA
Your browser is too old for this tool’s interactive features. Please update to Safari 13.1, Chrome or Edge 80, Firefox 74 or newer.

RSA Key Pair Generator

Privacy: Key generation runs entirely in your browser via the W3C SubtleCrypto API. The private key never leaves this page. We recommend you generate keys only for non-production use here; for production keys, use ssh-keygen, openssl, or a hardware security module.
Click "Generate keypair". The page then shows how long your browser took.
📅 Research current as of 25 Nov 2026 · Sources: NIST IR 8547 (October 2026) Table 2, SP 800-57 Part 1 Rev. 5 and FIPS 186-5, read 25 Nov 2026; the PEM import checked against OpenSSH 10.6p2 ssh-keygen
Standards, published formulas, and reference data are revised over time — check against a current authoritative source before relying on these figures.
Advertisement
After results · AD-W1 Responsive · Post-tool — peak engagement

How to use the RSA key pair generator

Pick a key size

NIST SP 800-57 rates 2048-bit RSA at 112 bits of security and 3072-bit at 128 bits; 3072 is the default here. A bigger key does not extend RSA's NIST timeline: NIST IR 8547 deprecates RSA signatures at 112-bit security and above, which covers every size this page offers, after 2030 and disallows them after 2035. The hash you pick is recorded only in the JWK's alg field (RS256, RS384 or RS512); the PEM keys are the same whichever you choose.

Click Generate

The browser's Web Crypto API finds the two primes, and the page then shows the time it took on your device. The time varies with the device and with luck in the prime search. As one measurement on one setup (Web Crypto in Node.js 26.13 on an Apple M4 Mac, 25 Nov 2026, 15 runs per size), the median 4096-bit key took about 310 ms, with single runs from 39 to 833 ms.

Copy or download the keys

You get the public key as SPKI and the private key as PKCS#8, each in PEM, plus both as JWK. Store the private key with restricted permissions, for example chmod 600 on Linux and macOS.

Use, then rotate

Use these keys for testing and learning. For production, generate keys on the machine or hardware that will use them, with openssl, ssh-keygen or a hardware security module, so the private key never passes through a web page.

Advertisement
After how-to · AD-W2 Responsive

How an RSA key pair is built, sized and stored

RSA is a public-key algorithm named after Ron Rivest, Adi Shamir and Leonard Adleman. A key pair rests on two large primes: the public key holds their product, the modulus, and an exponent; the private key holds the information needed to reverse the operation. Its security depends on how hard it is to factor the modulus. The current specification of RSA cryptography is RFC 8017 (PKCS #1 v2.2).

Choosing a key size

NIST SP 800-57 Part 1 Rev. 5 maps RSA key sizes to security strengths: 2048 bits gives 112 bits of security, 3072 gives 128, 7680 gives 192 and 15360 gives 256. NIST sets RSA's end dates in NIST IR 8547 (October 2026), which lists RSA among the quantum-vulnerable signature algorithms and says that "NIST will instead deprecate all quantum-vulnerable digital signature algorithms after 2030 and disallow their use under NIST standards and guidelines after 2035." That applies to RSA at 2048 bits and above, and to ECDSA and EdDSA too. It replaces the earlier SP 800-57 projection, under which only 112-bit keys such as RSA-2048 had an end date. This page defaults to 3072 for its 128-bit strength, not for a longer life.

"The exponent e shall be an odd, positive integer such that 216 < e < 2256." FIPS 186-5

The public exponent

Every key this page generates uses e = 65537 (0x10001), which satisfies FIPS 186-5. The small exponent e = 3 falls below the FIPS 186-5 lower bound.

PEM, PKCS#8, SPKI and JWK

The keys are the same numbers in different wrappers. PEM is base64-encoded DER between BEGIN and END lines: this page exports the public key as SubjectPublicKeyInfo ("PUBLIC KEY") and the private key as PKCS#8 ("PRIVATE KEY"). A JSON Web Key (RFC 7517) holds the same values as named base64url fields, the form published at JWKS endpoints. OpenSSH uses its own format, and this page makes RSA keys only, so it is not an SSH key generator; if you need one of these keys in OpenSSH form, ssh-keygen -i -m PKCS8 -f public.pem turns the public PEM into an ssh-rsa line, and ssh-keygen -y -f private.pem prints the same line from the PKCS#8 private key.

Alternatives and what comes next

Elliptic-curve keys are much smaller for similar strength: RFC 8032 describes Ed25519 as "intended to operate at around the 128-bit security level", the same as RSA-3072. For the longer term, NIST published three post-quantum standards on 13 August 2024: ML-KEM for key establishment (FIPS 203), and ML-DSA (FIPS 204) and SLH-DSA (FIPS 205) for signatures, because a large enough quantum computer would break RSA.

Key sizes by NIST strength, the FIPS 186-5 exponent, and the formats

01

NIST SP 800-57 rates 2048-bit RSA at 112 bits of security and 3072-bit at 128 bits.

02

NIST IR 8547 deprecates RSA signatures after 2030 and disallows them after 2035 at 112-bit security and above, which covers all three sizes offered here.

03

Matching 256-bit symmetric strength needs a 15,360-bit RSA modulus, according to SP 800-57.

04

FIPS 186-5 requires the public exponent to be odd and between 216 and 2256; 65537 qualifies, 3 does not.

05

This page exports the public key as SPKI and the private key as PKCS#8, in PEM and as JWK.

06

A JSON Web Key (RFC 7517) stores the same key material as named base64url fields.

07

RSA cryptography is specified in RFC 8017, PKCS #1 version 2.2.

08

RFC 8032 puts Ed25519 at around the 128-bit security level, comparable to RSA-3072.

09

NIST's three post-quantum standards, all published on 13 August 2024, are ML-KEM (FIPS 203), ML-DSA (FIPS 204) and SLH-DSA (FIPS 205).

10

The hash you pick changes only the JWK's alg field (RS256, RS384 or RS512); the PEM keys carry no hash.

Frequently asked questions

We do not recommend it. A private key generated in a web page passes through the browser's memory, where extensions and scripts on the page could reach it. For production, generate keys with openssl or ssh-keygen on the machine that will use them, or in a hardware security module.
NIST SP 800-57 rates 2048-bit RSA at 112 bits of security and 3072-bit at 128 bits, so 3072 is the stronger choice and the default here. Key size does not change the timeline: NIST IR 8547 deprecates RSA signatures after 2030 and disallows them under NIST standards after 2035, at 2048 bits and above alike. For keys that must outlast that, plan a move to a post-quantum signature such as ML-DSA (FIPS 204). 4096 adds margin; signing with it takes longer.
Generating a key means searching for two large random primes, testing candidates until two pass. Larger primes take longer to test and are rarer among candidates, so the time grows with key size and varies from run to run. The page shows the time your own browser took.
PEM is base64-encoded DER between BEGIN and END lines; this page writes the public key as SPKI and the private key as PKCS#8. OpenSSH uses its own format for keys in ~/.ssh. This page makes RSA keys only and is not an SSH key generator; to make an SSH key, run ssh-keygen on the machine that will use it.
A JSON Web Key, defined in RFC 7517, represents a key as a JSON object with named fields, encoded in base64url. Identity providers publish their public keys this way so that JWT signatures can be verified.
For a private key stored on disk, yes. This page produces keys without a passphrase; you can encrypt one afterwards, for example with openssl pkey -aes256 -in private.pem -out encrypted.pem.
When everything that must use the key supports it. RFC 8032 puts Ed25519 at around the 128-bit security level, like RSA-3072, with far smaller keys and signatures. RSA remains the choice where a system supports nothing else.
It is the e in the public key. FIPS 186-5 requires an odd e between 2^16 and 2^256, and 65537 (0x10001) is the smallest common value that qualifies. This page always uses it.
Yes. Once the page has loaded, keys are generated by the browser's Web Crypto API without any network request.
A sufficiently large quantum computer could. NIST has published replacement standards: ML-KEM (FIPS 203) for key establishment, and ML-DSA (FIPS 204) and SLH-DSA (FIPS 205) for signatures; and organisations are planning their migration. For data that must stay secret for many years, take that into account now.

Method & sources

How it computes

RSASSA-PKCS1-v1_5 key pair from the browser's Web Crypto API at 2048, 3072 or 4096 bits with e = 65537, exported as SPKI and PKCS#8 PEM and as JWK; the signing hash sets only the JWK alg (RS256, RS384, RS512). The page reports the reader's own generation time in milliseconds. Clear wipes the key text from the page. RSA keys only.

What this tool implements

  • The public exponent is e = 65537: FIPS 186-5 requires an odd e with 2^16 < e < 2^256. Key-size labels follow SP 800-57 Part 1 Rev. 5 Table 2: 2048 bits = 112-bit security, 3072 = 128-bit; 15360 for 256-bit.
  • NIST IR 8547 (October 2026) Table 2: RSA, ECDSA and EdDSA signatures are "Deprecated after 2030" and "Disallowed after 2035". NIST "will instead deprecate all quantum-vulnerable digital signature algorithms after 2030 and disallow their use under NIST standards and guidelines after 2035", replacing SP 800-57's earlier projection for 112-bit keys. A larger RSA key does not change those dates.
  • Post-quantum standards are named as NIST published them on 13 August 2024: ML-KEM (FIPS 203), ML-DSA (FIPS 204) and SLH-DSA (FIPS 205). Ed25519's ~128-bit security level is from RFC 8032.
  • The public PEM converts to an OpenSSH ssh-rsa line with ssh-keygen -i -m PKCS8, and ssh-keygen -y reads the PKCS#8 private key directly; checked on 25 Nov 2026 with OpenSSH 10.6p2 on a key from the same Web Crypto call and export formats. The page makes RSA keys only, not SSH keys of other types.
  • Timing: the page reports the reader's own time. The one reference it prints was measured on 25 Nov 2026 with Web Crypto in Node.js 26.13 on an Apple M4 Mac, 15 runs per size: the 4096-bit median was about 310 ms, single runs 39 to 833 ms.

Sources

Advertisement
Pre-footer · AD-W3 728 × 90