InfyCalculator

Factorial Calculator

Compute n! for any whole number up to 170, with digit count and trailing zeros.

n
Loading calculator…

How it works

n! = n × (n − 1) × (n − 2) × … × 2 × 1, with 0! = 1

The factorial multiplies every whole number from n down to 1 and counts the ways to arrange n distinct things in a row. It grows explosively — 10! is already 3.6 million and 70! passes a googol (10¹⁰⁰). The trailing zeros come from factors of 10, which Legendre’s formula counts by tallying the factors of 5.

Worked example

6! = 6 × 5 × 4 × 3 × 2 × 1 = 720 — the number of ways six people can line up. It has 3 digits and ends in one zero (from the factor pair 5 × 2).

Frequently asked questions

Why does 0! equal 1?

There is exactly one way to arrange nothing: do nothing. It also keeps the formulas consistent — nCr with r = n needs 0! = 1 to give the right answer of 1.

Can I take the factorial of a fraction or negative number?

Not with the plain factorial. The gamma function extends it — Γ(n + 1) = n!, and for instance (½)! = √π ÷ 2 ≈ 0.886 — but negative whole numbers have no finite value at all.

Why do big factorials end in so many zeros?

Every pair of factors 5 × 2 makes a 10. Multiples of 5 are the scarce ingredient, so 100! ends in 24 zeros: 20 multiples of 5, plus 4 extra fives from 25, 50, 75 and 100.

Related calculators

This calculator is for educational purposes. Double-check important results before acting on them.