Mathematics calculator

Factorial Calculator

Calculate the exact factorial of a nonnegative whole number from 0 through 1,000.

Calculator inputs

Enter your values

n factorial
Calculated output

Result summary

Your result will appear here

Complete the required fields and select the calculate button.

A factorial expanding into the product of descending positive integers
A factorial multiplies every positive integer from the entered number down to one.

What is Factorial Calculator?

A factorial multiplies all the positive integers from one up to a chosen whole number. The notation 5! means 5 × 4 × 3 × 2 × 1, which equals 120. The exclamation mark is part of the mathematical notation; it does not mean that the input is being squared or multiplied by itself five times.

Use this calculator to check small factorials, count possible orderings or work through a combinations problem. Ordinary factorials are defined here for nonnegative integers. Enter a whole number such as 0, 4 or 8, rather than a negative number or a decimal.

How to Use This Calculator

  1. Enter a nonnegative integer n from 0 through 1,000.
  2. Choose Calculate to multiply the integers from 1 through n.
  3. For a small input, write the product out and check it by hand.
  4. Read the exact integer and its digit count. Large factorials can contain thousands of digits, so copy them carefully.

The form is a factorial evaluator, not a complete permutation or combination calculator. If a question gives an expression such as 8!/(3!5!), calculate the required factorials and then perform the remaining division, or use a dedicated combinations tool.

Formula Used

n! = 1 × 2 × 3 × … × n for positive integers n; 0! = 1; n! = n × (n − 1)! for n ≥ 1.

Variables Explained

QuantityExplanation
nA whole-number count of objects or factors. For the ordinary factorial, n must be zero or a positive integer.
n!The product through n. It is a count, so small exact factorials have no fractional part.
0!The special starting value 1, consistent with an empty product and with the recurrence for 1!.

Worked Example

For n = 6, build the product in stages: 1 × 2 = 2, then × 3 = 6, × 4 = 24, × 5 = 120, and × 6 = 720. Therefore 6! = 720. You can also check it using the preceding factorial: 6 × 5! = 6 × 120 = 720.

Counting different arrangements

Imagine six different books in a row. There are six choices for the first position, five for the second and so on until only one remains. Multiplying those choices gives 6! = 720 possible orderings. This assumes all books are distinguishable and every ordering is allowed.

Cancel before calculating large products

An expression such as 10!/8! simplifies to 10 × 9 = 90 because the factors from 8 down to 1 cancel. Computing both large factorials first adds work and can introduce unnecessary rounding in software. Look for cancellation before entering numbers.

Why Use This Calculator?

Factorials appear in arrangements, permutations, combinations and probability. They count orderings when the objects are distinct. If objects repeat, or only some positions matter, the surrounding formula changes. The factorial remains one building block rather than a universal answer.

How quickly factorials grow

The first values are 0! = 1, 1! = 1, 2! = 2, 3! = 6, 4! = 24 and 5! = 120. By 10!, the result is 3,628,800. Each step multiplies by a larger integer, so growth soon becomes much faster than simply adding a fixed amount.

The implementation uses arbitrary-precision integer multiplication and returns an exact result through 1,000!. The digit count helps show its scale: a mathematically exact answer can still be too long for convenient manual copying.

Common Mistakes

  • Enter an integer, not a decimal. This page does not evaluate the gamma function, which is a different extension of factorial notation.
  • Do not use a negative input. A loop returning a value for such an input would not establish a valid negative factorial.
  • Keep n! separate from nⁿ. For example, 4! is 24, while 4⁴ is 256.
  • Account for repeated objects in a counting problem. The number of distinct arrangements of A, A and B is 3!/2! = 3, rather than 6.

Frequently Asked Questions

Why is zero factorial equal to one?

The recurrence 1! = 1 × 0! requires 0! to be 1. The same value represents the one way to arrange no objects: leave the arrangement empty. It also makes combination formulas work at their endpoints.

What is the difference between a factorial and a power?

A factorial multiplies decreasing positive integers, while a power multiplies copies of the same base. For instance, 3! = 3 × 2 × 1 = 6, whereas 3³ = 3 × 3 × 3 = 27.

Can I use this for very large exact factorials?

The calculator returns exact factorials through 1,000 using arbitrary-precision integer arithmetic. Simplify factorial ratios before evaluating them when possible, because cancellation makes the work easier to inspect.

Does n! always count selections of n objects?

It counts orderings of n distinct objects when every ordering is allowed. Selecting objects without caring about order requires a combinations formula. Restrictions and repeated objects also change the count.

How many ordered choices are there when I use only some objects?

For r ordered positions filled from n distinct objects without replacement, the count is n!/(n − r)!. Choosing and ordering three objects from five gives 5!/2! = 5 × 4 × 3 = 60. This is smaller than 5! because the unused objects are not being arranged in the final result. If order does not matter, a further division by r! is needed.

Sources & References