# Permutations & Combinations Calculator — nPr, nCr with Steps

> Compute permutations (nPr) and combinations (nCr), plus the with-repetition variants, with factorial expansions and a Pascal’s-triangle view. Free nPr/nCr calculator.

- **Category:** Math
- **Interactive calculator:** https://youcalc.com/en/math/permutations-combinations/
- **Price:** Free, no sign-up required

## Overview

This calculator finds all four classical counting values at once: ordered selections without repetition (nPr), unordered selections without repetition (nCr), ordered selections with repetition (nʳ), and unordered selections with repetition. Enter the pool size n and the sample size r, and see every count instantly.

## How to read your result

The headline figure is nCr — the number of ways to choose r items from n when order does not matter. Below it you also get nPr (order matters, no repeats), nʳ (order matters, repeats allowed), and the with-repetition combination count. The step-by-step breakdown shows the factorial expansion for nPr and nCr, and the Pascal's-triangle panel highlights exactly where your nCr value sits.

## Method

Permutations without repetition use nPr = n! / (n − r)!, computed multiplicatively as the product n × (n−1) × … × (n−r+1) to avoid overflow. Combinations without repetition use nCr = n! / (r!(n−r)!), computed with the symmetric multiplicative formula ∏(n−k+i)/i for i = 1..k where k = min(r, n−r). Ordered with repetition is simply nʳ. Unordered with repetition applies the multiset formula C(n+r−1, r), also computed multiplicatively.

## Example

- **Setup:** Choose 3 items from a pool of 5 (for example, selecting 3 toppings from a menu of 5).
- **Result:** nPr = 60 ordered arrangements; nCr = 10 unordered selections; with repetition: 125 ordered and 35 unordered.

## Frequently asked questions

### What is the difference between a permutation and a combination?

A permutation counts arrangements where the order matters — ABC and BAC are two different outcomes. A combination counts selections where the order does not matter — ABC and BAC are the same outcome. In practice, use permutations for rankings, orderings, or sequences, and combinations for committees, teams, or subsets.

### When should I use the "with repetition" variants?

Use with-repetition counts when items can be chosen more than once — for example, picking digits for a password or selecting flavours when the same flavour can appear multiple times. The formula nʳ covers ordered choices with repeats; C(n+r−1, r) covers unordered choices with repeats.

### Why does the calculator cap n at 170?

170 is the largest integer whose factorial fits in a 64-bit floating-point number (170! ≈ 7.3 × 10³⁰⁶). Beyond that, JavaScript's Number type overflows to Infinity. The calculator uses the multiplicative formula rather than computing full factorials, so results are accurate up to the JavaScript safe-integer limit.

## Related calculators

- [Standard Deviation Calculator](https://youcalc.com/en/math/statistics-standard-deviation/)
- [Z-Score & Normal Distribution Calculator](https://youcalc.com/en/math/z-score-normal-distribution/)
- [Percentage Calculator](https://youcalc.com/en/math/percentage/)

## Sources

- https://mathworld.wolfram.com/Permutation.html
- https://mathworld.wolfram.com/Combination.html

---

Interactive version: https://youcalc.com/en/math/permutations-combinations/ · From YouCalc — https://youcalc.com
