Mathematics calculator

Factorial Calculator

Calculate the exact factorial of a nonnegative whole number from 0 through 1,000.

Calculator inputs

Enter your values

n factorial
Calculated output

Result summary

Your result will appear here

Complete the required fields and select the calculate button.

A factorial expanding into the product of descending positive integers
A factorial multiplies every positive integer from the entered number down to one.

What Is a Factorial?

A factorial multiplies all the positive integers from one up to a chosen whole number. The notation 5! means 5 × 4 × 3 × 2 × 1, which equals 120. The exclamation mark is part of the mathematical notation; it does not mean that the input is being squared or multiplied by itself five times.

Use this calculator to check small factorials, count possible orderings or work through a combinations problem. Ordinary factorials are defined here for nonnegative integers. Enter a whole number such as 0, 4 or 8, rather than a negative number or a decimal.

How to Calculate n Factorial

  1. Enter a nonnegative integer n from 0 through 1,000.
  2. Choose Calculate to multiply the integers from 1 through n.
  3. For a small input, write the product out and check it by hand.
  4. Read the exact integer and its digit count. Large factorials can contain thousands of digits, so copy them carefully.

The form is a factorial evaluator, not a complete permutation or combination calculator. If a question gives an expression such as 8!/(3!5!), calculate the required factorials and then perform the remaining division, or use a dedicated combinations tool.

Factorial Formula and the Meaning of 0!

For n ≥ 1: n! = n × (n − 1) × … × 2 × 1

Zero factorial: 0! = 1

Recurrence: n! = n × (n − 1)!, for n ≥ 1

Each factor is a positive integer. The number n controls where the product starts, not how many times n is multiplied by itself. The recurrence gives 1! = 1 × 0!, so defining 0! as 1 keeps the relationship consistent.

The OpenStax permutations chapter introduces factorials for counting ordered arrangements. This calculator uses exact integer multiplication for the accepted range 0 through 1,000. It does not approximate factorials with Stirling’s formula or extend them to decimals through the gamma function.

Integer Input, Exact Product and Digit Count

Nonnegative integer n
Whole-number input from 0 through 1,000 inclusive. Fractional and negative inputs are rejected.
Factorial n!
Exact integer product. The special values 0! and 1! both equal 1.
Entered integer result
Confirms the input used to build the product.
Number of digits
Count of base-10 digits in the exact factorial, including any trailing zeros. For 0!, the result 1 has one digit.

Factorial Calculation and Arrangement Example

Illustrative example. Enter 11. Multiplying 11 × 10 × 9 × … × 2 × 1 gives 39,916,800. The digit count is 8.

You can check the last step as 11 × 10! = 11 × 3,628,800 = 39,916,800. The calculator displays the exact product without needing an approximation.

If eleven distinct labels can be placed in a row with no restrictions, 11! counts their possible orders. If labels repeat or only a few positions are used, the counting formula needs an adjustment.

Calculation check. These illustrative results were checked independently against the formula and calculator response. Keep unrounded intermediate values when repeating the calculation.

Factorial Calculation and Arrangement Example
Input or checkResult
n11
10!3,628,800
11 × 10!39,916,800
Digits in 11!8

Factorials, Permutations and Combinations

Factorials count unrestricted orderings of distinct objects. Selecting only some objects, ignoring order or allowing repeated labels changes the surrounding formula. These examples are separate counting questions; the form itself evaluates n! only.

Factorials, Permutations and Combinations
Counting questionCalculationCount
Order all 5 distinct objects5!120
Choose 2 of 5, order matters5! ÷ 3!20
Choose 2 of 5, order ignored5! ÷ (2! × 3!)10
Order A, A and B3! ÷ 2!3

How to Use Factorials in Counting Problems

Factorials appear in arrangements, permutations, combinations and probability. They count orderings when the objects are distinct. If objects repeat, or only some positions matter, the surrounding formula changes. The factorial remains one building block rather than a universal answer.

How quickly factorials grow

The first values are 0! = 1, 1! = 1, 2! = 2, 3! = 6, 4! = 24 and 5! = 120. By 10!, the result is 3,628,800. Each step multiplies by a larger integer, so growth soon becomes much faster than simply adding a fixed amount.

The implementation uses arbitrary-precision integer multiplication and returns an exact result through 1,000!. The digit count helps show its scale: a mathematically exact answer can still be too long for convenient manual copying.

Common Factorial Mistakes

  • Enter an integer, not a decimal. This page does not evaluate the gamma function, which is a different extension of factorial notation.
  • Do not use a negative input. A loop returning a value for such an input would not establish a valid negative factorial.
  • Keep n! separate from nⁿ. For example, 4! is 24, while 4⁴ is 256.
  • Account for repeated objects in a counting problem. The number of distinct arrangements of A, A and B is 3!/2! = 3, rather than 6.

Frequently Asked Questions

Why is zero factorial equal to one?

The recurrence 1! = 1 × 0! requires 0! to be 1. The same value represents the one way to arrange no objects: leave the arrangement empty. It also makes combination formulas work at their endpoints.

What is the difference between a factorial and a power?

A factorial multiplies decreasing positive integers, while a power multiplies copies of the same base. For instance, 3! = 3 × 2 × 1 = 6, whereas 3³ = 3 × 3 × 3 = 27.

Can I use this for very large exact factorials?

The calculator returns exact factorials through 1,000 using arbitrary-precision integer arithmetic. Simplify factorial ratios before evaluating them when possible, because cancellation makes the work easier to inspect.

Does n! always count selections of n objects?

It counts orderings of n distinct objects when every ordering is allowed. Selecting objects without caring about order requires a combinations formula. Restrictions and repeated objects also change the count.

How many ordered choices are there when I use only some objects?

For r ordered positions filled from n distinct objects without replacement, the count is n!/(n − r)!. Choosing and ordering three objects from five gives 5!/2! = 5 × 4 × 3 = 60. This is smaller than 5! because the unused objects are not being arranged in the final result. If order does not matter, a further division by r! is needed.

What is the largest input this form accepts?

The accepted range is 0 through 1,000. The result for 1,000! has 2,568 digits; that is an exact integer, not a scientific-notation approximation.

Does the digit count include trailing zeros?

Yes. Every base-10 digit of the factorial counts, including zeros at the end. A trailing zero still occupies one place in the integer.

Can I enter a decimal or negative number?

No. This page evaluates ordinary factorials of nonnegative integers. It does not evaluate the gamma-function extension or negative factorials.

Sources and References