Permutation Calculator
Compute P(n,r) = n! / (n−r)! or n^r with repetition. Exact integer answer up to n = 5000.
Written by Golam Rabbani, Founder & Lead Engineer
How to use this permutation calculator
- Enter n (total items) and r (items to arrange).
- Tick "Allow repetition" if items can repeat in the arrangement (uses n^r).
- Press Calculate to get the exact integer count P(n,r) using BigInt arithmetic.
- Copy the result or Reset to clear inputs.
About this permutation calculator
A permutation is an arrangement of r items taken from n distinct items where order matters. Without repetition, P(n, r) = n! / (n − r)! = n × (n − 1) × … × (n − r + 1). With repetition allowed, every position has n independent choices, so the count is n^r. The calculator uses JavaScript BigInt under the hood so very large permutations remain exact integers — never approximate or scientific-notation floats.
Worked example. How many ways can you arrange 3 books on a shelf from 10 candidate books? n = 10, r = 3 (no repetition). P(10, 3) = 10! / 7! = 10 × 9 × 8 = 720. So you can produce 720 ordered shelves. If books could be repeated (say, identical copies are stocked), the count becomes 10³ = 1,000. Permutations differ from combinations because order matters — for the same n = 10, r = 3 there are only C(10, 3) = 120 combinations.
FAQ
- What is the difference between permutation and combination?
- Permutation counts ordered arrangements (ABC and BAC are different). Combination counts unordered subsets (ABC = BAC). For the same n and r, permutations ≥ combinations.
- When should I tick "Allow repetition"?
- When the same item can be picked more than once — for example, four-digit PINs that may repeat digits. The formula becomes n^r.
- Why does the calculator limit n to 5000?
- To keep the response instant. For most everyday combinatorics problems, n well under 5000 is plenty.
- Why is the answer shown as a giant integer, not scientific notation?
- Floats lose precision past about 15 digits. BigInt keeps the answer exact regardless of size.
- What if r > n without repetition?
- There are not enough items to arrange — the calculator surfaces an error rather than returning a misleading zero.