🔢

Factorial Calculator (n!) Studio

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

Compute exact mathematical factorials (\(n!\)), double factorials (\(n!!\)), permutations (\(nPr\)), and combinations (\(nCr\)) with our Factorial Calculator! Powered by arbitrary-precision BigInt arithmetic, our tool computes exact multi-thousand-digit integers without floating-point overflow or scientific rounding errors.

Tutorial

How to Use

01
Enter a non-negative integer \(n\) (e.g. 0 to 1000).
02
Optionally enter \(r\) to calculate Permutations (\(nPr\)) or Combinations (\(nCr\)).
03
Click 'Calculate Factorial' to evaluate.
04
View the full exact digit string, trailing zero count, and scientific notation.
05
Review the sequential product expansion and Stirling estimate comparison.
Capabilities

Key Features

Arbitrary-Precision BigInt Engine: Calculates exact factorial integers for values up to \(n = 1000\) without precision loss.
Permutations & Combinations (nPr, nCr): Built-in combinatorial solvers for probability distributions.
Trailing Zeros Counter (Legendre's Formula): Computes exact number of terminal zeros produced by prime factor 5.
Stirling's Asymptotic Approximation: Compares exact results against \(n! \approx \sqrt{2\pi n}(\frac{n}{e})^n\).
Double Factorials & Subfactorials (!n): Evaluates odd/even skip factorials and derangements.
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 (n!)?

The factorial of a non-negative integer n is the product of all positive integers less than or equal to n: n! = n × (n - 1) × (n - 2) × ... × 2 × 1. For example, 5! = 5 × 4 × 3 × 2 × 1 = 120.

Q Why is 0! equal to 1?

0! = 1 by mathematical definition to preserve recursive identities like n! = n × (n - 1)!, which for n = 1 gives 1! = 1 × 0!, requiring 0! = 1. Combinatorially, there is exactly 1 way to arrange an empty set of zero items.

Q How do you count trailing zeros in a factorial using Legendre's Formula?

Trailing zeros are formed by pairs of 2s and 5s (since 2 × 5 = 10). Because factors of 2 are abundant, count factors of 5: Zeros = floor(n/5) + floor(n/25) + floor(n/125) + ... For 100!: floor(100/5) + floor(100/25) = 20 + 4 = 24 trailing zeros.