Factorial Calculator
Calculate factorials (n!), permutations (nPr), and combinations (nCr) from non-negative integers.
Run tool
The Factorial Calculator computes factorials, permutations, and combinations for discrete math, statistics, and probability problems. In Factorial calculation mode, the tool calculates n! for any whole number from 0 up to 170. Setting n to 0 produces 1, while entering 5 evaluates to 120. When working with arrangements where order matters, switch to the Permutation calculation mode to calculate nPr. For example, selecting 5 items with a sample size of 2 yields 20 distinct ordered outcomes. If order does not matter, Combination calculation mode evaluates nCr, giving 10 possible groupings for the same inputs. Both inputs default to 0 if left blank. In Permutation and Combination calculation modes, the sample size r must not exceed the total item count n, and all inputs must be non-negative integers. Enter your values, pick the desired calculation mode, and click Calculate to view the computed value immediately in the results area.
Instructions
- Select the calculation mode: Factorial, Permutation, or Combination.
- Enter the total number of items (N) as a non-negative integer.
- If calculating permutations or combinations, enter the sample subset size (R).
- Select Calculate to process the mathematical inputs.
- Review the resulting calculated value in the output area.
Examples
- Factorial calculation: set the calculation mode to Factorial and enter N = 5 to calculate 5! = 120.
- Permutation calculation: set the calculation mode to Permutation, enter N = 5 and R = 2 to calculate 5P2 = 20.
- Combination calculation: set the calculation mode to Combination, enter N = 5 and R = 2 to calculate 5C2 = 10.
FAQ
What is the maximum value allowed in factorial mode?
In factorial mode, N can be any non-negative integer up to 170. Values greater than 170 are rejected because they exceed standard numeric calculation limits.
What happens if R is greater than N in permutation or combination mode?
Permutation and combination operations require R to be less than or equal to N. If R is larger than N, the calculation cannot proceed and prompts for valid inputs.
Why does 0! evaluate to 1?
By mathematical convention and definition, 0! equals 1. This represents the single way to arrange an empty set of zero items.
What default settings are used if fields are omitted?
The inputs for N and R default to 0, and the calculation mode defaults to Factorial.