Home · Everyday · Bases, Binary & Logic · RSA Calculator

RSA Calculator

Toy RSA key generation from two small primes — n, φ(n), e and the private d, with the check multiplication.

Your figures

Example result — edit the figures to make it yours

3233

Public modulus n = p × q

Textbook RSA key generation: n is published, φ(n) = (p−1)(q−1) stays secret, e is chosen coprime to φ(n), and d is e's modular inverse — the private exponent. Toy-sized primes for learning: real RSA uses 1,000+ digit primes and padding schemes this page deliberately omits.

φ(n)3120
Public exponent e17
Private exponent d2753
Check: e × d mod φ(n)1

Never use keys from a web page for real security — this is the arithmetic skeleton only.

What this calculator does

Toy RSA key generation from two small primes — n, φ(n), e and the private d, with the check multiplication. Where a measure is involved, US and metric units are both accepted — flip the unit toggle and the figures convert with the same definitions the formula uses. Every result on this page is computed from the formula stated below, with no hidden rounding steps.

The formula and method

n = pq; φ = (p−1)(q−1); e coprime to φ; d = e⁻¹ mod φ

This is the textbook RSA construction with small primes, for learning the arithmetic only.

n = p · q, φ(n) = (p − 1)(q − 1), and e · d ≡ 1 (mod φ(n)).

Real RSA uses primes hundreds of digits long — never use toy keys for real data.

Worked example

With the example inputs this page opens with (prime p 61, prime q 53), the result is 3233 — public modulus n = p × q. Textbook RSA key generation: n is published, φ(n) = (p−1)(q−1) stays secret, e is chosen coprime to φ(n), and d is e's modular inverse — the private exponent. Toy-sized primes for learning: real RSA uses 1,000+ digit primes and padding schemes this page deliberately omits.

Quick reference

Quick reference — varying prime p
Prime pPublic modulus n = p × q
30.51643
613233
713763

Computed with the same formulas as the calculator above — enter any values there for figures beyond this table.

Common questions

How does the RSA Calculator work?

Toy RSA key generation from two small primes — n, φ(n), e and the private d, with the check multiplication. Prime p · Prime q → Key pair. The result updates as you type, and the formula and method on this page state the exact definitions used, so you can reproduce the calculation by hand.

What inputs does the RSA Calculator need?

Prime p · Prime q → Key pair. Invalid entries — such as a zero denominator, an out-of-range value or a malformed list — produce a plain-language message instead of a misleading number.

Is the RSA Calculator free to use?

Yes. It runs entirely in your browser with no sign-up, and the same calculator is available as an embeddable widget via the Embed button, so it can be placed on another site with its calculation intact.