Compute n! exactly for any non-negative integer using BigInt precision — see the multiplication chain, digit count, and double factorial.
Enter a non-negative integer to compute its exact factorial
This free factorial calculator computes n! exactly for any non-negative whole number, using JavaScript's BigInt arithmetic so every digit stays precise no matter how enormous the result gets. Factorial — the product of all whole numbers from n down to 1 — is one of the fastest-growing functions in elementary mathematics: 10! is already 3,628,800, and 100! is a 158-digit number. Because ordinary floating-point numbers lose exact precision well before that point, this exact factorial calculator uses BigInt to guarantee every digit is correct, whether you're checking 5! for a homework problem or computing 500! for a combinatorics proof. It also computes the related double factorial (n!!) and shows the full multiplication chain for smaller values.
Enter any non-negative integer n (0 up to 5,000) and the calculator returns n! computed with exact BigInt precision, along with its total digit count. For n ≤ 10 it also displays the full multiplication chain (e.g. 5! = 5×4×3×2×1 = 120) so you can follow every step. Alongside the standard factorial, it computes the double factorial n!!, which multiplies every other integer down to 1 or 2 instead of every integer.
This tool is built for students learning combinatorics, permutations, and combinations; teachers preparing probability worksheets; competitive-exam candidates who need instant, exact factorial values; programmers verifying a custom factorial function; and anyone curious how large a factorial gets before it becomes an impractically large number to write out by hand.
Factorials count the number of ways to arrange a set of distinct items in order — 5! = 120 ways to arrange 5 books on a shelf, for example. This makes factorial the foundation of permutations (nPr) and combinations (nCr), which in turn underpin probability theory, statistics, and much of discrete mathematics. Factorials also appear in the denominators of Taylor and Maclaurin series expansions (for e^x, sin x, cos x), where their rapid growth is exactly what makes those infinite series converge.
Combinatorics and probability problems use factorials to count arrangements and outcomes. Computer science courses use factorial growth to illustrate algorithmic complexity, especially for brute-force permutation-based algorithms. Statisticians use factorials inside the binomial and Poisson probability formulas. Double factorials show up in trigonometric integral reduction formulas and Gaussian integral expansions used in physics and statistics.
How this factorial calculator turns n into n! and n!! with exact precision
n! = n × (n−1)!, with the base case 0! = 1 — this recursive relationship is how factorial is formally defined in mathematics.
Factorial grows faster than exponential functions — 10! = 3,628,800, but 20! already exceeds 2.4 quintillion.
JavaScript's regular Number type loses precision past 2^53 (~9 quadrillion); BigInt keeps every digit of even a 16,000-digit result exact.
From entering n to reading the exact result
Type a whole number n from 0 up to 5,000 into the input field.
The calculator multiplies every whole number from n down to 1 using BigInt arithmetic for exact precision.
Smaller results display in full; very large results are truncated for display, with the full value available and the digit count shown.
See exactly how many digits the result has — factorials grow far faster than most people expect.
See the product of every other integer down to 1 or 2, shown alongside the standard factorial.
For n ≤ 10, review the full multiplication chain to confirm the calculation step by step.
Computing 7! and 7!! step by step
How many ways can 7 distinct books be arranged on a shelf, and what is the double factorial 7!! used for comparison?
Explanation: 7! answers "how many ways can 7 distinct items be ordered?" while 7!! is a different, smaller quantity that only multiplies alternating terms. The two are easy to confuse by notation alone, which is why this calculator always displays them side by side.
What each output actually represents
| Output | What It Means | Example |
|---|---|---|
| n! | The total number of ways to arrange n distinct items in order | 5! = 120 → 120 ways to arrange 5 items |
| Digit Count | How many digits the exact factorial has — a measure of how large the result is | 100! has 158 digits |
| n!! (double factorial) | The product of every other integer down to 1 or 2 — not the same as (n!)! | 6!! = 6×4×2 = 48 |
| 0! | Defined as 1 by convention, representing the single way to arrange zero items | 0! = 1 |
Reading truncated results: when a factorial's exact value has more digits than fit comfortably on screen, this calculator shows the leading and trailing digits with the full digit count noted, and the complete exact value remains available in the scrollable box below.
Typical ranges: factorial grows super-exponentially — each increase of n by 1 multiplies the result by n, so digit count roughly follows n×log₁₀(n) for large n.
Manual verification: for small n, multiply the chain of numbers by hand (n × (n−1) × … × 1) and confirm it matches the calculator's output exactly — there should be no rounding involved at any step.
Where exact factorial values are genuinely useful
Practice permutations, combinations, and counting problems that build directly on factorial.
Get instant, exact factorial values for probability and counting questions under time pressure.
Compute arrangements and outcome counts inside binomial and Poisson probability formulas.
Illustrate algorithm complexity for brute-force permutation-based algorithms that scale as O(n!).
Evaluate factorial terms in Taylor and Maclaurin series for e^x, sin x, and cos x.
Use factorial as the building block of the combinations formula nCr = n!/(r!(n−r)!).
Sanity-check a custom factorial function against exact BigInt-computed reference values.
Use double factorials in Gaussian integral expansions and trigonometric reduction formulas.
Explore how quickly factorial grows and compare it to exponential and polynomial functions.
Compute the number of possible orderings or samples for combinatorial data analysis.
Generate instant, exact factorial worked examples for classroom demonstrations.
Calculate the total number of arrangements possible in card games, puzzles, or seating charts.
What this factorial calculator does well, and where it has boundaries
Four closely related counting concepts, compared
| Concept | Formula | What It Counts |
|---|---|---|
| Factorial (n!) | n × (n−1) × … × 1 | Ways to arrange all n distinct items in order |
| Double Factorial (n!!) | n × (n−2) × (n−4) × … | Product skipping every other integer; appears in series and pairing counts |
| Permutations (nPr) | n! ÷ (n−r)! | Ordered arrangements of r items chosen from n |
| Combinations (nCr) | n! ÷ (r! × (n−r)!) | Unordered selections of r items chosen from n |
Summary: This factorial calculator gives you an instant, exact way to compute n! and n!! for any non-negative integer up to 5,000, backed by BigInt precision so every digit stays correct. Pair it with the Prime Number Checker and Sequence & Series Calculator for a fuller toolkit of number theory and combinatorics calculators.
Common questions about factorials
Trusted educational references to go deeper on combinatorics and factorials
Explore other math tools