CalcUnit Logo

How to Calculate Factorial

Calculate n! for any non-negative integer.

The Formula

n! = n × (n-1) × ... × 1

The factorial formula uses the mathematical relationship: n! = n × (n-1) × ... × 1. Each variable in the formula represents a measurable quantity that affects the final result.

What Each Variable Means

Every value in the factorial formula, what it measures, and the value used in the worked example on this page:

VariableTypeExample value
nInput (you provide)7
n!Result (calculated)—
Permutations P(n,2)Result (calculated)—
Combinations C(n,2)Result (calculated)—

Step-by-Step Method

  1. 1Write down the values you know: n.
  2. 2Substitute your known values into the formula: n! = n × (n-1) × ... × 1.
  3. 3Work through the arithmetic in the standard order of operations — parentheses first, then exponents, then multiplication and division, then addition and subtraction.
  4. 4Check that your result carries the correct unit and falls in a reasonable range for the problem.
  5. 5Verify your answer with the interactive Factorial Calculator — it solves the same formula instantly.

Worked Example

Take a concrete case: n = 4, with the other inputs at the typical values from the variables table above. Substituting into the formula gives n! = 24, permutations p(n,2) = 12, combinations c(n,2) = 6. These numbers are solved by the same engine that powers the Factorial calculator, so you can reproduce them exactly by entering the same inputs there.

nn!Permutations P(n,2)Combinations C(n,2)
2221
424126
51202010
750404221
93628807236
1036288009045
202432902008176640000380190
302.6525285981219107e+32870435

How each result changes as n changes, holding the other inputs constant.

Practice Problems

1. 5! (standard): Given n 5, what does it come out to?

Answer: Entering n 5 gives n! 120, Permutations P(n,2) 20, Combinations C(n,2) 10.

2. You enter n 13 — what does the calculator return?

Answer: The calculator returns n! 6,227,020,800, Permutations P(n,2) 156, Combinations C(n,2) 78 for n 13.

Frequently Asked Questions

What is the formula for factorial?

The formula is: n! = n × (n-1) × ... × 1. Calculate n! for any non-negative integer.

What values do I need to calculate factorial?

You need n. The calculator produces n!, permutations p(n,2), combinations c(n,2) from those inputs.

What is the factorial when n is 4?

With n = 4, the result is n! = 24, permutations p(n,2) = 12, combinations c(n,2) = 6. This is worked through in full in the example on this page.

Related Topics

factorialcombinatorics

Use the Interactive Calculator

Skip the manual math — get instant results with our free Factorial calculator.

Open Calculator

Related Calculators