🔢

Factorial Calculator (n!) with Expressions & Permutations

Step-by-Step Breakdown • Expressions Solver • Permutations & Combinations

Factorial & Expression Solver

Calculate exact factorials, solve equations (e.g. 5! + 3! or 10!/5!), or use the slider

5!
Type an integer (e.g. 10), a factorial notation (10!), or complex formulas.
5
Drag to instantly compute exact factorials from 0! to 170!.
Result (5!):
120

Step-by-Step Multiplication

5! = 5 × 4 × 3 × 2 × 1
= 5 × 4!
= 20 × 3!
= 60 × 2!
= 120 × 1
= 120

Mathematical Presets & Benchmarks

Quickly load specific mathematical constants, arrangements, and combinatorics limits

Arrangements (nPr) & Selections (nCr)

Calculate probabilities, permutations, and choices using optimized overflow-proof algorithms

Permutations (nPr)
n! / (n - r)!
10P3 =720
Order matters (e.g. race finishes, passcode digits).
Combinations (nCr)
n! / [r! × (n - r)!]
10C3 =120
Order does not matter (e.g. lottery picks, team formations).

Stirling's Approximation Studio

Estimate giant factorials up to 10,000! and track mathematical error tolerances

Stirling's theorem calculates $\ln(n!) \approx n\ln(n) - n + 0.5\ln(2\pi n)$ to bypass double-precision overflow limits.

Error Matrix (Exact vs Stirling)

Target Factorial:5!
Exact Value:120
Stirling's Estimate:1.180 × 10^2
Absolute Error:1.98
Relative Margin:1.6500%
💡 Margin drops below **1%** at $n \ge 10$. As $n \to \infty$, relative error approaches zero.

Recent Tape Calculations

combination 10C3120
permutation 10P3720
factorial 5!120

Factorial Reference Chart (n! Quick Guide)

Instant numerical guides for small and landmark factorial inputs

Input (n)Factorial Notation (n!)Exact Value / Decimal Form
11!1
22!2
33!6
44!24
55!120
66!720
77!5,040
88!40,320
99!362,880
1010!3,628,800
1111!3.992 × 10^7
1212!4.790 × 10^8
1313!6.227 × 10^9
1414!8.718 × 10^10
1515!1.308 × 10^12
2020!2.433 × 10^18
2525!1.551 × 10^25
3030!2.653 × 10^32
5050!3.041 × 10^64
100100!9.333 × 10^157
170170!7.257 × 10^306

Overview & Capabilities

Calculate factorials (n!), permutations (nPr), and combinations (nCr) with our advanced calculator. Features step-by-step breakdowns, expression parsing, visual growth charts, and calculation history for easy understanding of factorial mathematics.

Tutorial

How to Use

01
Enter a number (0-170) to calculate its factorial
02
Use the expression solver for complex calculations like 10!/5! or (6!+4!)/(5!)
03
Calculate permutations (nPr) to find arrangements of r items from n items
04
Calculate combinations (nCr) to find selections of r items from n items
05
View step-by-step breakdowns to understand the calculation process
06
Copy or share your results with one click
Capabilities

Key Features

Factorial Calculation: Compute n! for numbers 0 to 170 instantly
Expression Parser: Solve complex expressions with multiple factorials
Permutation Calculator: Calculate nPr = n!/(n-r)! for arrangements
Combination Calculator: Calculate nCr = n!/(r!(n-r)!) for selections
Step-by-Step Breakdown: Visual expansion showing each multiplication
Power Search: Natural language input like "10 factorial" or "10 choose 3"
Calculation History: Review and reload your last 10 calculations
Popular Examples: Real-world scenarios like deck shuffling, lottery odds
Scientific Notation: Automatic formatting for very large numbers
Mobile Optimized: Touch-friendly inputs and responsive design
Applications

Common Use Cases

Mathematics Education: Learn factorial concepts with visual breakdowns
Combinatorics: Calculate permutations and combinations for probability
Algorithm Analysis: Understand O(n!) time complexity
Statistics: Compute binomial coefficients and probability distributions
Programming: Verify factorial implementations and edge cases
Puzzle Solving: Calculate possible arrangements and selections
Game Theory: Determine possible game states and outcomes
Cryptography: Understand keyspace sizes and combinations
Guidance

Tips & Best Practices

💡
Use the expression solver for ratios like 10!/5! to avoid overflow
💡
Check the step-by-step breakdown to understand the calculation
💡
Use permutations (nPr) when order matters (e.g., race positions)
💡
Use combinations (nCr) when order doesn't matter (e.g., lottery)
💡
Remember: 0! = 1 by mathematical definition
💡
Maximum factorial is 170! due to computational limits
💡
Use scientific notation for very large results
💡
Save time by using popular examples for common calculations
Answers

Frequently Asked Questions

Q What is a factorial, and how is n! calculated?

A factorial (denoted as n!) is the product of all positive integers less than or equal to n. For example: 5! = 5 × 4 × 3 × 2 × 1 = 120. It represents the number of ways to arrange n distinct objects.

Q Why does 0 factorial (0!) equal 1?

By mathematical definition, 0! = 1. This is consistent with combinatorics formulas (there is exactly 1 way to arrange 0 items: doing nothing) and the recursive relationship n! = n × (n-1)!, which for n=1 yields 1! = 1 × 0!, meaning 0! must equal 1.

Q What is the difference between permutations (nPr) and combinations (nCr)?

Permutations (nPr) count arrangements where the order matters (e.g. race podium finishes: 1st, 2nd, 3rd). Combinations (nCr) count selections where the order does not matter (e.g. choosing 5 lottery numbers). nPr = n! / (n-r)! and nCr = n! / (r! × (n-r)!).

Q What is Stirling's Approximation and when is it used?

Stirling's Approximation is an analytical formula used to estimate factorials: n! ≈ sqrt(2 × π × n) × (n / e)^n. It is extremely useful in physics, probability, and computer science for calculating huge factorials where exact multiplication is computationally expensive or overflows standard numerical types.

Q Why does a standard calculator throw an error for factorials above 170?

Computers use the IEEE 754 double-precision floating-point format to store large decimal values. This format has a maximum value limit of approximately 1.79 × 10^308. Since 170! is about 7.26 × 10^306 and 171! is 1.24 × 10^309, any factorial higher than 170 overflows this hardware limit and is represented as Infinity.