Permutation Calculator
Count ordered selections from n available items when order matters, with or without repetition.
Enter the selection
Count ordered selections from n available items when order matters, with or without repetition.
Your data stays in this browser.
Permutation result
Enter n and r, choose the repetition rule, then calculate.
Exact number of ordered selections
The exact result is longer than the on-screen limit, so the middle is hidden. Copy result still copies every digit.
- Formula used
- Result length
- digits
What does this calculate?
Pick r items from n available items and place them into ordered positions.
A–C–B and B–C–A count as two different outcomes because the positions changed.
How to use the permutation calculator
Use this page when changing the order of the selected items creates a different outcome. It calculates a count, not a list of arrangements.
- Enter n, the number of distinct items available.
- Enter r, the number of ordered positions you will fill.
- Choose whether the same item may be used more than once. No repetition is the default.
- Select Calculate. Review the exact count, formula, and digit length; use Copy result if you need the complete integer.
- Choose Clear to remove inputs, errors, the result, and copy feedback while keeping your language setting.
When order matters
A permutation treats different orders as different outcomes. Awarding gold, silver, and bronze medals from a group is an ordered selection because the same three people in different places produce a different podium. Choosing a committee is not this task because rearranging committee members does not create a new group.
The calculator deliberately stays within this boundary. It does not calculate combinations, probability, circular seating, arrangements of repeated identical objects, or generate every possible ordering.
Permutation without repetition: nPr
When an item cannot be reused, the first position has n choices, the second has n − 1, and the choices continue to decrease. Multiplying r descending factors gives P(n,r) = n! ÷ (n − r)!. The calculator multiplies those factors directly with BigInt so the integer remains exact.
Without repetition, r must be no greater than n. Selecting zero positions has one outcome—the empty arrangement—so P(n,0) = 1, including P(0,0) = 1. Selecting all n items gives n!.
Permutation with repetition: n^r
When reuse is allowed, every one of the r ordered positions has all n choices available. The count is n^r. A PIN made from ten digits is a familiar example: four positions with repetition allowed give 10^4 possibilities.
For r = 0, the empty arrangement is counted once, so n^0 = 1, including the calculator convention 0^0 = 1 for this counting case. If n = 0 and r is positive, the result is 0 because no position can be filled.
Exact integers and the display limit
Both inputs are limited to whole numbers from 0 through 1,000. Counts can still contain thousands of digits. The calculation and copied value stay exact; no scientific notation or decimal rounding is used.
When an answer is very long, the result card shows the beginning and end, an ellipsis, and the exact digit count. This is only a screen-length limit. Copy result copies the entire integer. Editing either input or the repetition rule immediately clears the old answer so it cannot be mistaken for a new calculation.
Practical uses and common mistakes
- Use no repetition for podium places, assigning distinct jobs, or choosing and ordering cards without replacement.
- Use repetition for PINs, fixed-length codes, or sequences of independent choices when the same option can appear again.
- Check order first: if ABC and CBA should count separately, use a permutation.
- Check reuse separately: “with replacement” or “may repeat” points to n^r.
- Do not enter percentages, decimals, negative values, infinity, or a formula in an input field.
Worked examples
Nine distinct cards, choose and order three without repetition: P(9,3) = 9 × 8 × 7 = 504.
A four-digit PIN using digits 0–9 with repetition allowed: 10^4 = 10,000.
Five finalists assigned to zero positions: P(5,0) = 1, the single empty arrangement.
Frequently asked questions
What is the difference between n and r?
n is the size of the available pool. r is the number of ordered positions filled from that pool.
Why is r greater than n rejected without repetition?
You cannot fill more positions than there are distinct available items if each item may be used only once.
Does this show every arrangement?
No. It returns only the exact number of arrangements. Listing them would be a different, much larger task.
Why does choosing zero items return 1?
There is exactly one way to choose and order nothing: the empty arrangement. This convention also keeps counting formulas consistent.
Is the shortened long result rounded?
No. Only its middle is hidden on screen. The digit count and the value copied by Copy result use the full exact integer.