Math

Factorial Calculator

Find n factorial for whole numbers and see how the product is built, with the n ≤ 170 limit explained and examples used in permutations and series.

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! = 1×2×…×n (0! = 1). Limited to n ≤ 170 for finite IEEE floats.

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

Factorials are the building block for counting arrangements. If you have n different items, there are n! ways to put them in order. This calculator computes n! for whole numbers and applies a safe upper limit of 170, because 171! is larger than the biggest finite double-precision number and would show as infinity. Use it to check the denominators in binomial coefficients, terms of power series, or probabilities of ordering events. Seeing how quickly the numbers grow also builds intuition: 20! already exceeds two quintillion, so brute-force enumeration of all orderings stops being feasible for even modest n.

When to use / who it helps

  • You are working out how many ways to order a set of items.
  • You are building a probability from permutations.
  • You are checking a Taylor-series term such as x^n ÷ n!.
  • You are testing code that computes factorials.
  • You want to see how fast a function grows.

How to use

Steps

  1. Type a whole number n between 0 and 170.
  2. Read n! in the result field.
  3. For a product of a descending run, compare with the permutations tool.
  4. Divide two factorials by hand to get permutations or combinations.
  5. Remember that the result for large n is an approximation.
  6. Use arbitrary-precision software for exact digits beyond 20 or so.

How to interpret results

  • n! is the number of orderings of n distinct objects.
  • Above about 9 × 10¹⁵ the result may no longer be an exact integer in floating point.
  • Every extra step multiplies the previous answer by n.
  • 0! = 1 so that formulas such as nCr work for r = 0.
  • The limit is a computer limitation, not a mathematical one.

Common mistakes & gotchas

  • Using n! when only a subset is ordered, which needs nPr.
  • Assuming results beyond n = 20 are exact.
  • Entering 171 or more and expecting a finite number.
  • Confusing n! with (n−1)!.
  • Typing a fraction.

Worked example

Worked example — arranging 6 people, and 20!

  1. 6! = 6 × 5 × 4 × 3 × 2 × 1 = 720 possible orderings.
  2. If two particular people must sit together, treat them as a block: 5! × 2 = 240 orderings.
  3. 20! = 2,432,902,008,176,640,000, about 2.4 × 10¹⁸.
  4. 170! ≈ 7.26 × 10³⁰⁶, near the top of the floating-point range.

Result: 6! = 720; 20! is about 2.43 × 10¹⁸.

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

How to calculate / formula

n! = 1×2×…×n (0! = 1). Limited to n ≤ 170 for finite IEEE floats.

Frequently asked questions

What is n factorial?

The product of all positive integers from 1 to n.

Why is 0! equal to 1?

It is the empty product, and it makes counting formulas consistent.

What is the largest factorial this tool computes?

170!, because 171! overflows standard floating-point numbers.

How do I compute permutations?

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

Are the results exact?

Up to 18! (about 6.4 × 10¹⁵) they are exact integers; beyond that, rounding may appear.

What is the difference between this and the other factorial calculator?

Both compute n!; this page focuses on the overflow limit and counting examples.