lifekit

Search tools

Type a tool name, then press Enter to open it.

Factorial calculator

Get exact factorials up to 10,000!, plus permutations (nPr) and combinations (nCr), with digit count, trailing zeros, and the formula worked out.

  • Free
  • Runs in your browser
  • Nothing is uploaded

How to use it

  1. Pick n! for a factorial, Permutations (nPr) when order matters, or Combinations (nCr) when it doesn't.
  2. Enter n, and r for permutations or combinations. Both are whole numbers, with r no bigger than n.
  3. Read the exact answer, its digit count, and the formula steps. Long answers show every digit below.
  4. Copy the full number, or press Reset to go back to the example.

Private by design

Everything runs on your device. Nothing you enter or open here is uploaded.

Questions

n factorial (n!) is the product of every whole number from 1 to n, so 5! = 5 × 4 × 3 × 2 × 1 = 120. It counts the ways to arrange n different items in a row.

0! = 1 because there is exactly one way to arrange zero items: do nothing. It also keeps formulas like n! = n × (n − 1)! and nCr working when r is 0 or n.

nPr counts ordered arrangements and nCr counts unordered groups, so nCr = nPr / r!. Choosing 3 of 10 people gives P(10, 3) = 720 ordered line-ups but only C(10, 3) = 120 different teams.

Use C(n, r) = n! / (r! × (n − r)!). For a 5-card hand from 52 cards, C(52, 5) = (52 × 51 × 50 × 49 × 48) / (5 × 4 × 3 × 2 × 1) = 2,598,960.

Count the factors of 5 by adding ⌊n/5⌋ + ⌊n/25⌋ + ⌊n/125⌋ and so on. 100! has 20 + 4 = 24 trailing zeros, because each 5 pairs with a 2 to make a 10.