Permutation Calculator

Compute the number of ordered arrangements of r items chosen from n distinct items — written nPr. Perfect for questions about rankings, finishing orders, prize distributions and password possibilities where the order of selection matters.

Enter n and r

r must be between 0 and n.

Enter n and r, then press Calculate nPr.

The permutation formula

nPr = n! / (n − r)!

Equivalently, nPr = n × (n − 1) × (n − 2) × … × (n − r + 1) — the product of the first r integers counting down from n.

Why? Choosing an ordered arrangement of r items from n means: pick any of the n items for the first position, any of the n − 1 remaining for the second, and so on until r positions are filled. Multiplying those choices gives the formula above.

Permutation vs combination

Permutations count order-sensitive selections. Combinations (nCr) count order-insensitive selections — for instance, which three people are on a committee, not who is first, second and third.

nPr = nCr × r!

Worked examples

Example 1 — Podium finishes

10 runners compete. How many ways can gold, silver and bronze be awarded?

10P3 = 10 × 9 × 8 = 720.

720 arrangements

Example 2 — Password possibilities

How many 4-digit codes can be made from digits 0–9 if repetition is not allowed?

10P4 = 10 × 9 × 8 × 7 = 5040.

5040 codes

Example 3 — Permuting all items

How many ways can 5 books be arranged on a shelf?

5P5 = 5! = 120.

120 arrangements

Frequently asked questions

nPr counts arrangements where order matters. nCr counts selections where order does not matter. For the same n and r, nPr = nCr × r! — because every set of r items can be arranged in r! different orders.

0! = 1 by convention — there is exactly one way to arrange nothing. This definition keeps combinatorial formulas like nPr = n! / (n − r)! valid even when r = n.

If r = 0, there is 1 way to choose nothing: nP0 = 1. If r = n, all n items are arranged, so nPn = n!.