Factorial Calculator
Calculate factorial of a number
About This Tool
The Factorial Calculator computes n! (n factorial) for any non-negative integer. Factorial is the product of all positive integers less than or equal to n, and is fundamental in combinatorics, probability, and mathematics.
Enter a number to calculate its factorial instantly, see the step-by-step multiplication, and learn about factorial properties and applications.
How It Works
How to Use This Calculator
Calculating factorials is simple:
- Enter a number - Type any non-negative integer (0 or greater).
- Click Calculate - Get the factorial result instantly.
- View steps - See the complete multiplication breakdown.
- Explore - Learn about factorial properties and applications.
Formula
Factorial Formula
n! = n x (n-1) x (n-2) x ... x 2 x 1
Special cases:
- 0! = 1 (by definition)
- 1! = 1
Recursive definition: n! = n x (n-1)!
First 10 factorials: 0! = 1, 1! = 1, 2! = 2, 3! = 6, 4! = 24, 5! = 120, 6! = 720, 7! = 5040, 8! = 40320, 9! = 362880
Examples
Examples
Example 1: Small Factorial
- Input: 5
- Calculation: 5 x 4 x 3 x 2 x 1
- Result: 5! = 120
Example 2: Medium Factorial
- Input: 10
- Calculation: 10 x 9 x 8 x 7 x 6 x 5 x 4 x 3 x 2 x 1
- Result: 10! = 3,628,800
Example 3: Large Factorial
- Input: 20
- Result: 20! = 2,432,902,008,176,640,000
Frequently Asked Questions
What is a factorial and how is it calculated?
Factorial of n (written n!) is the product of all positive integers from 1 to n. For example, 5! = 5 × 4 × 3 × 2 × 1 = 120. By definition, 0! = 1. Factorials grow extremely fast — 20! is already over 2.4 quintillion.
Where are factorials used in mathematics?
Factorials are fundamental in combinatorics for permutations (n!) and combinations (n!/k!(n-k)!), probability theory, Taylor series expansions, and the gamma function. They count the number of ways to arrange n distinct objects.
What is the largest factorial the calculator can compute?
The calculator handles factorials up to 170! using standard floating-point arithmetic. Beyond that, results exceed the maximum representable number. For larger values, the calculator uses big integer arithmetic to show exact results.
What is Stirling's approximation for large factorials?
Stirling's formula approximates large factorials: n! ≈ √(2πn) × (n/e)^n. For n=100, the approximation is accurate to within 0.08%. This is useful when exact computation is impractical.
What is a double factorial?
Double factorial (n!!) multiplies every other number: 7!! = 7 × 5 × 3 × 1 = 105, and 8!! = 8 × 6 × 4 × 2 = 384. It appears in combinatorics and certain integral formulas. Note that n!! ≠ (n!)!.
Disclaimer
Disclaimer: This calculator provides results for general reference and educational purposes only. While we strive for accuracy, results for very large numbers may be subject to computational limitations. All processing happens in your browser.
💡 Tips
Tips
- Factorials grow extremely fast (faster than exponential)
- 0! = 1 by mathematical convention
- Factorials are only defined for non-negative integers
- Use for permutations: n! ways to arrange n items
- For combinations, use n!/(r!(n-r)!)