Permutation & Combination Calculator
Compute nCr, nPr and n! with exact big-integer arithmetic. Large results such as lottery odds never overflow, and every calculation shows its working step by step.
Try an example
Enter n and r to see the result with the working.
Done
Permutation & Combination Calculator
How to use
- 1
Pick a calculation type
Choose combination (nCr), permutation (nPr) or factorial (n!).
- 2
Enter n and r
Type the total count n and how many you choose, r. The example buttons work too.
- 3
Read the result and working
The exact value and each step are shown, ready to copy into notes or reports.
Features
- Combinations (nCr), permutations (nPr) and factorials (n!) on one page
- Exact BigInt arithmetic with no error up to about 150 digits
- Every step shown, from formula substitution to the final value
- Clear errors for n < r and out-of-range input; inputs are never transmitted
Use cases
Check counting problems
Compare hand-worked permutation and combination answers with the exact value.
Lottery and card odds
Confirm the true number of combinations in lotteries and poker hands.
Verify program output
Compare the counts your algorithm produces against exact big-integer results.
Details
A combination nCr counts the ways to choose r items from n when order does not matter; a permutation nPr counts the ways to choose and arrange them when order does. Because order matters, nPr is larger than nCr for the same n and r (whenever r ≥ 2). The formulas are nPr = n!/(n−r)! and nCr = n!/(r!(n−r)!), and the tool shows every substitution step from formula to result.
Calculations use JavaScript BigInt (arbitrary-precision integers), so values such as 43C6 = 6,096,454 for Lotto 6 or 52C5 = 2,598,960 five-card poker hands come out exactly, with no floating-point error. Even 500C250 — a number with about 150 digits that overflows ordinary calculators — computes without truncation.
The condition is n ≥ r ≥ 0. If n < r no selection exists, so the input is rejected as an error. The tool also follows the standard conventions 0! = 1 and nC0 = nCn = 1. Inputs are never transmitted; all computation happens locally in your browser.
FAQ
What is the difference between nPr and nCr?
Permutations count arrangements where order matters; combinations count selections where it does not. For the same n and r, nPr = nCr × r!, so permutations are larger whenever r ≥ 2.
What are 0! and nC0?
By convention 0! = 1 and nC0 = nCn = 1 — there is exactly one way to choose nothing. The tool follows these conventions.
How large can the numbers get?
n and r can go up to 500. 500C250 has about 150 digits, but BigInt arbitrary-precision arithmetic handles it with no overflow or rounding error.
Can I copy the result?
Yes. The copy button places a line like "C(43, 6) = 6,096,454" on the clipboard, ready to paste into notes or reports.
Related Tools
Prime Factorization
Factor any positive integer into primes. See the product form, exponent form (e.g. 2³×3²) and the number of divisors at once.
Fraction Calculator
Add, subtract, multiply and divide fractions with exact results. See the reduced answer plus mixed-number and decimal forms, with the working shown.
Statistics Calculator
Paste numbers to get count, sum, mean, median, min, max and standard deviation at once. Handles newline, comma and space separators.
Quadratic Equation
Solve ax² + bx + c = 0 with real or complex roots, the discriminant and substitution into the quadratic formula.
All processing happens in your browser. Your files are never uploaded.
Verified: Known values (43C6, 52C5, 10!, 0!), the n < r error, factorial mode and the English page are covered by browser tests
Did you know?
The number of five-card poker hands is 52C5 = 2,598,960 — the starting point for many classic probability questions.