Skip to content
MasterMath

Factorial Calculator

The factorial of any number up to 1000, computed exactly. Beyond 21! ordinary arithmetic starts rounding, and this does not.

Factorial

—

Factorial—
Expansion—
How many digits—
The previous factorial—

How this was worked out

    The rule

    n! = n × (n−1) × … × 2 × 1

    Why it works

    The factorial multiplies every whole number from 1 up to n. It counts the number of ways to arrange n distinct objects in order, which is why it sits underneath almost all of combinatorics.

    How to do it by hand

    1. Multiply every whole number from 1 up to n
    2. Equivalently, multiply n by the previous factorial
    3. 0! is 1 by definition
    4. The result grows faster than any exponential

    What is worth knowing

    Factorials grow at a genuinely startling rate: 20! is already larger than 2⁶⁰, and 70! exceeds what a double-precision float can hold, which is why this calculator uses exact big-integer arithmetic. Above 21! a floating-point result is not merely rounded but wrong in its final digits, and quietly so. The convention that 0! = 1 is not arbitrary either: there is exactly one way to arrange nothing, and defining it that way is what makes the formula for combinations work at the edges.

    Frequently asked questions

    Why is 0! equal to 1?

    Because there is exactly one arrangement of nothing, and because it is the only value that keeps the combination formulas working.

    How fast do factorials grow?

    Faster than any exponential. 20! is over 2.4 quintillion, and 70! exceeds what a standard floating-point number can represent.

    Why does the answer need big integers?

    Because from 21! upwards a double-precision float loses the final digits without any warning.

    Is there a factorial of a fraction?

    Yes, through the gamma function, which extends the factorial to non-integers. It is beyond what this calculator does.