Math

Factorial Calculator

Settings
Reset
Share
Save
Embed
Report a bug

Share calculator

Add our free calculator to your website

Please enter a valid URL. Only HTTPS URLs are supported.


Use as default values for the embed calculator what is currently in input fields of the calculator on the page.


Input border focus color, switchbox checked color, select item hover color etc.


Please agree to the Terms of Use.

Preview

Save calculator

Calculator Settings

Please enter a value within the allowed range.

Please enter a value within the allowed range.

Please enter a value within the allowed range.

Please enter a value within the allowed range.

Share calculator

What is a factorial calculator?

A factorial calculator finds the factorial of a non-negative whole number, written n!n! and read aloud as “n factorial.” The factorial is the product of every positive integer from 11 up to and including nn. Enter a value for nn and the calculator returns n!n! immediately.

Factorials grow extremely fast: 5!5! is already 120120, and 10!10! exceeds three million. Because of this rapid growth, factorials appear throughout combinatorics, probability, algebra, and calculus whenever you need to count the number of ways objects can be arranged.

How does it work?

The factorial is defined as the product of all positive integers up to nn:

n!=n×(n1)××2×1n! = n \times (n-1) \times \cdots \times 2 \times 1

There is one important special case. The factorial of zero is defined to equal one:

0!=10! = 1

This is not an accident or an exception bolted on after the fact. There is exactly one way to arrange zero objects (the empty arrangement), so 0!=10! = 1 keeps counting formulas consistent. It also follows from the recursive rule n!=n×(n1)!n! = n \times (n-1)!: setting n=1n = 1 gives 1!=1×0!1! = 1 \times 0!, which only holds if 0!=10! = 1.

Factorials are defined only for non-negative integers. A negative number or a fraction such as 2.52.5 has no ordinary factorial, so the calculator leaves the result blank for those inputs. (The gamma function extends the idea to other numbers, but that is beyond a basic factorial.)

Worked examples

  • 5!=5×4×3×2×1=1205! = 5 \times 4 \times 3 \times 2 \times 1 = 120
  • 6!=6×5×4×3×2×1=7206! = 6 \times 5 \times 4 \times 3 \times 2 \times 1 = 720
  • 10!=10×9×8××2×1=3,628,80010! = 10 \times 9 \times 8 \times \cdots \times 2 \times 1 = 3{,}628{,}800
  • 1!=11! = 1
  • 0!=10! = 1

Notice the recursive shortcut at work: once you know 5!=1205! = 120, computing 6!6! is just 6×120=7206 \times 120 = 720, and 10!10! builds the same way one step at a time.

Practical notes

Factorials are the engine behind permutations and combinations. The number of ways to arrange nn distinct items in order is n!n!, and the formulas for permutations P(n,r)P(n, r) and combinations C(n,r)C(n, r) are both written in terms of factorials. If you are counting arrangements or selections, see the permutations calculator at https://www.mega-calculator.com/math/permutations/ and the combinations calculator at https://www.mega-calculator.com/math/combinations/.

Because factorials explode in size, this calculator accepts values up to 170170. Beyond that point n!n! exceeds the largest finite value a standard computer number can represent, so the result is left blank rather than reported as infinity. For everyday counting and probability work, that range is more than enough.

Report a bug

This field is required.