Calcist

Style

Buttons

Spacing

How much to show

Decimal places

Text size

Factorial calculator

Type a whole number to get its factorial, n!, exactly. Big answers show every digit, the digit count and scientific notation.

Private: calculated on your device. Nothing you type is sent anywhere.

Next: Choosing or arranging only some of the items? Use the permutations and combinations calculator. Doing other math with huge numbers? Try the big number calculator.

What a factorial is

The factorial of a whole number n, written n!, is the product of every whole number from n down to 1.

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

It counts the ways to arrange n different things in a row. Three books can be lined up in 3! = 3 × 2 × 1 = 6 ways.

Worked examples

  • 5! = 5 × 4 × 3 × 2 × 1 = 120.
  • 10! = 10 × 9! = 10 × 362,880 = 3,628,800.
  • 52! ≈ 8.065817517 × 10⁶⁷. That's how many orders a shuffled deck of cards can be in, a 68-digit number.
  • 100! has 158 digits and ends in 24 zeros.

Counting the trailing zeros

Each trailing zero comes from a factor of 10, which is 2 × 5. There are always more 2s than 5s, so count the 5s: add n ÷ 5, n ÷ 25, n ÷ 125 and so on, dropping the remainders. For 100!, that's 20 + 4 = 24 zeros.

Why ordinary calculators give up

Factorials grow faster than powers. Most calculators store numbers in a format that tops out near 10³⁰⁸, so they show an error after 170! (about 7.257415615 × 10³⁰⁶). Many handheld calculators stop at 69!, because 70! is larger than 10¹⁰⁰. This calculator multiplies with exact whole-number arithmetic (JavaScript BigInt), so every digit is right. It stops at 5,000 to keep the page fast; 5,000! has 16,326 digits.

Fractions and negative numbers

n! is only defined for whole numbers 0 and up. The gamma function extends it to other numbers, with Γ(n + 1) = n! for whole n. For example, Γ(1.5) = √π ÷ 2 ≈ 0.886227 is sometimes written "0.5!". Gamma has no value at 0, −1, −2 and so on, so there's no factorial of a negative whole number. If you type a non-whole number, the calculator shows the gamma value instead.

Sources

How we checked this

Before every update, this calculator is run in a real browser with these known answers, and it must match all of them:

  • 5! = 120 ✓
  • Edge: 0! = 1 ✓
  • 20! = 2,432,902,008,176,640,000 exactly ✓
  • 100! ≈ 9.332621544 × 10¹⁵⁷ ✓
  • 1000! has 2,568 digits ✓
  • 1000! ends in 249 zeros ✓
  • Edge: −3 is rejected ✓
  • Edge: 2.5 is rejected, with Γ(3.5) ≈ 3.32335097 ✓

Last checked October 26, 2026. Spotted something wrong? The math is done in your browser with the formula shown on this page, so you can check any result by hand.

Add this calculator to your website (free)

Paste this code into any web page. The calculator works on your page, resizes itself, has no ads and no tracking cookies, and nothing your visitors type is sent anywhere. More about embedding.

Questions people ask

Why is 0! equal to 1?

There's exactly one way to arrange nothing: the empty arrangement. It also keeps formulas working, like n! = n × (n − 1)!, which gives 1! = 1 × 0!, so 0! must be 1.

What is 20 factorial?

20! = 2,432,902,008,176,640,000, about 2.43 quintillion. It's the largest factorial that fits in a signed 64-bit integer.

Can you take the factorial of a negative number?

No. Factorials are only defined for whole numbers 0 and up. The gamma function, which extends factorials, also has no value at negative whole numbers.

How many digits does 1000! have?

2,568 digits. It starts 4.023872601 × 10²⁵⁶⁷ and ends in 249 zeros.

What is 0.5 factorial?

Strictly, it isn't defined. Using the gamma function, Γ(1.5) = √π ÷ 2 ≈ 0.886227, which is what some calculators show for 0.5!.

Related calculators