Skip to content
Calcora

Factorial Calculator

The factorial (n!) of a whole number.

Input sheet

Browse DIY guidesDo the project yourself, step by step

DIY at your own risk. Calcora's calculators and guides are general estimates and information only — not professional, engineering, legal, or safety advice. Always verify local building codes and permit requirements, and hire a licensed pro for electrical, gas, plumbing, structural, or any work you're not fully comfortable doing yourself.

A factorial multiplies every whole number from 1 up to n, and it explodes in size astonishingly fast. Factorials are the backbone of permutations, combinations, and probability.

How it works

n! multiplies every whole number from 1 to n. Values above 170! overflow double precision.

n! counts the number of ways to arrange n distinct items in order — 5! = 120 orderings of five books on a shelf. By definition 0! equals 1, the single way to arrange nothing.

Growth is extreme: 10! already exceeds three million, and standard double-precision arithmetic loses exactness beyond about 170!, which is why this tool caps the input there.

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

Worked examples

Tips & gotchas

FAQ

Why is 0! equal to 1?

There is exactly one way to arrange an empty set — do nothing. Defining 0! as 1 also makes the combination formula nCr work when r equals 0 or n.

Can I take the factorial of a negative or decimal number?

Not with the ordinary factorial. The gamma function extends the idea to those values, but the plain factorial is for non-negative integers only.

Why does this tool stop at 170!?

171! exceeds the maximum value a standard double-precision number can hold, so results beyond 170! would overflow to infinity.

Related calculators

Percentage Calculator · Percent Change Calculator · Average (Mean) Calculator · Ratio Calculator · Exponent Calculator