All Over Tools logo
Tool Combiner
Analyze Tools Clean Tools Compare Tools Convert Tools Data Validation Extract Tools Format Tools Generate Tools Organize Tools Transform Tools
Audio Tools Font Tools Image Tools Subtitle Tools Video Tools
Archive Tools Document Tools Ebook Tools File Management Tools PDF Tools Presentation Tools
Config Tools Database Tools Dataset Tools JSON Tools Parser Tools Spreadsheet Tools XML Tools
Business Calculators Construction Calculators Date And Time Calculators Education Calculators Financial Calculators Food Calculators Health Calculators Math Calculators Science Calculators Sports Calculators Statistics Calculators
Blog About Us Contact Us

Factorial Calculator

Find the factorial (n!) or subfactorial (!n) of a nonnegative integer from 0 through 10,000. Enter n, choose a mode, and see the formula, calculation steps, and exact result.

A whole number from 0 through 10,000.

n is treated as a plain count - the calculator does not attach a unit. The result is a pure whole number (a count of orderings or arrangements), not a currency, weight, or other measured unit.

How to use the factorial calculator

Enter a whole number, choose a calculation mode, and select Calculate. The Result panel shows the selected mode, the exact integer, its digit count, and the formula steps. Factorial (n!) multiplies the whole numbers from 1 through n; Subfactorial (!n) counts arrangements in which no item stays in its original position.

  1. Enter a whole number from 0 through 10,000 in Number (n).
  2. Choose Factorial (n!) or Subfactorial (!n).
  3. Select Calculate.
  4. Read the value of n, mode, result, digit count, and calculation steps in Result.
  5. Select Copy result or Download result (.txt) to keep the generated plain-text calculation.

What Factorial (n!) and Subfactorial (!n) calculate

Factorial multiplies each whole number from 1 through n. Enter 5 in Number (n) with Factorial (n!) selected and the result is:

n = 5
Mode: Factorial (n!)
Result: 5! = 120

The calculator defines 0! = 1. Subfactorial uses !n = (n - 1) x (!(n - 1) + !(n - 2)), starting with !0 = 1 and !1 = 0. For n = 5, Subfactorial (!n) returns !5 = 44.

For n through 15, Formula & steps shows the expanded values. For larger n, it shows the formula, a calculation summary, and the final exact integer.

What inputs does the factorial calculator accept?

Enter digits only in Number (n). Empty input, negative signs, decimals, and values above 10,000 produce an error. The calculator does not evaluate Gamma-function values or other non-integer extensions.

The calculation uses JavaScript BigInt arithmetic, so the integer result stays exact. The result text for Copy result and Download result (.txt) is assembled in the browser from the values on the page.

Where factorial and derangement numbers come up

  • To count arrangements of 7 distinct books, enter 7, choose Factorial (n!), and read the exact result, 5040.
  • For 5 items with no item in its original position, choose Subfactorial (!n) and get !5 = 44.
  • For a worksheet, enter a value, review the displayed steps, and select Download result (.txt) to save the formula and result as plain text.

When another math calculator fits better

Use this page for one factorial or derangement calculation. For unordered selections of r items from n, use the Combination Calculator. For ordered arrangements of r items from n, use the Permutation Calculator. For GCF, LCM, prime factorization, or modular arithmetic, use the Number Theory Calculator or browse Math Calculators.

Frequently asked questions

How do I calculate n factorial?

Enter n in Number (n), select Factorial (n!), and select Calculate. The Result panel shows n!, its digit count, and the calculation steps.

What does a subfactorial calculator find?

It finds !n, the number of derangements of n items. Select Subfactorial (!n) to apply the recurrence from !0 = 1 and !1 = 0.

Can I calculate 0! and !0?

Yes. Both return 1. Enter 0 in Number (n), choose the required mode, and select Calculate.

Can this derangement number calculator use decimals?

Number (n) accepts whole numbers from 0 through 10,000. Decimals, negative values, empty input, and values above 10,000 show an error.

What does Formula & steps show for large factorials?

For n through 15, it shows expanded intermediate values. For larger n, it shows the formula, a calculation summary, and the final exact result.

Related Tools

53 views