Factorial Calculator

Calculate n! and double factorial n!! exactly using BigInt. No overflow — 1000! (2568 digits) computes instantly. Shows expanded multiplication for small n and digit count for large results.

Guides & Reference

How It Works

Factorial n! — standard modePermutations, combinations, probability, binomial coefficients.

Enter any non-negative integer n. The result is n × (n−1) × ... × 2 × 1. For small n (up to about 12), the expanded multiplication shows each step. The result displays with its digit count. BigInt arithmetic ensures every digit is exact — unlike standard calculators that round above 69!.

n! = n × (n−1) × (n−2) × ... × 2 × 1 | 0! = 15! = 5×4×3×2×1 = 120 | 10! = 3,628,800 | 20! ≈ 2.43×10^18
Double factorial n!! — alternating productPhysics integrals, Wallis product, semifactorial applications.

Switch to the Double Factorial tab. n!! multiplies every other integer down to 1 (odd n) or 2 (even n). Examples: 9!! = 9×7×5×3×1 = 945. 10!! = 10×8×6×4×2 = 3840. Double factorial appears in the Wallis product for π/2 and in the exact values of Gaussian integrals in physics.

Odd n: n!! = n×(n−2)×...×3×1 | Even n: n!! = n×(n−2)×...×4×27!! = 7×5×3×1 = 105 | 8!! = 8×6×4×2 = 384
Growth rate — faster than exponentialUnderstanding why factorial is used in complexity analysis.

n! grows faster than any exponential function. At n=20: 20! = 2.43 × 10^18, while 2^20 = 1,048,576. The ratio 20! / 2^20 ≈ 2.3 billion. This is why O(n!) algorithms (brute-force travelling salesman) become impractical at n=15-20, while O(2^n) algorithms remain feasible to n≈30.

n! grows as √(2πn) × (n/e)^n (Stirling's approximation)10! = 3,628,800 | 20! ≈ 2.43×10^18 | 52! ≈ 8.07×10^67
Permutations and combinationsCounting arrangements and selections in probability problems.

Permutations P(n,r) = n!/(n−r)!: ordered selections of r items from n. Example: P(10,3) = 10!/7! = 10×9×8 = 720. Combinations C(n,r) = n!/(r!(n−r)!): unordered selections. C(10,3) = 720/6 = 120. Compute n! and (n−r)! separately using this calculator, then divide using the Big Number Calculator.

P(n,r) = n!/(n−r)! | C(n,r) = n!/(r!(n−r)!)C(52,5) = 52!/(5!×47!) = 2,598,960 (poker hands)
Stirling's approximation for large nEstimating n! when the exact value is too large to work with.

Stirling's formula: n! ≈ √(2πn) × (n/e)^n. For n=10: √(20π) × (10/e)^10 ≈ 3,598,696 vs exact 3,628,800 — error 0.83%. For n=100: error 0.083%. The approximation improves as n grows. Useful in statistical physics and information theory where log(n!) = n×log(n) − n + ½×log(2πn) is needed.

ln(n!) ≈ n×ln(n) − n + ½×ln(2πn)100! has 158 digits | Stirling: e^(157.97) ≈ exact

Quick Reference

Common factorial values — verify in the calculator above.

Definition

0!

1

Factorial

5!

120

Factorial

10!

3,628,800

Factorial

20!

2,432,902,008,176,640,000

Large n

100!

158 digits

Double !!

7!!

105

Double !!

8!!

384

Very large

1000!

2,568 digits

Tips & Shortcuts

✓

The expanded multiplication shows for small n (up to ~12) — useful for seeing exactly how the factorial builds up step by step.

✓

For permutations P(n,r): compute n! with this calculator, then compute (n−r)! and divide using the Big Number Calculator for exact results.

✓

The digit count next to the result tells you the order of magnitude: 100! has 158 digits means it is between 10^157 and 10^158.

✓

Double factorial n!! of an even number relates to regular factorial: (2n)!! = 2^n × n!. Example: 8!! = 2^4 × 4! = 16 × 24 = 384.

✓

For very large n (above 10000), computation may take a second or two — this is normal for exact BigInt arithmetic at this scale.

Common Mistakes

✕

Confusing n! with n^n

n! multiplies all integers from 1 to n. n^n multiplies n by itself n times. 4! = 24 but 4^4 = 256. They grow differently: n! eventually dominates n^n for large n.

✕

Expecting a standard calculator to compute 70!

Standard calculators (including most phone calculators) overflow at 69! because 70! ≈ 1.20 × 10^100 exceeds 64-bit floating-point maximum. This BigInt calculator has no such limit.

✕

Confusing double factorial with factorial of factorial

(n!)! is the factorial of n!, which is astronomically larger. n!! is the double factorial — only every other integer. 5! = 120, but (5!)! = 120! (a 199-digit number). 5!! = 5×3×1 = 15.

✕

Trying to enter a decimal number for factorial

Factorial is defined for non-negative integers only. The Gamma function extends factorial to non-integers (n! = Γ(n+1)), but this calculator only handles integer inputs.

✕

Assuming n! / (n−r)! requires computing huge intermediate factorials

P(n,r) = n×(n−1)×...×(n−r+1) — just r multiplications, not full factorial. For P(52,5) = 52×51×50×49×48 = 311,875,200. The Permutation-Combination Calculator handles this directly.

Frequently Asked Questions

n! = n × (n−1) × (n−2) × ... × 2 × 1. It counts arrangements of n distinct items. 5! = 120. 0! = 1 by convention (the empty product). Factorials grow faster than exponentials: 10! = 3,628,800 while 10^10 = 10,000,000,000. By n=20, factorial exceeds 2 quintillion (2.43 × 10^18).

10! = 10 × 9 × 8 × 7 × 6 × 5 × 4 × 3 × 2 × 1 = 3,628,800. This is the number of distinct sequences you can form from 10 unique items — for example, the number of ways 10 runners can finish a race. The calculator shows the expanded multiplication for small n like this.

n!! multiplies every other integer. Odd n: n!! = n × (n−2) × ... × 3 × 1. Even n: n!! = n × (n−2) × ... × 4 × 2. Examples: 7!! = 7×5×3×1 = 105. 8!! = 8×6×4×2 = 384. 1!! = 1. 2!! = 2. Double factorials appear in physics integrals, combinatorics, and the Wallis product formula for π.

Three reasons: (1) Empty product: multiplying zero numbers gives 1 by convention, like how an empty sum equals 0. (2) Recurrence: n! = n × (n−1)! implies 1! = 1 × 0!, so 0! must equal 1. (3) Binomial consistency: C(n,0) = n!/(0!·n!) = 1, meaning there is exactly one way to choose nothing from a set. All three give 0! = 1.

Digit count ≈ n×log₁₀(n/e) + ½×log₁₀(2πn) by Stirling's approximation. Key values: 10! = 7 digits, 20! = 19 digits, 50! = 65 digits, 100! = 158 digits, 1000! = 2,568 digits, 10000! = 35,659 digits. The calculator shows the exact digit count alongside the full result.

Permutations (ordered arrangements): P(n,r) = n!/(n−r)!. Combinations (unordered selections): C(n,r) = n!/(r!(n−r)!). Probability of a specific ordering of n items: 1/n!. Binomial theorem coefficients. Example: a standard 52-card deck can be arranged in 52! ≈ 8.07 × 10^67 distinct orders — more arrangements than atoms in the observable universe.

No hardcoded limit. 1000! (2,568 digits) computes in about 10ms. 10000! (35,659 digits) takes 1-2 seconds. 100000! would require significant time and memory. Standard scientific calculators overflow at 69! (the result exceeds the maximum 64-bit float). This calculator uses BigInt for exact results at any size.

Related Calculators