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.
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
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
| Prime p | Public modulus n = p × q |
|---|---|
| 30.5 | 1643 |
| 61 | 3233 |
| 71 | 3763 |
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.