Factorial Calculator

Enter one non-negative integer to get its exact factorial instantly. The result updates automatically as you type.

Results are calculated automatically as you enter data.

Enter a non-negative integer to compute its factorial (n!).

Factorial result

Result updates in real time as you type.

▼ See explanations and tips below ▼

What Is a Factorial?

A factorial is a multiplication pattern for non-negative integers. The factorial of a number \(n\), written as \(n!\), means multiplying \(n\) by every positive integer smaller than it, down to \(1\).

For example, \(5!\) means:

$$ 5! = 5 \times 4 \times 3 \times 2 \times 1 = 120 $$

Factorials are most useful when you need to count arrangements. If you have \(5\) distinct objects and want to put all of them in order, there are \(5! = 120\) possible orders. This is why factorials appear often in permutations, combinations, probability, algebra, and discrete mathematics.

Factorials are unitless. A factorial result is a count or mathematical value, not a length, weight, time, or currency amount.


Why Factorials Matter

Factorials provide a compact way to describe repeated multiplication that would otherwise be long to write. Instead of writing:

$$ 10 \times 9 \times 8 \times 7 \times 6 \times 5 \times 4 \times 3 \times 2 \times 1 $$

we can write simply:

$$ 10! $$

That compact notation is especially helpful in counting problems. Factorials help answer questions such as:

  • How many ways can people line up for a photo?
  • How many ways can books be arranged on a shelf?
  • How many possible orders can a set of tasks have?
  • How many combinations or binomial coefficients are possible in a probability problem?

Factorials also show why counting problems can grow quickly. A small increase in \(n\) can create a much larger result because each new number adds another multiplication factor.


Key Terms to Know

  • Non-negative integer: A whole number that is not below zero, such as \(0\), \(1\), \(2\), \(3\), and so on.
  • Factorial notation: The exclamation mark notation \(n!\), read as “\(n\) factorial.”
  • Permutation: An arrangement where order matters. The number of ways to arrange \(n\) distinct objects is \(n!\).
  • Combination: A selection where order does not matter. Factorials are often used in combination formulas.
  • Binomial coefficient: A value such as \(\binom{n}{r}\) that counts ways to choose \(r\) items from \(n\) items.
  • Gamma function: A more advanced function related to factorials. It can be used in higher mathematics to extend factorial-like ideas beyond ordinary non-negative integers, but it is not the same as the basic whole-number factorial used here.

How Factorials Work

For a positive integer \(n\), the factorial is the product of all positive integers from \(1\) through \(n\):

$$ n! = 1 \times 2 \times 3 \times \cdots \times (n - 1) \times n $$

The same idea can also be written in product notation:

$$ n! = \prod_{k=1}^{n} k $$

Where:

  • \(n\) is the non-negative integer being evaluated.
  • \(k\) represents each integer multiplied along the way.
  • \(n!\) is the final factorial value.

Factorials can also be defined recursively. That means each factorial is built from the factorial before it:

$$ n! = \begin{cases} 1, & \text{if } n = 0 \\ n \times (n - 1)!, & \text{if } n \ge 1 \end{cases} $$

So \(6!\) can be found from \(5!\):

$$ 6! = 6 \times 5! = 6 \times 120 = 720 $$

Why \(0! = 1\)

The value of \(0!\) is \(1\). This can feel surprising because there are no positive numbers to multiply from \(1\) through \(0\).

One way to understand it is through the recursive pattern:

$$ 1! = 1 \times 0! $$

Since \(1! = 1\), the value that makes the equation work is:

$$ 0! = 1 $$

Another way to understand it is through counting arrangements. There is exactly one way to arrange no objects: do nothing. This “one empty arrangement” is why \(0! = 1\) fits naturally in permutation and combination formulas.


Examples of Factorials in Practice

Example 1: A simple factorial

Find \(4!\).

Start with \(4\) and multiply down to \(1\):

$$ 4! = 4 \times 3 \times 2 \times 1 $$

Then multiply:

$$ 4! = 24 $$

So the factorial of \(4\) is \(24\).


Example 2: Arranging distinct objects

Suppose you have \(6\) different books and want to arrange all of them on a shelf. Because the order matters, this is a permutation of all \(6\) books.

The number of possible arrangements is:

$$ 6! = 6 \times 5 \times 4 \times 3 \times 2 \times 1 $$
$$ 6! = 720 $$

There are \(720\) possible shelf orders.


Example 3: Using factorials in combinations

Factorials also appear when order does not matter. The number of ways to choose \(r\) items from \(n\) distinct items is often written as:

$$ \binom{n}{r} = \frac{n!}{r!(n-r)!} $$

For example, the number of ways to choose \(2\) items from \(5\) items is:

$$ \binom{5}{2} = \frac{5!}{2!(5-2)!} $$
$$ \binom{5}{2} = \frac{5!}{2!3!} $$

Expand the factorials:

$$ \binom{5}{2} = \frac{5 \times 4 \times 3 \times 2 \times 1}{(2 \times 1)(3 \times 2 \times 1)} $$

Cancel the matching factors:

$$ \binom{5}{2} = \frac{5 \times 4}{2 \times 1} = 10 $$

There are \(10\) ways to choose \(2\) items from \(5\) when order does not matter.


Example 4: The zero factorial edge case

Find \(0!\).

By definition:

$$ 0! = 1 $$

This is not a rounding rule or a calculator shortcut. It is part of the standard definition of factorials and keeps formulas for permutations and combinations consistent.


How to Interpret the Result

The result is \(n!\), the product of all positive integers from \(1\) through the number entered.

A result of \(1\) for \(0\) or \(1\) is expected:

$$ 0! = 1 $$
$$ 1! = 1 $$

For valid inputs, the result is an exact integer. No decimal rounding is applied. If the output contains commas, those commas are thousands separators. For example, \(10!\) may be displayed as \(3,628,800\), where the commas help readability; they are not decimal points.

A larger factorial usually means a much larger number of possible ordered arrangements. For example:

\(n\) \(n!\)
\(0\) \(1\)
\(1\) \(1\)
\(2\) \(2\)
\(3\) \(6\)
\(4\) \(24\)
\(5\) \(120\)
\(6\) \(720\)
\(7\) \(5,040\)
\(8\) \(40,320\)
\(9\) \(362,880\)
\(10\) \(3,628,800\)

A dash or blank-style output means no valid number has been entered yet. A validation message means the input was not accepted as a valid factorial argument.


Common Mistakes and Misconceptions

One common mistake is entering a decimal such as \(4.5\). In basic factorial notation, this calculator works with non-negative integers only, so decimals and fractions are not accepted.

Another mistake is entering a negative number. The ordinary factorial \(n!\) used in elementary counting is defined for non-negative integers. A negative integer does not fit the repeated multiplication pattern from \(1\) through \(n\).

It is also easy to confuse commas in the result with decimal notation. In a result such as \(3,628,800\), the commas are only grouping separators.

Some users expect scientific notation such as 1e3 to be treated as \(1000\). This calculator requires the integer itself, so scientific notation and expressions are not accepted.

Another misconception is that factorials grow like ordinary multiplication by a fixed number. They grow much faster than that because each step multiplies by a new, larger factor. For example, going from \(9!\) to \(10!\) multiplies the result by \(10\):

$$ 10! = 10 \times 9! $$

When to Use Factorials

Use factorials when you are working with a non-negative whole number and need to count or describe ordered multiplication.

Factorials are especially useful for:

  • Counting the number of ways to arrange distinct objects.
  • Solving permutation problems where order matters.
  • Working with combination formulas where order does not matter.
  • Understanding binomial coefficients.
  • Studying probability problems that involve arrangements or selections.
  • Recognizing recursive patterns in sequences and formulas.

Factorials are not the right tool when the input is a decimal, fraction, negative number, or measurement with units unless a more advanced mathematical model has been chosen.


Limitations and Things to Keep in Mind

This calculator is designed for ordinary factorials of non-negative integers. It accepts whole-number inputs from \(0\) through \(2000\).

It does not calculate factorials for:

  • Negative numbers.
  • Decimals or fractions.
  • Scientific notation such as 1e3.
  • Comma-separated input such as 1,000.
  • Expressions such as 5+2.
  • Inputs greater than \(2000\).

It also does not calculate Gamma-function values or other generalized factorials. For example, a more advanced tool may define factorial-like values for some non-integer inputs through the Gamma function, but that is outside the scope of this calculator.

No rounding is applied to valid factorial results. However, factorial values become extremely large, so even valid results can be long and difficult to read or use manually.


How to Use This Calculator

  1. Enter a non-negative integer in the input field.
  2. Make sure the value is between \(0\) and \(2000\).
  3. Do not include decimals, fractions, commas, spaces inside the number, scientific notation, or expressions.
  4. Read the formatted factorial result.
  5. Use the status message to correct blank, invalid, negative, non-integer, or out-of-range input.

A leading plus sign is acceptable, such as +5, because it still represents the integer \(5\).


Frequently Asked Questions

What does the exclamation point mean in \(n!\)?

In factorial notation, the exclamation point is a mathematical symbol, not punctuation. It means “multiply this non-negative integer by every positive integer below it.” For example, \(4! = 4 \times 3 \times 2 \times 1\).


Why does \(0!\) equal \(1\)?

The value \(0! = 1\) is part of the standard factorial definition. It also matches the idea that there is exactly one way to arrange zero objects: leave everything empty. This definition keeps permutation and combination formulas working cleanly when zero items are selected or arranged.


Can a decimal have a factorial?

In ordinary factorial notation for counting, factorials apply to non-negative integers. More advanced mathematics uses the Gamma function to extend factorial-like ideas beyond whole numbers, but that is a different function. This calculator does not evaluate decimal or fractional factorials.


Why are negative numbers not accepted?

The basic factorial pattern multiplies the positive integers from \(1\) through \(n\). A negative integer does not fit that pattern. This calculator therefore rejects negative inputs instead of trying to apply a generalized function.


Why is there a maximum input of \(2000\)?

Factorials become very large very quickly. The input limit keeps the result practical to calculate, display, and read in the browser. Inputs greater than \(2000\) are treated as out of range.


Are the commas in the answer decimal markers?

No. Commas in the result are thousands separators. For example, \(3,628,800\) means three million six hundred twenty-eight thousand eight hundred, not a decimal value.


Sources and References

Books

  1. Donna Kirk. Contemporary Mathematics. OpenStax, 2023. Chapter 7, Section 7.2, “Permutations.” https://openstax.org/books/contemporary-mathematics/pages/7-2-permutations
  2. Jay Abramson. College Algebra 2e. OpenStax, 2021. Chapter 9, Section 9.5, “Counting Principles.” https://openstax.org/books/college-algebra-2e/pages/9-5-counting-principles
  3. Oscar Levin. Discrete Mathematics: An Open Introduction. 3rd edition, School of Mathematical Science, University of Northern Colorado, 2025. Chapter 1, Section 1.3, “Combinations and Permutations.” https://discrete.openmathbooks.org/dmoi3/sec_counting-combperm.html

Online and Official Sources

  1. National Institute of Standards and Technology. “§5.2 Definitions,” NIST Digital Library of Mathematical Functions, Version 1.2.7, released June 15, 2026. Accessed June 28, 2026. https://dlmf.nist.gov/5.2