Toolbox Hub
All Tools

Factorial Calculator

Calculate factorials

Calculate factorials Runs locally in your browser

Enter a whole number. Values above 170 exceed the representable range.

About the

The Factorial Calculator computes n factorial, the product of every whole number from one up to n, and it does so with arbitrary-precision arithmetic so large results come out in full rather than rounding. Factorials grow extremely fast, which is why twenty factorial is already nineteen digits long and the tool stops at 170, the point where the value exceeds what a standard floating point number can represent.

Where people use the

  • Working out the number of orderings for a set of items.
  • Checking a combinations or permutations calculation.
  • Computing an exact factorial for a maths exercise.
  • Seeing how fast factorial growth becomes unmanageable.

How to use the

  1. 1

    Enter a whole number

    Type any non-negative integer. Zero factorial is defined as one.

  2. 2

    Run it

    The full product is shown, with every digit rather than an approximation.

  3. 3

    Watch the size

    Results grow quickly: 10 factorial is about 3.6 million, and 20 factorial is about 2.4 quintillion.

  4. 4

    Stay within the limit

    Values above 170 are rejected, because the result is too large to represent.

Tips and best practices

  • Zero factorial is one, not zero.
  • Results past about twenty are enormous; check you meant that input.
  • Above 170 the value cannot be represented at all.

Frequently asked questions

Why is there a limit of 170?

Because that is roughly where the value exceeds the largest number a standard double-precision floating point can hold. Larger values need a big-number library, which is what this tool uses to give exact digits up to that point.

What is zero factorial?

One, by definition. It is the convention that makes the combinatorial formulas work.

Are decimals accepted?

No. Factorials are defined on non-negative integers. A decimal input is rejected.

Why is the result so long?

Because factorials grow faster than exponentially. That is also why they show up in complexity analysis and in counting permutations.

Can it compute a factorial above 170?

No. The tool rejects anything larger, since the value cannot be represented.

Related Tools