Skip to main content
Math

Permutations (nPr) Calculator

Enter the total set size n and the number of positions r to instantly get nPr (the count of ordered arrangements of r items chosen from n), the factorial n!, and the related combination nCr for comparison. Widely used in probability problems, ranking scenarios (race podiums, poker deals, code locks, seating charts) and statistics chapters in GCSE / A-Level / AP / HKDSE.

Examples: 1st / 2nd / 3rd place from 10 runners; 5-card deal from a 52-card deck; podium positions among 6 teams.

Permutations P(n, r) = nPr

720

Order matters: ranking 1st, 2nd, 3rd produces distinct outcomes.

Combinations C(n, r) = nCr

120

Order does not matter — just which r items are selected.

n! (n factorial)

3,628,800

n × (n−1) × … × 1, with 0! = 1 by convention.

Formula

P(n, r) = nPr = n! ÷ (n − r)! n! = n × (n − 1) × (n − 2) × … × 1, with 0! = 1 Relation to combinations: nPr = nCr × r!

Frequently asked

Permutations (nPr) vs combinations (nCr) — which one do I need?

Ask yourself: "does order matter?" If ABC and CBA count as two different outcomes (e.g. who finishes 1st, 2nd, 3rd in a race; the order of digits in a PIN; the order cards are dealt), use permutations nPr. If ABC = CBA (e.g. picking three committee members, choosing six Mark Six / Lotto numbers), use combinations nCr. The two are linked by nPr = nCr × r! — a permutation is a combination times the r! ways to order the chosen items.

Why does 0! equal 1?

0! = 1 is a convention with two motivations. First, the recurrence n! = n × (n−1)! has to hold for all n ≥ 1, so setting n = 1 gives 1! = 1 × 0!, forcing 0! = 1. Second, combinatorially: there is exactly one way to arrange an empty set — "do nothing" — so 0! = 1 and 0P0 = 1 are both 1 rather than 0. The convention also keeps the formulas for nPr and nCr clean at the boundary cases (r = 0 and r = n).

How large can these get, and why is 170 the cap?

Counts explode fast. 20! already passes 2.4 × 10¹⁸ (the 64-bit integer limit) and 170! is roughly 7.3 × 10³⁰⁶ — close to the largest finite IEEE-754 double (~1.8 × 10³⁰⁸). 171! overflows to Infinity in double precision, so 170 is the standard practical cap (used by Khan Academy, CFA materials, and most calculators). This tool internally uses JavaScript BigInt, so the integer answer is exact, but we honour the conventional 170 ceiling at the input.

Concrete example: how many ways can 10 students finish 1st, 2nd, 3rd?

With 10 students and a podium of three places where order matters, use the permutation: 10P3 = 10 × 9 × 8 = 720. There are 10 choices for 1st, then 9 left for 2nd, then 8 left for 3rd — multiplying gives 720. If you only asked "which three students made the podium" (no ranking), the answer would be the combination 10C3 = 120 — exactly 720 ÷ 3! because each set of three medallists can be ordered in 3! = 6 ways.

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.

Permutations & Combinations (nPr / nCr) Calculator

Compute permutations P(n,r), combinations C(n,r) and factorial n! — useful for probability problems, lottery odds and combinatorics homework.

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.

Dice Roll Probability Calculator

Pick the number of dice, sides (d4 / d6 / d8 / d10 / d12 / d20) and a target sum to compute the probability of rolling exactly that total, at least, or at most.

Arithmetic Series Calculator

Enter first term a, common difference d and number of terms n to compute the nth term aₙ and the partial sum Sₙ = n/2·(2a + (n − 1)d).