Factorial Calculator
Calculate the factorial of a non-negative integer. Get a clear result with the inputs shown on the page.
How It Works
Calculate the factorial of a non-negative integer. Get a clear result with the inputs shown on the page. Use Factorial Calculator to apply the displayed mathematical method to your values and see the result immediately.
The result is most useful when the inputs match the definitions used by this calculator. For this tool, the underlying method is: n! = n × (n−1) × ... × 1. Compare the output with the worked example, then change one meaningful input at a time to see how the result responds.
Understanding Factorial
Factorial describes a mathematical relationship between the values entered in the calculator. Understanding the reference values and formula helps you interpret the result correctly. Check units, signs, reference values, and rounding conventions when using the result for an important calculation. Review the factorial inputs and units before relying on the result.
Factorials count ordered arrangements
For n distinct objects, n! gives the number of ways to arrange all of them in order. For example, 4! = 24 possible orderings. Factorials are also building blocks for permutations and combinations, where repeated orderings are divided out when order does not matter.
Use whole-number inputs within the supported range
This calculator accepts non-negative integers and limits the input to 170. Factorial is not defined by this tool for negative or fractional input. Values grow very quickly, so the output can become enormous long before the input reaches the maximum accepted value.
Be careful when an exact large integer matters
Ordinary JavaScript number arithmetic has finite precision. Although the implementation limits the input to avoid numeric overflow, some very large factorials cannot be represented as exact integers by a floating-point number. For exact combinatorics or other exact-integer work, verify large outputs with arbitrary-precision integer software.
When to Use This Calculator
Use Factorial Calculator to apply the displayed mathematical method to your values and see the result immediately.
Practical tip: For this Factorial Calculator, identify the reference values and units first, then change one meaningful input at a time so the effect on the result is clear.
Formula
n! = n × (n−1) × ... × 1
Example
The factorial of 5 is 5! = 5 × 4 × 3 × 2 × 1 = 120. By definition, 0! = 1; that convention makes many counting formulas work at their boundary cases.
Frequently Asked Questions
Practical Article for This Calculator
Learn how factorials count orderings, why zero factorial equals one, and when factorial values grow too quickly for ordinary notation.
When Factorials Help Count Possible Arrangements