Permutations & Combinations (nPr / nCr) Calculator
Enter the total number of items n and how many to pick r to instantly get the permutations P(n, r), combinations C(n, r) and the factorial n!. Common uses include Mark Six / lottery odds, counting poker hands, sizing brute-force search spaces, and discrete-math / probability homework.
Examples: 49 choose 6 (Mark Six / Lotto), 52 choose 5 (poker hands)
r cannot exceed n; both n and r must be whole numbers between 0 and 170.
Combinations C(n, r)
13,983,816
Order does not matter ({a,b,c} = {c,b,a}). Also written nCr or "n choose r".
Permutations P(n, r)
10,068,347,520
Order matters: {a,b,c} ≠ {c,b,a}. Also written nPr.
n! (n factorial)
608,281,864,034,267,560,872,252,163,321,295,376,887,552,831,379,210,240,000,000,000
n × (n−1) × … × 1. 0! = 1 by convention.
Formula
C(n, r) = n! ÷ (r! × (n − r)!) // order does not matter — also written nCr or "n choose r" P(n, r) = n! ÷ (n − r)! // order matters — also written nPr n! = n × (n − 1) × … × 1 // 0! = 1 by convention Probability of one specific combination at random = 1 ÷ C(n, r)
- · Combinations (C) ignore order: {1, 2, 3} and {3, 2, 1} count as the same — use for lottery picks, poker hands, choosing committee members.
- · Permutations (P) respect order: "ABC" and "CAB" count as different — use for passwords, race finishing orders, seat assignments.
- · P(n, r) = C(n, r) × r! — each combination can be reshuffled into r! distinct ordered arrangements.
- · Edge values: C(n, 0) = C(n, n) = 1, P(n, 0) = 1, and 0! = 1 by convention (these are definitional, chosen so the formulas stay clean).
- · Symmetry: C(n, r) = C(n, n − r). To save work, the calculator internally picks the smaller of r and n − r — so C(49, 43) is computed via C(49, 6).
- · Math uses JavaScript BigInt (arbitrary-precision integers), so values like Mark Six (49 choose 6 = 13,983,816) or poker hands (52 choose 5 = 2,598,960) are exact — no floating-point error. Capped at n ≤ 170 because 170! ≈ 7.26 × 10³⁰⁶ is the largest factorial that fits in IEEE 754 double precision.
- · Sources: Rosen, "Discrete Mathematics and Its Applications"; OEIS A000142 (factorials); Mark Six odds from the Hong Kong Jockey Club rules (6 numbers chosen from 1–49).
Frequently asked
What's the difference between permutations and combinations?
In short: permutations care about order, combinations don't. Picking 3 people out of 10 to go to lunch — only the set matters — is C(10, 3) = 120. Picking 3 people for distinct roles (chair / vice-chair / secretary) is a permutation P(10, 3) = 720 because role assignments differ. They're related by P(n, r) = C(n, r) × r!.
Why are the Mark Six / lottery odds 1 in 13,983,816?
Hong Kong Mark Six draws 6 numbers from 1–49 and the order doesn't matter — only the set of 6 needs to match — so there are C(49, 6) = 13,983,816 possible draws. One ticket (one chosen set of six) wins the jackpot with probability 1 ÷ 13,983,816 ≈ 7.15 × 10⁻⁸. Type n = 49, r = 6 to see this directly.
Why is 0! defined to be 1?
0! = 1 is a convention chosen so that identities stay clean. It makes C(n, 0) = n! ÷ (0! × n!) = 1 (there's exactly one way to pick "nothing" — the empty set) and the boundary terms of the binomial expansion (a + b)ⁿ work without special-casing. Setting 0! = 0 would put a zero in the denominator of every combinatorial formula. Combinatorially, 0! counts the empty permutation, which has exactly one instance.
How many 5-card poker hands are possible from a 52-card deck?
Choosing 5 cards out of 52, ignoring order, gives C(52, 5) = 2,598,960 distinct hands — enter n = 52, r = 5 to verify. The odds of being dealt a royal flush (only 4 possible — one per suit): 4 ÷ 2,598,960 ≈ 1 in 649,740.
Related tools
Percentage Calculator
Percent of, percent change, and percent add/subtract in one.
GCD & LCM Calculator
Enter 2–6 positive integers to get the greatest common divisor (HCF / GCD) and least common multiple (LCM), with the Euclidean step chain shown.
Average Calculator (Mean / Median / Mode)
Enter a list of numbers to get the mean, median, mode, range plus standard deviation, variance and total.
Quadratic Equation Solver
Enter the coefficients of ax² + bx + c = 0 to find the real or complex roots, discriminant and vertex.
Password Strength (Entropy) Calculator
Estimate a password's bit entropy, brute-force time and strength tier. All computation happens in your browser.
Scientific Notation Converter
Convert between standard decimal numbers and scientific notation, with significant figures and order of magnitude.
Standard Deviation Calculator
Paste a list of numbers to compute mean, median, sample and population variance and standard deviation — with the working shown.
Triangle Calculator (SSS / SAS / ASA)
Solve a triangle from 3 sides, 2 sides + 1 angle, or 2 angles + 1 side — area, perimeter and remaining parts via the law of sines / cosines.
Pythagorean Theorem Calculator
Given any two sides of a right triangle (two legs, or one leg plus the hypotenuse), instantly find the third side, area, perimeter and the two non-right angles.
Circle Calculator (radius / diameter / circumference / area)
Enter any one of radius, diameter, circumference or area to get the other three — useful for design, engineering and DIY.
Roman Numeral Converter
Two-way conversion between Arabic numbers (1–3999) and Roman numerals (I, V, X, L, C, D, M) — handy for typesetting, chapter titles and homework.
Slope & Line Equation Calculator (y = mx + b from Two Points)
Enter two points (x₁, y₁) and (x₂, y₂) to instantly get the slope, y-intercept, line equation y = mx + b, distance, and midpoint — a classroom staple for algebra and coordinate geometry.
Birthday Paradox Calculator
Enter group size n to see the probability that at least two people share a birthday — the classic birthday problem.
Logarithm Calculator (log / ln / log₂ / any base)
Compute logₐ(x) for any base — natural log (ln), common log (log₁₀), binary log (log₂) and a custom base, with the change-of-base steps shown.
Z-Score (Standard Score) Calculator
Enter a value, the mean and the standard deviation to compute the z-score and the corresponding normal-distribution percentile and probabilities.
Screen Pixel Density (PPI) Calculator
Enter the screen resolution and diagonal size to get pixel density (PPI), real width/height, dot pitch and total pixel count.
Hong Kong Mark Six Odds Calculator
Enter the number of tickets / selections and see the actual probability of hitting first, second … prizes in a Mark Six (6-of-49) draw.
Decimal to Fraction Converter
Convert any decimal (including repeating decimals) to a simplified fraction and a mixed number.
Sphere Volume & Surface Area Calculator
Give a sphere any one of radius, diameter, surface area or volume and instantly get the other three — plus the great-circle circumference and area.
Cylinder Volume & Surface Area Calculator
Enter the radius and height of a cylinder to get volume (π r²h), lateral surface, base area and total surface area.
Prime Factorization Calculator
Factor any integer from 2 up to 10¹² into primes, see the canonical exponent form, count and list all divisors.
Geometric Mean Calculator
Compute the n-th root of the product of n positive numbers — the right average for growth rates, returns and ratios — alongside the arithmetic mean for comparison.
Fibonacci Sequence Calculator
Enter any integer n from 0 to 1500 to instantly compute F(n) and F(n−1) with BigInt precision, the consecutive-term ratio (converging to the golden ratio φ) and the first 30 terms of the sequence.