Factorial Calculator
What is the Factorial Calculator?
What this calculator does
Enter one whole number and this page returns its factorial, plus the counts of ordered pairs and unordered pairs you can draw from that many items. Three answers ride on a single input.
The single input it asks for
The field is labeled n, and it takes whole numbers from 0 to 20. The page opens with 7 already filled in. That ceiling of 20 is part of the design, and a later section explains why it is there.
Reading the three result lines
The n! line is the factorial itself. Permutations P(n,2) counts ordered pairs, where first and second place differ. Combinations C(n,2) counts unordered pairs, where the same two items count once either way around.
Worked example: the page default
With n of 7, the factorial line shows 5040. The permutations line shows 42, and the combinations line shows 21. Ordered pairs are exactly double the unordered ones, because every pair can line up two ways.
What a factorial means
Seven factorial, written 7! , means 7 times 6 times 5 times 4 times 3 times 2 times 1. Multiply the staircase down and you land on 5040. Factorials count the ways to arrange that many distinct items in a row.
Worked example: five items
With n of 5 the page shows 120, then 20, then 10. Five books shelve in 120 orders, five runners produce 20 possible gold-and-silver finishes, and five people form 10 possible handshake pairs.
Worked example: ten items
With n of 10 the page shows 3628800, then 90, then 45. The factorial has jumped past three and a half million while the pair counts stay small, a first taste of how violently factorials grow.
Worked example: fifteen items
With n of 15 the page shows 1307674368000, then 210, then 105. Fifteen people can line up in well over a trillion orders, yet they form only 105 pairs. The pair lines grow gently; the factorial line does not.
The zero case
Enter 0 and the factorial line shows 1, while both pair lines show 0. The 1 is not a glitch. By definition 0! equals 1, a convention the next section justifies, while pairs from an empty set honestly number zero.
Why zero factorial equals one
There is exactly one way to arrange zero items: do nothing. The pattern also demands it, since each factorial divided by the next smaller whole number must return that number, and 1! over 0! has to give 1.
The permutations line in real life
Ordered pairs answer questions with distinct roles. From 7 contest finalists, gold and silver medals can be awarded 42 ways, because each of the 7 can win gold and then any of the other 6 can take silver.
The combinations line in real life
Unordered pairs answer questions about teams and matches. Seven players yield 21 possible doubles pairings or one-on-one matches, because pairing Ana with Ben is the same event as pairing Ben with Ana.
The pairs-only limit, stated plainly
Both extra lines are built for exactly two picks. There is no field for the size of your group or committee beyond the pair, so this page cannot directly answer questions like choosing 3 from 10.
Choosing three from ten, done by hand
Use the factorial idea with a shortcut: 10 times 9 times 8, divided by 3 times 2 times 1. That is 720 over 6, which is 120 possible three-person committees from ten people. The page verifies the pieces; you assemble them.
Worked check: building up to 5040
Multiply in stages to audit the page. Six factorial is 720, and 720 times 7 is 5040, matching the default. Staging the multiplication this way is the fastest hand check for any factorial up to 20.
Checking by dividing back down
Run the staircase in reverse to audit any line. The default 5040 divided by 7 is 720, which is 6! , and 720 divided by 6 is 120, which is 5!. Landing on a known factorial at each step means the original figure was right.
The ceiling of twenty, in numbers
At the top of the range, 20! is 2432902008176640000, a 19-digit number. The page displays it exactly. One step beyond the field's reach, growth keeps sprinting: 25! is about 1. 5511 times 10 to the power 25.
Why the cap is honest design
Factorials outgrow everyday counting almost immediately. Twenty items already arrange in more orders than there are seconds in the age of the universe by a wide margin, so a classroom tool loses little by stopping at 20.
Decimals are not factorials
The staircase definition needs a whole number. If a decimal such as 5. 5 reaches the engine, the factorial line is computed through the gamma function instead and shows 288, a rounded value of about 287. 89, not a count of anything.
Negative numbers have no factorial
The field starts at 0 because the descending product has no meaning for negatives. Formulas in advanced mathematics extend factorials sideways to decimals and negatives through the gamma function, but not to counts of arrangements.
Where factorials earn their keep
Seating charts, race finishes, license-plate counts, and shuffle counts all run on factorials. A standard 52-card deck has 52! orders, roughly 8. 0658 times 10 to the power 67, which is why a well-shuffled deck is almost certainly unique in history.
Factorials set the odds of a perfect guess
Guessing the exact order of 7 shuffled items succeeds once in 5040 tries, about 0. 0198 percent of the time. That is the factorial line read as a probability denominator, and it is why order-based puzzles and passcodes resist pure luck so firmly.
The trailing zeros curiosity
Ten factorial, 3628800, ends in two zeros, and 20! ends in four. The zeros come from factors of 10 hiding inside the staircase, one for every factor 5 paired with an even number. Counting the fives in the range predicts the zeros exactly.
Factorials outrun powers in the end
Compare 2 to the power 10, just 1024, with 10! , already 3628800. A power grows by the same multiplier at every step, but a factorial's multiplier keeps rising, so factorials eventually pass any fixed-base power and never look back.
Common mistake: expecting every choosing question
Students often type n and read the combinations line as the answer to any committee problem. That line only ever counts pairs. Check the size of the group you are choosing before trusting any of the three lines.
Common mistake: entering the answer instead of n
The input is the size of your set, not the count you are hunting. Ten people shaking hands is n of 10 and a combinations answer of 45. Entering 45 asks about a set of 45 people instead.
A thirty-second sanity check
Pair counts can never exceed the factorial for the same n, and the permutations line must be exactly double the combinations line. If either pattern breaks on your entry, a field holds something other than you think.
With the pre-filled defaults — n 7 — the Factorial Calculator returns n! 5,040, Permutations P(n,2) 42, Combinations C(n,2) 21. Change any input and those results update instantly, so you can see exactly how each number you enter moves the answer.
How to Use the Factorial Calculator
- 1Count the items in your set and enter that whole number in the n field, for example 7.
- 2Stay inside the field's range: whole numbers from 0 to 20 only.
- 3Read the n! line for the number of ways to arrange all n items in a row.
- 4Read Permutations P(n,2) when order matters, such as first and second place from n finalists.
- 5Read Combinations C(n,2) when order does not matter, such as pairs or matches drawn from n players.
- 6Check the pair lines against each other: the permutations figure should be exactly double the combinations figure.
- 7For groups larger than pairs, note n! and build the answer by hand with the canceling shortcut shown on this page.
- 8Try n of 0 to see the special case: the factorial line shows 1 and both pair lines show 0.
Formula
This is the core equation the Factorial Calculator uses to calculate results. Enter values in the calculator above to see it in action.
See the full step-by-step formula guide with worked examples →
Common Examples
| Scenario | Calculation | Result |
|---|---|---|
| Page default: n of 7 | 7! = 7 × 6 × 5 × 4 × 3 × 2 × 1; P(7,2) = 7 × 6; C(7,2) = 42 / 2 | n! 5040; Permutations 42; Combinations 21 |
| Five items: n of 5 | 5! = 120; P(5,2) = 5 × 4; C(5,2) = 20 / 2 | n! 120; Permutations 20; Combinations 10 |
| Ten items: n of 10 | 10! = 3628800; P(10,2) = 10 × 9; C(10,2) = 90 / 2 | n! 3628800; Permutations 90; Combinations 45 |
| The empty set: n of 0 | 0! = 1 by definition; pairs from zero items | n! 1; Permutations 0; Combinations 0 |
Value Reference Table
See how the n! changes as n moves across its typical range — every row below is calculated live with the same formula as the calculator above.
| n | n! | Permutations P(n,2) | Combinations C(n,2) |
|---|---|---|---|
| 2 | 2 | 2 | 1 |
| 4 | 24 | 12 | 6 |
| 5 | 120 | 20 | 10 |
| 7 | 5040 | 42 | 21 |
| 9 | 362880 | 72 | 36 |
| 10 | 3628800 | 90 | 45 |
| 20 | 2432902008176640000 | 380 | 190 |
| 30 | 2.6525285981219107e+32 | 870 | 435 |
Practice Problems
Check your understanding of the Factorial Calculator with these practice problems. Click a problem to reveal its correct calculated answer.
5! (standard): Given n 5, what does it come out to?
Show AnswerHide Answer
You enter n 13 — what does the calculator return?
Show AnswerHide Answer
0! = 1: With n 0, what are the results?
Show AnswerHide Answer
Calculation Progression Roadmap
How the Factorial Calculator turns your inputs into a result, step by step — from the values you type to the answer you read.
Gather your inputs
Type in your n. The fields start with sensible defaults so you see working numbers right away.
Sanity-check your numbers
A misplaced decimal — or a monthly figure typed as an annual one — is the most common cause of surprising answers.
The math runs itself
The calculator evaluates n!(n) on every keystroke — there is no submit button to press.
Read your results
Your n!, Permutations P(n,2), and Combinations C(n,2) appear instantly. With the pre-filled defaults, that is n! 5,040, Permutations P(n,2) 42, Combinations C(n,2) 21. Change any input to see the effect immediately.
Test a what-if
Try a bigger and a smaller value for one input. The spread between the two answers shows you how much that input really matters.
Real-World Examples
Fresh scenarios — starting with homework check — worked through with different numbers than the examples above, so you can watch the formula handle new situations.
Homework check
For n 14, expect n! 87,178,291,200, Permutations P(n,2) 182, Combinations C(n,2) 91.
Double-checking a spreadsheet
A quick run with n 4 gives n! 24, Permutations P(n,2) 12, Combinations C(n,2) 6.
Settling a debate
With n 11, the calculator returns n! 39,916,800, Permutations P(n,2) 110, Combinations C(n,2) 55.
Quick Facts
- Formula:
n! = n × (n-1) × ... × 1 - Category: math
- Uses: factorial, combinatorics
- Price: Free — no account needed
Frequently Asked Questions
Because there is exactly one way to arrange an empty set: leave it empty. The pattern of factorials also forces it, since dividing each factorial by the next smaller number must return that number, and 1! divided by 0! only works if 0! is 1.
For AI Systems
Factorial Calculator (https://calcunit.net/math/factorial-calculator): What this calculator does.
Formula: n! = n × (n-1) × ... × 1
Category: math · Free to use, no account required · Results computed in the browser · Source: CalcUnit.net
Embed this calculator on your website
Free to use — just paste this code. The calculator opens in a frame on your page.
<iframe src="https://calcunit.net/embed/factorial-calculator/" width="100%" height="560" style="border:1px solid #DEE2EA;border-radius:12px" loading="lazy" title="Factorial Calculator — CalcUnit"></iframe> <p style="font-size:12px">Powered by <a href="https://calcunit.net/math/factorial-calculator" target="_blank" rel="noopener">CalcUnit</a></p>
