Skip to the calculator
Rule Calculator

Factorial Calculator

With n 10, factorial comes to 3,628,800 — n!. It is reached in 4 steps, the last of which is factorial(max(0, min(170, round(10)))), and each one is printed on the page with its numbers filled in. The formula is the one published by NIST Digital Library of Mathematical Functions §5.2, not an approximation fitted to it.

n factorial for n up to 170, with the number of digits, the previous factorial and what the figure counts: the orderings of n distinct things.

Formula and sources checked · How we check

n 10

3,628,800

n! for the example below. Editing a field recomputes the calculator below; this figure holds the answer the page was loaded with.

It is written into the HTML rather than drawn by a script, so a search engine reading this page without running JavaScript still finds an answer.

n!
3,628,800
n!
factorial(max(0, min(170, round(10))))3,628,800
(n − 1)!
factorial(max(0, min(170, round(10) - 1)))362,880
Digits in the answer
floor(log10(3628800)) + 17
Distinct arrangements if two items are identical
3628800 / 21,814,400

Ask about this in the chat

Worked example

10! is 3,628,800 — the number of ways ten distinct things can be put in order. It is 10 times 9!, which is 362,880, and that recursion is the definition: each factorial is the one below it times n. Ten items is already 3.6 million orderings, which is why brute-forcing an ordering problem stops being possible almost immediately.

How to work it out yourself

  1. 1.Read n! as "the number of ways to order n distinct things". The first slot has n choices, the next n − 1, and multiplying those choices is the factorial.
  2. 2.Above 170 the answer no longer fits in double-precision arithmetic, which is why this calculator stops there. 170! is about 7.26 × 10³⁰⁶.
  3. 3.If some of the items are identical, divide by the factorial of each repeated group. Four letters with one pair repeated is 4!/2! = 12, not 24.

The formula

  1. n!factorial(max(0, min(170, round(10))))
  2. (n − 1)!factorial(max(0, min(170, round(10) - 1)))
  3. Digits in the answerfloor(log10(3628800)) + 1
  4. Distinct arrangements if two items are identical3628800 / 2

Source: NIST Digital Library of Mathematical Functions §5.2 — the gamma function and factorials, Wolfram MathWorld — factorial

Questions people actually ask

Why is 0! equal to 1?
There is exactly one way to arrange nothing — the empty arrangement. Defining it as 1 is also what makes the recursion n! = n × (n − 1)! work at n = 1, and what makes the binomial coefficient formula give 1 for choosing none of them.
How fast does the factorial grow?
Faster than any exponential. 10! is 3.6 million, 20! is 2.4 × 10¹⁸, and 70! already exceeds the estimated number of atoms in the observable universe. That growth is why exhaustive search over orderings is hopeless past about a dozen items.
What is the difference between a factorial and a permutation?
n! orders all n items. A permutation of r items from n orders only some of them: n!/(n − r)!. Choosing 3 from 10 in order is 10!/7! = 720, not 3,628,800.
Is there a factorial of a fraction?
Not a factorial, but the gamma function extends it: Γ(n + 1) equals n! for whole numbers and is defined for everything in between. Γ(½ + 1) is √π/2, which is where the "half factorial" of about 0.8862 comes from.

Related

Put this calculator on your site

Free, no attribution required beyond the link.

<iframe src="https://rulecalculators.com/embed/factorial" width="100%" height="420" style="border:1px solid #e7e4de;border-radius:12px" title="Factorial Calculator"></iframe>
Did this answer your question?