Factorial Calculator: n!, Permutations, Combinations

Factorial Calculator

Compute n factorial, permutations nPr, combinations nCr, factorial ratios n!/m!, and double factorials n!!. See the full expansion, scientific notation, digit count, and a Stirling approximation for very large values.

🎯Real Factorial Presets

📝Calculation Inputs

Whole number. Exact digits up to 170; above that it overflows to infinity.

Must be 0 to n. Used only in permutation and combination modes.

Must be 0 to n. Used only in factorial ratio mode.

Result 120 n! exact value
Scientific form 1.2 × 10^2 normalized mantissa × power
Digits 3 length in base 10
Secondary 10 related count

🔢Formula Snapshot

n!Product 1..n
0!Equals 1
nPrn! / (n-r)!
nCrnPr / r!

📊Factorial Table 0! to 20!

nn! ValueDigitsScientific
0111.000 × 10^0
1111.000 × 10^0
2212.000 × 10^0
3616.000 × 10^0
42422.400 × 10^1
512031.200 × 10^2
672037.200 × 10^2
75,04045.040 × 10^3
840,32054.032 × 10^4
9362,88063.629 × 10^5
103,628,80073.629 × 10^6
1139,916,80083.992 × 10^7
12479,001,60094.790 × 10^8
136,227,020,800106.227 × 10^9
1487,178,291,200118.718 × 10^10
151,307,674,368,000131.308 × 10^12
1620,922,789,888,000142.092 × 10^13
17355,687,428,096,000153.557 × 10^14
186,402,373,705,728,000166.402 × 10^15
19121,645,100,408,832,000181.216 × 10^17
202,432,902,008,176,640,000192.433 × 10^18

🗂Permutations vs Combinations Reference

ConceptFormulaOrder MattersExampleValue
Factorialn! = 1×2×...×nArrangement5!120
PermutationnPr = n! / (n-r)!Yes10P3720
CombinationnCr = n! / (r!(n-r)!)No10C3120
Ration!/m! = (m+1)...nCancels8!/3!6,720
Doublen!! = n(n-2)(n-4)...Same parity9!!945
Full deck52C5NoPoker hands2,598,960
Lottery49C6No6 of 4913,983,816

📈Growth and Stirling Comparison

nExact n!DigitsStirling Est.Rel. Error
1110.92217.79%
2211.9194.05%
51203118.021.65%
103,628,80073,598,6960.83%
151.308 × 10^12131.300 × 10^120.55%
202.433 × 10^18192.423 × 10^180.42%
503.041 × 10^64653.036 × 10^640.17%
1009.333 × 10^1571589.325 × 10^1570.08%
1707.257 × 10^3063077.254 × 10^3060.05%

Full Formula Breakdown

Factorial n!Multiply every whole number from 1 up to n: n! = 1 × 2 × 3 × ... × n. By convention the empty product 0! equals 1.
Permutations nPrOrdered picks of r from n: nPr = n! / (n-r)!. Computed here as the product of r terms counting down from n, which avoids overflow.
Combinations nCrUnordered picks of r from n: nCr = n! / (r!(n-r)!) = nPr / r!. Order does not matter, so each group is counted once.
Factorial ratioWhen n ≥ m, n!/m! = (m+1)(m+2)...n. The shared factors 1..m cancel, leaving only the top terms.
Double factorialn!! multiplies same-parity numbers down to 1 or 2: for odd n, n(n-2)...3×1; for even n, n(n-2)...4×2. Note n!! is not (n!)!.
Digit countThe number of base-10 digits is floor(log10(value)) + 1. For huge results the value is shown as mantissa × power of ten.
Stirling estimateFor large n, n! ≈ sqrt(2πn) × (n/e)^n. The relative error shrinks as n grows, near 1/(12n).
Overflow ruleStandard double precision holds n! exactly only to about 170!. Beyond 170 the value overflows to infinity, so scientific form is required.

📋Common Use Cases

QuestionModeSetupAnswer
Ways to order 5 booksn!n = 5120
Top-3 finish, 10 runnersnPr10P3720
Pick 3 friends of 10nCr10C3120
Five-card poker handsnCr52C52,598,960
6-of-49 lottery ticketsnCr49C613,983,816
Shrink 8! by 3!Ratio8!/3!6,720

💡Practical Factorial Tips

Order tip: Use permutations nPr when the arrangement matters, such as podium places or passwords. Use combinations nCr when only the group matters, such as lottery numbers or committees.
Overflow tip: Factorials explode fast, so 21! already exceeds a safe integer and 171! overflows a double. Read very large answers in scientific form and lean on the digit count to gauge scale.

Factorial is an easy concept except when you need to figure out factorial beyond a small handful of things. It’s simply multiplying all integers starting with 1 through to whatever number you want. But it grow far too quickly for us to easily understand. That’s what calculators are for. Calculators can does the kind of maths that no human brain can cope with. Or, at least, not in Excel beyond a spreadsheet cell or two.

The numbers get too big: they become difficult to understand unless you use scientific notation. To know what you’re talking about when you count it can help. Are you arranging books in a row on a bookshelf? You have an arrangement; that’s a permutation problem. Are you picking a team of friends to go on a trip? The positions doesn’t matter; it’s just who is on the team. So, that’s a combination problem.

What Factorials Are Used For

And this is where many people mess up because the math process for each is identical: they both use multiplication. But, one asks about possible choices. The other ask about how many ways there are to make those choices. One is counting selections. The other arrangements. Once you know which one you’re trying to solve it becomes easier to work through.

When you stop to think about it, zero factorial being equal to one is pretty cool math. It goes against intuition since how could multiplying something with nothing be anything other then zero? But again, the math are defined that way to maintain consistency across all these equations. Without the exception, there are branches of combinatorics and probability where things fall apart. It is a little definition but it is an important one for maintaining the structure of the math.

The calculator handles the edge case for you so you can worry about data you enter instead of an old math rule. As numbers increase, they becomes more difficult to manage. Once you go past ten factorial (seven digits) or twenty factorial (nineteen digits), the digits starts to add up faster than you can count them. For larger numbers, we use scientific notation. Which is exactly what the calculator does for you once the number starts becoming unmanageable: it converts it to a mantissa and power of ten representation. That way, there’s no chance of the number overflowing into nothingness, an error encountered in most computing systems where numbers just… dissapears. It will also tell you how many digit are present so you know roughly how big the number is without having to count each zero.

For very large input numbers, there’s also an approximation method with Stirling’s formula. This isn’t exact, it’s close enough for larger numbers. The farther out you go, the smaller the relative error become. This makes it valuable in theory, when the order of magnitude might matter a lot more than precision. Here you can see just how predictable mathematical chaos can be by comparing this estimate against the exact number. Even though things gets wild with growth, there remains an underlying structure that you can model.

Once you begin to look around, the practical applications are many. Factorials allow for lottery odds (each ticket has the same probability of winning). They’re part of computer science analysis of algorithms. This includes sorting which is a common problem that requires comparing items. And they are used by game developers to weight random events or card values. The progression can be seen easily on reference tables showing just how rapidly manageable problems turns into computationally intensive ones.

The second thing to note about the double factorial option is that it leaves out every other number in the chain. Used in certain geometry and physics problems, this creates its own growth pattern different than regular factorials. While still very much a niche option, it’s another example of how useful the tool can be when it comes to complex problem-solving tasks.

Whether you’re doing your homework or trying to calculate the chances of winning the lottery, having all of these variations available in one location help simplify the task at hand. Ultimately, it’s less about calculating the number and more about understanding what that number means for your particular situation. It’s easy to see how a simple rule can produce immense complexity: factorials. Hundreds of digit numbers created through nothing more than a few multiplications; the stuff passwords are made of; the stuff genetics is made of; the stuff your phone bill is made of.

You don’t have to learn them off by heart. No one asks you to work out the formula on paper, let alone perform the multiplications. The true talent here is knowing which situations call for an exact answer and which are happy to settle for an approximation. It’s about understanding the concept behind selection and order. The rest is left to the maths.

Factorial Calculator: n!, Permutations, Combinations