Factorial Calculator
Tell us more, and we'll get back to you.
Contact UsTell us more, and we'll get back to you.
Contact UsThe factorial of a non-negative integer n, denoted as n!, is the product of all positive integers less than or equal to n. For example, 5! = 5 × 4 × 3 × 2 × 1 = 120. By convention, 0! is defined as 1. Factorials grow extremely quickly — 20! already exceeds 2.4 quintillion — and are foundational to counting, probability, and combinatorics.
A permutation counts the number of ways to arrange r items chosen from n distinct items where order matters.
A combination counts the number of ways to choose r items from n distinct items where order does not matter.
A factorial, written as n!, is the product of all positive integers from 1 to n. For example, 5! = 5 × 4 × 3 × 2 × 1 = 120. By convention, 0! equals 1.
A permutation counts arrangements where order matters (e.g., ranking winners 1st, 2nd, 3rd), while a combination counts selections where order does not matter (e.g., choosing 3 people for a committee). Permutations always produce a number greater than or equal to combinations for the same n and r.
0! = 1 by definition because there is exactly one way to arrange zero items — doing nothing. This convention also ensures that formulas like C(n, 0) = n! / (0! × n!) = 1 work correctly.
This calculator supports values of n up to 170. Beyond that, the numbers become astronomically large. Internally the calculator uses BigInt arithmetic to handle values of n greater than 20, which exceed the safe integer limit for standard JavaScript numbers.
Use permutations when the order of selection matters, such as assigning ranked positions, creating passwords, or arranging items in a sequence. Use combinations when order does not matter, such as choosing lottery numbers, forming committees, or selecting items from a menu.
The combination formula is C(n, r) = n! / (r! × (n − r)!). It calculates how many ways you can choose r items from n items without regard to order. A useful property is that C(n, r) = C(n, n − r).
Embed on Your Website
Add this calculator to your website