The Factorial Calculator on FreeToolZones computes factorials exactly for whole numbers from 0 to 170, showing the full result, the number of digits, and a compact scientific form for large values. The factorial of a positive whole number n, written n with an exclamation mark, is the product of all whole numbers from 1 through n. Factorials grow astonishingly fast: 5 factorial is 120, 10 factorial is over 3.6 million, and 20 factorial is over 2.4 quintillion. They appear in counting problems, probability, arrangements, series expansions, and combinatorics, wherever the number of ways to order or choose items matters.
Because factorials grow so quickly, ordinary pocket calculators overflow or round them at modest sizes, and hand multiplication becomes impractical beyond about 10 factorial. This tool uses arbitrary-precision integer arithmetic, so every digit of the result is exact up to the limit of 170. It also provides a Copy result button, which copies the full exact integer, so you can paste it into a document, spreadsheet, or further calculation without retyping a long digit string and introducing errors.
What Is the Factorial Calculator?
The Factorial Calculator takes a single whole number n between 0 and 170 and returns n factorial, defined as the product 1 times 2 times 3 and so on up to n. The special case 0 factorial is defined as 1. That definition is not arbitrary: it makes the formulas for combinations, permutations, and power series work consistently when the count is zero. For example, there is exactly 1 way to choose nothing from a set, and the combination formula gives that answer only if 0 factorial is 1.
The main display shows n factorial in a compact form when the result is long: the first digit, a decimal point, the next six digits, and a power of ten. The full exact integer is shown below in a code-style block, so you can read or copy every digit. Two summary values accompany the result: the number of digits in the full integer, and an approximate value. For n equal to 0, the approximate value is shown as 1 by definition. The digit count is itself informative: it tells you at a glance how fast the factorial is growing as n increases by one.
The upper limit of 170 exists because 171 factorial is too large to represent exactly as a standard floating-point number, as the error message explains. The tool enforces the limit with a clear message rather than returning a rounded or overflowed value. Negative inputs and non-whole-number inputs are rejected, because the factorial as computed here is defined only for 0 and positive whole numbers. The related gamma function extends the idea to other numbers, but this tool does not compute it.
How to Use the Factorial Calculator
- Enter a whole number n between 0 and 170 in the n field. The tool starts with 10 as an example.
- Press Calculate, or change the value, because the result updates automatically as you type.
- Read the large display, which shows n factorial in compact form for large results, or the full number when it has 15 or fewer digits.
- Check the Number of digits and Approximate value summaries, then read the full exact integer in the block below.
- Press Copy result to copy the full exact integer to your clipboard, ready to paste elsewhere.
Try the sequence 0, 1, 2, 3, 4, and 5 to see the definition in action: 0 factorial is 1, 1 factorial is 1, 2 factorial is 2, 3 factorial is 6, 4 factorial is 24, and 5 factorial is 120. Each step multiplies the previous factorial by the new n, so 5 factorial is 4 factorial times 5, which is 24 times 5, which is 120. Try 10 factorial to get 3628800, which has 7 digits. Try 20 factorial to get 2432902008176640000, which has 19 digits. The jump from 7 digits to 19 digits in ten steps shows why factorials need exact integer arithmetic.
If you enter a decimal such as 5.5, the tool reports that n must be a whole number. If you enter a negative number, it reports that factorial is only defined for 0 and positive whole numbers. If you enter a number greater than 170, it reports the limit and the reason. These messages are part of the tool’s design: a factorial calculator that silently rounded or truncated its input would produce answers that look precise but mean nothing.
Key Features of the Factorial Calculator
- Exact results: Factorials are computed with arbitrary-precision integers, so every digit up to 170 factorial is exact.
- Full digit display: The complete integer is shown in a readable block, not only in scientific notation, so you can verify and copy it.
- Digit count: The number of digits is shown alongside the result, giving an immediate sense of the size of the factorial.
- Compact form: Large results are also shown in a short scientific form in the main display for quick reading.
- Copy button: One press copies the full exact result, avoiding transcription errors with long digit strings.
- Live updates: Changing n recalculates immediately, which makes it easy to explore how factorials grow.
- Clear limits: The 0 to 170 range, the whole-number requirement, and the reason for the upper limit are stated in the interface and in error messages.
The approximate value shown in the summary is a standard-number approximation of the exact integer, formatted to two decimal places. For small factorials it matches the exact value. For large factorials it is a rounded representation, and you should use the full integer block or the Copy result button whenever exact digits matter. The distinction between the exact integer and the approximation is worth understanding: it is the same distinction that makes this tool useful in the first place, because a calculator that only showed approximations would hide exactly the precision that counting problems require.
Practical Use Cases and Worked Examples
Example 1: Arranging items in a row
How many ways can 5 different books be arranged on a shelf? The answer is 5 factorial, which is 120. The reasoning is that there are 5 choices for the first position, 4 remaining choices for the second, 3 for the third, 2 for the fourth, and 1 for the last, and 5 times 4 times 3 times 2 times 1 is 120. For 7 books, 7 factorial is 5040. For 10 books, 10 factorial is 3628800. The number of arrangements grows far faster than the number of books, which is why brute-force checking of all arrangements becomes impossible for even modest collections.
Example 2: Seating and scheduling
Eight people sit in a row of eight chairs. The number of seating orders is 8 factorial, which is 40320. If the same eight people sit around a round table where rotations count as the same arrangement, the count is 7 factorial, which is 5040, because fixing one person’s position removes the rotational duplicates. For scheduling, the number of orders in which 6 tasks can be done is 6 factorial, which is 720. Factorials answer any question of the form: in how many orders can these distinct items appear?
Example 3: Combinations and permutations
Factorials are the building blocks of combinations and permutations. The number of ways to choose 3 items from 10, where order does not matter, is 10 factorial divided by the product of 3 factorial and 7 factorial, which is 3628800 divided by the product of 6 and 5040, which is 3628800 divided by 30240, which is 120. The number of ways to arrange 3 items chosen from 10, where order matters, is 10 factorial divided by 7 factorial, which is 3628800 divided by 5040, which is 720. You can verify the factorial values with this tool and the final counts with the dedicated combination and permutation calculators.
Example 4: Probability with factorials
Suppose 4 letters are shuffled randomly. What is the probability they end up in alphabetical order? There is 1 favourable order out of 4 factorial, which is 24, possible orders, so the probability is 1 over 24, about 0.041667. For 5 letters, the probability of one specific order is 1 over 120, about 0.008333. These small probabilities explain why random shuffles almost never produce a tidy order, and why card shuffles produce arrangements that have almost certainly never occurred before: 52 factorial is an enormously large number, far beyond this tool’s display needs but well within its exact range, since 52 is less than 170.
Example 5: Growth and digit counts
Enter 20 to see 2432902008176640000, with 19 digits. Enter 50 to see a 65-digit number. Enter 100 to see a 158-digit number. Each increment of n multiplies the previous factorial by n, so the digit count grows by roughly the number of digits in n, with occasional carries. Watching the digit count climb as you increase n from 10 to 30 is a vivid lesson in super-exponential growth: factorials eventually outgrow any fixed exponential function, which is why algorithms that try every arrangement scale so poorly.
Example 6: The zero factorial convention
Enter 0 to confirm that 0 factorial is 1. This convention makes the combination formula work for choosing all items or no items: choosing 5 items from 5 gives 5 factorial divided by the product of 5 factorial and 0 factorial, which is 120 divided by 120 times 1, which is 1, as it should be, since there is only one way to choose everything. It also makes the power series for the exponential function start correctly, with the first term being 1 over 0 factorial, which is 1. The tool labels this case as 1 by definition, so learners see that it is a convention, not a computed product.
Tips and Best Practices
First, use the Copy result button for any factorial with more than a few digits, rather than retyping it. A single mistyped digit invalidates a counting argument. Second, when a formula involves a ratio of factorials, cancel before you multiply if you are working by hand: 10 factorial divided by 7 factorial is 10 times 9 times 8, which is 720, and you never need the full values. Third, check the digit count as a sanity check. If you expect a factorial near 20 and the tool shows 7 digits, you probably entered 10 instead of 20.
Fourth, remember that factorial applies to the count of distinct items. If items repeat, the count of distinct arrangements is smaller and needs division by the factorials of the repeat counts. For example, the letters in the word LEVEL have repeats, so the distinct arrangements are not 5 factorial. Fifth, for large counting problems, consider whether you need the exact integer or only its size: the digit count and compact form often answer the practical question, such as whether brute force is feasible, without needing all the digits. Finally, keep the 170 limit in mind when planning a calculation chain, and use logarithms or Stirling’s approximation by hand for factorials beyond that range.
Limitations
The Factorial Calculator accepts only whole numbers from 0 to 170. It does not compute factorials of decimals, negative numbers, or numbers greater than 170, and it does not compute the gamma function, double factorials, or subfactorials. It computes a single factorial at a time: it does not evaluate ratios of factorials, combinations, or permutations directly, although those tools are available separately on this site.
The approximate value in the summary is a standard floating-point approximation and may be rounded for large factorials; the exact integer is the block below the summary. The compact scientific form in the main display shows only the first seven significant digits for long results. The Copy result button copies the exact integer only when the input is valid and within range; for invalid input it does nothing, rather than copying a stale value.
Frequently Asked Questions
What is 0 factorial?
Zero factorial is 1, by definition. The convention makes combination formulas and power series work consistently, and the tool labels it as 1 by definition.
Why is the limit 170?
Because 171 factorial is too large to represent exactly as a standard number. The tool stops at 170 and explains the limit, rather than returning a rounded or overflowed result.
What is 5 factorial?
Five factorial is 5 times 4 times 3 times 2 times 1, which is 120. It is the number of ways to arrange 5 distinct items in a row.
Can I compute the factorial of a decimal?
No. This tool requires a whole number. The gamma function extends the factorial idea to non-integers, but it is not computed here.
How do I copy a long factorial?
Press Copy result. It copies the full exact integer, so you can paste it into a document or spreadsheet without retyping.
How fast do factorials grow?
Very fast. Ten factorial has 7 digits, 20 factorial has 19 digits, 50 factorial has 65 digits, and 100 factorial has 158 digits. Each step multiplies by the new n, so growth accelerates with every increment.
Related Tools
Continue with the Combination Calculator for choosing items where order does not matter, the Permutation Calculator for arrangements where order matters, the Probability Calculator for dice, coin, and basic probability, the Exponent Calculator for powers that often appear alongside factorials, and the Scientific Calculator for combined expressions. You can also return to the FreeToolZones home page to browse the full tool collection.