Factorial Calculator — n!, Permutations P(n,r) & Combinations C(n,r)

Calculate factorial n! for any integer 0–170. Also computes permutations P(n,r) and combinations C(n,r) with step-by-step expansion.

Quick:
n! (Factorial)
Number of Digits
P(n, r)
C(n, r)

Calculation Details

Formulas

Factorialn! = n × (n-1) × ... × 2 × 1
PermutationP(n,r) = n! / (n-r)!
CombinationC(n,r) = n! / (r! × (n-r)!)
Special0! = 1, P(n,n) = n!, C(n,0) = 1

Frequently Asked Questions

What is a factorial?
The factorial of a non-negative integer n, written n!, is the product of all positive integers up to n. For example, 5! = 5 × 4 × 3 × 2 × 1 = 120. By definition, 0! = 1.
What is the largest factorial this calculator can handle?
170! is the largest factorial that fits in a standard JavaScript double-precision float (~1.8 × 10^308). 171! overflows to infinity. For exact arbitrary-precision results, specialized math libraries are needed.
What is a permutation P(n, r)?
P(n, r) = n! / (n-r)! — the number of ways to arrange r items from a set of n distinct items where order matters. For example, P(5, 2) = 5!/3! = 20 (the number of 2-letter arrangements from 5 letters).
What is a combination C(n, r)?
C(n, r) = n! / (r! × (n-r)!) — the number of ways to choose r items from n distinct items where order does not matter. For example, C(5, 2) = 10 (the number of 2-element subsets from 5 elements).
What is the difference between permutation and combination?
Permutations count arrangements where order matters (ABC ≠ BAC). Combinations count selections where order does not matter (ABC = BAC). Always P(n,r) ≥ C(n,r) because each combination corresponds to r! different permutations.