GALAXY OF TOOLS

हिंदी

MATH SECTOR

Factorial Calculator

Exact factorials up to 10,000! with every digit, trailing zeros, digit count, n!! and the gamma function.

Whole numbers up to 10,000 give every digit exactly; larger ones (up to 100 million) are estimated. Decimals use the gamma function.
—
Step-by-step working

    Runs entirely in your browser. Nothing you enter or upload is sent to a server.

    An exact factorial calculator — every digit, up to 10,000!

    This free factorial calculator computes n! exactly using arbitrary-precision integers, so 100! shows all 158 digits and 10,000! all 35,660 — not a rounded “Infinity” or 9.33 × 10¹⁵⁷. Alongside the value you get the number of digits, the number of trailing zeros, the scientific-notation form and how close Stirling’s famous approximation comes.

    It also handles the double factorial n!! (the product of every second number) and extends factorials to decimals and negative fractions through the gamma function, Γ(x + 1). Students meet factorials in permutations and combinations, probability, Taylor series and algorithm analysis; the step-by-step working shows the multiplication, Legendre’s formula for trailing zeros and the digit-count logic.

    How to use the Factorial Calculator

    1. Choose n! factorial or n!! double factorial.
    2. Type n. Whole numbers up to 10,000 (20,000 for n!!) are calculated exactly; bigger ones up to 100 million are estimated.
    3. Read the value in the result panel. Long results are shown in scientific notation, with every digit in the box underneath.
    4. Check the tiles for the digit count, trailing zeros and Stirling’s estimate.
    5. Use “Copy digits” or “Download .txt” to keep the full number.

    Factorial Calculator features

    Exact big factorials

    Binary-splitting multiplication with BigInt gives every digit of n! up to 10,000! in a fraction of a second.

    Trailing zeros and digits

    Legendre’s formula gives the exact number of trailing zeros even for n = 100 million, and the digit count is always shown.

    Double factorials

    n!! for odd and even n, including the conventions 0!! = (−1)!! = 1.

    Gamma for decimals

    Non-integers use Γ(x + 1) with the Lanczos approximation, so 0.5! = √π/2 ≈ 0.886227.

    Stirling comparison

    See how √(2πn)(n/e)ⁿ tracks the true value and how its error falls as n grows.

    What is a factorial?

    The factorial of a whole number n, written n!, is the product of every whole number from n down to 1: 5! = 5 × 4 × 3 × 2 × 1 = 120. It counts the number of ways to arrange n different objects in a row — 5 books can be ordered in 120 ways, and a shuffled deck of 52 cards has 52! ≈ 8.07 × 10⁶⁷ possible orders, more than the number of atoms on Earth.

    By definition 0! = 1: there is exactly one way to arrange nothing, and the rule n! = n × (n − 1)! only works for n = 1 if 0! is 1. Factorials of negative whole numbers are undefined.

    nn!Digits
    011
    51203
    103,628,8007
    136,227,020,80010
    151,307,674,368,00013
    202,432,902,008,176,640,00019
    2515,511,210,043,330,985,984,000,00026
    52≈ 8.0658 × 10⁶⁷68
    100≈ 9.3326 × 10¹⁵⁷158

    Counting trailing zeros with Legendre’s formula

    Each trailing zero comes from a factor of 10 = 2 × 5. A factorial always has more 2s than 5s, so you only need to count the 5s: divide n by 5, 25, 125, … and add the whole-number parts. For 100!: ⌊100/5⌋ + ⌊100/25⌋ = 20 + 4 = 24 trailing zeros. For 1,000!: 200 + 40 + 8 + 1 = 249. This is a favourite question in programming interviews and competitive exams, and it is why the calculator can give exact trailing zeros even when the full number is too long to print.

    Where factorials are used

    • Permutations and combinations: the number of ways to choose 3 people from 10 is 10! ÷ (3! × 7!) = 120. The Permutation and Combination Calculator works these out directly.
    • Probability: the chance that a random shuffle of 6 cards comes out in order is 1 in 6! = 720.
    • Series: eˣ = 1 + x + x²/2! + x³/3! + …, and sin x, cos x have similar factorial series.
    • Algorithms: trying every ordering of n items takes n! steps, which is why brute-force route planning becomes impossible beyond about 15 stops.
    • Double factorials: 7!! = 7 × 5 × 3 × 1 = 105 appears in integrals of sin and cos and in counting pairings: 2n people can be split into pairs in (2n − 1)!! ways.

    Factorial Calculator FAQ

    How do you calculate a factorial?

    Multiply all whole numbers from n down to 1. For example 6! = 6 × 5 × 4 × 3 × 2 × 1 = 720. The factorial calculator does this exactly for n up to 10,000 and shows the multiplication for small n.

    Why is 0 factorial equal to 1?

    There is exactly one way to arrange zero objects (do nothing), and defining 0! = 1 keeps formulas like n! = n × (n − 1)! and the combinations formula consistent. It is also what the gamma function gives: 0! = Γ(1) = 1.

    How many digits does 100! have?

    100! has 158 digits and ends in 24 zeros. Its value is about 9.33 × 10¹⁵⁷. Type 100 to see every digit.

    Can you take the factorial of a decimal or a negative number?

    Decimals and negative non-integers use the gamma function, x! = Γ(x + 1): 0.5! ≈ 0.886 and (−0.5)! ≈ 1.772. Negative whole numbers have no factorial because the gamma function is infinite there.

    What is a double factorial?

    n!! multiplies every second number down from n: 9!! = 9 × 7 × 5 × 3 × 1 = 945 and 10!! = 10 × 8 × 6 × 4 × 2 = 3,840. It is not the factorial of a factorial — (3!)! = 720, but 3!! = 3.

    Why does my normal calculator show an error for 171!?

    Ordinary calculators store numbers as 64-bit floating point, which tops out near 1.8 × 10³⁰⁸, and 171! is larger. This tool uses exact big integers instead; the Exponent Calculator uses the same approach for huge powers.

    You might also need