Generate RSA key

Generate an RSA key pair with a selected modulus size.

freeworks offlinenothing uploaded
ToolRSA Key Generator
Input
Output

How it works

RSA chooses two large primes, multiplies them into a modulus, and derives public and private exponents using the totient or Carmichael function. The generated key is serialized as PKCS#1 or PKCS#8 with the selected bit length.

  • 2048-bit RSA remains a common interoperability baseline.

Worked example

Generate 2048-bit RSA Key Pair
Generate an RSA key pair in JWK format for encryption or signing
Input
											Modulus length: 2048
Format: jwk
										
Output
												=== Public Key (JWK) ===
{
  "alg": "RSA-OAEP-256",
  "e": "AQAB",
  "ext": true,
  "key_ops": [
    "encrypt"
  ],
  "kty": "RSA",
  "n": "u6Hl9VdBVj69KwH8qA250lo6-NoowgXSAII3rjPpP_PVp_2O1w6DyQnw-di-0bLuq4ofVM5KUL3AIp5935M-phB4YmfBLknh356XihP83lkfyFbfCE7cUm-d6FNaD8X91Zz45AmvVHtyyMU_hOZbB33J9BFpu-MYCn7yp9Bmd0kT6OLe8OlksXcKW1c1PffeG_0zKnJbwgldbdvGn8mPfbvUMigZltToskN9YQBA1sT-XEna4TXf3iIegUszfoAiOLobbsIyFurCWQnvfNB-C8j1sKp_T3vcwHnO6gs-vvCs10aS5fn5uSlhe9h0LjlHDIc3MIvc76zV7hGR9gJA5Q"
}

=== Private Key (JWK) ===
{
  "alg": "RSA-OAEP-256",
  "d": "LRtHmApo553fhhZNMe1SzbHpWWfAwpv5lyu2zQcnvLsWkvMOwr53if3802N6xBi67bwfuhh5nx1usiPd6MCSIAP3nNiKhWE3jrWmgog5kw5j6JqRtYKXzq2MjYx0KzSSyCabYt69Kpceygs5MO7b1Vo1…
											

When to use this

TLS requests, signing fixtures, and legacy key rotation generate RSA pairs.

Edge cases

  • A modulus below the selected size weakens the intended security level.
  • A private key must never be shared as the public key.
  • RSA keys cannot directly encrypt arbitrarily large files.

References