Math

Factorial Calculator

Compute n factorial (n!) for whole numbers from 0 to 170, with examples, the 0! = 1 rule and why large factorials overflow.

Inputs

Results update as you type — essentials first

Saved scenarios

Store input snapshots on this device — load anytime.

No saved scenarios yet.

Formula / how it works

n! = n × (n − 1) × … × 2 × 1, with 0! = 1. For example 5! = 120 and 10! = 3,628,800. Results above 170! exceed the range of standard floating-point numbers.

Detailed guide

What it is, how to use it, how to read the numbers, common mistakes, a worked example, formulas, and FAQs.

What this calculator is

The factorial of a whole number n is the product of every positive integer up to n. It counts the number of ways to arrange n distinct items in a row: three books can be ordered 3! = 6 ways. Factorials appear throughout permutations, combinations, probability, series expansions and algorithm analysis. They grow extremely fast. 10! is already 3.6 million, 20! is about 2.4 × 10¹⁸, and 170! is about 7.3 × 10³⁰⁶. Beyond 170, the value exceeds the maximum a standard double-precision number can hold, so this calculator limits n to 170.

When to use / who it helps

  • You need n! for a permutations or probability problem.
  • You are checking homework on series, binomial coefficients or counting.
  • You want to see how fast factorials grow.
  • You are testing a program that computes factorials.
  • You need a value for the denominator of a Taylor series term.

How to use

Steps

  1. Enter a whole number n from 0 to 170.
  2. Read n! in the result.
  3. For counting problems, decide whether order matters before using a factorial.
  4. Use combinations instead if you are choosing a subset.
  5. For large values, read the result in scientific notation.
  6. Use exact big-number software for n above 170.

How to interpret results

  • n! counts the orderings of n distinct objects.
  • Large results may be rounded floating-point values rather than exact integers.
  • 0! equals 1 by convention, matching the empty product.
  • Dividing factorials gives permutations and combinations.
  • Factorials of negative numbers are not defined in basic arithmetic.

Common mistakes & gotchas

  • Entering a decimal or negative number.
  • Assuming 0! is 0.
  • Expecting exact digits for very large n.
  • Using factorials where order does not matter.
  • Confusing n! with n squared.

Worked example

Worked example — 5! and 10!

  1. 5! = 5 × 4 × 3 × 2 × 1 = 120.
  2. 10! = 10 × 9 × … × 1 = 3,628,800.
  3. Check: 10! = 10 × 9! and 9! = 362,880.
  4. As a counting example, 5 people can be arranged in a line in 120 different orders.

Result: 5! = 120 and 10! = 3,628,800.

To load the form's own demo values, tap Try example above the Calculate button.

How to calculate / formula

n! = n × (n − 1) × … × 2 × 1, with 0! = 1. For example 5! = 120 and 10! = 3,628,800. Results above 170! exceed the range of standard floating-point numbers.

Frequently asked questions

What is 0 factorial?

1, by convention, since there is exactly one way to arrange no objects.

Why is the limit 170?

171! is larger than the largest double-precision number, so the result would overflow.

What is a factorial used for?

Counting arrangements, permutations, combinations and in series like e^x.

How is a factorial different from a power?

A factorial multiplies decreasing integers; a power multiplies the same number repeatedly.

Can I find the factorial of a decimal?

Not with this tool. The gamma function extends factorials to non-integers.

How do I get combinations from factorials?

nCr = n! ÷ (r!(n − r)!).