Home › Math › Factorial Calculator
🔧

Factorial Calculator

Calculate factorials of non-negative integers, including large results, or list a range

输入非负整数 n
!

n! = 1 × 2 × 3 × ... × n,规定 0! = 1。支持 0 ~ 1000 的大数计算

About this tool

The factorial calculator evaluates n! for any non-negative integer n:

  • Large numbers: built on BigInt and exact up to 1000!, with no overflow
  • Working shown: the full expansion is listed, such as 5! = 5 times 4 times 3 times 2 times 1 = 120
  • Digit count: see how many digits the result has
  • Range mode: produce a table of factorials from m to n

What a factorial is

A factorial is the product of every positive integer from 1 to n, written n!. For example 5! = 5 times 4 times 3 times 2 times 1 = 120, and by convention 0! = 1. Factorials grow extremely fast: 20! already has 19 digits.

When to use it

  • Permutations and combinations, where A(n,r) and C(n,r) are built on factorials
  • Probability and statistics
  • Coefficients in Taylor expansions
  • Math study and homework

Factorial notes

  • Growth: 10! = 3628800, 20! has 19 digits and 50! has more than 60
  • Zero: 0! = 1 by mathematical convention, which keeps the combination formulas valid
  • Link to counting: A(n,r) = n!/(n-r)! and C(n,r) = n!/(r!(n-r)!)
  • Number limits: a JavaScript Number tops out near 1.7e308, about 170!, so anything larger needs BigInt