Count the ways to arrange or choose r items from n, with or without repetition. Answers are exact, even when they run to thousands of digits.
The four formulas
| No repetition | Repetition allowed |
| Order matters (permutations) | P(n, r) = n! ÷ (n − r)! | nʳ |
| Order doesn't matter (combinations) | C(n, r) = n! ÷ (r! (n − r)!) | C(n + r − 1, r) |
n! = n × (n − 1) × … × 2 × 1, and 0! = 1
Worked examples
- Gold, silver and bronze among 10 runners (order matters, no repeats): P(10, 3) = 10 × 9 × 8 = 720.
- A 3-person committee from 10 people (order doesn't matter): C(10, 3) = 720 ÷ 3! = 120. Each group of 3 can be ordered 6 ways, so there are 6 times fewer combinations than permutations.
- A 3-digit lock using digits 0–9 (order matters, repeats allowed): 10³ = 1,000.
- 3 scoops from 10 ice cream flavors, repeats allowed, order doesn't matter: C(12, 3) = 220.
- A 5-card poker hand from 52 cards: C(52, 5) = 2,598,960.
Exact answers for big numbers
Factorials grow fast: 70! already has over 100 digits, which is beyond most calculators. This one uses exact whole-number arithmetic (JavaScript BigInt), so C(1000, 500), a 300-digit number, comes out exactly. Open "All digits" to see every digit.
Limits
- n and r go up to 1,000.
- Without repetition, r can't be bigger than n.
- These formulas assume every item is distinct. To arrange letters with repeats, like the 11 letters of MISSISSIPPI, divide by the factorial of each repeat count: 11! ÷ (4! 4! 2!) = 34,650.
Sources
How we checked this
Before every update, this calculator is run in a real browser with these known answers, and it must match all of them:
- P(30, 20) rounds to 7.309657733 × 10²⁵ ✓
- C(5, 0) reads 'There is 1 way' ✓
- Poker hands C(52, 5) = 2,598,960 ✓
- P(10, 3) = 10 × 9 × 8 = 720 ✓
- C(1000, 500) ≈ 2.702882409 × 10^299, exactly ✓
- 10 flavors, 3 scoops with repeats: C(12, 3) = 220 ✓
- r larger than n without repetition is rejected ✓
Last checked October 26, 2026. Spotted something wrong? The math is done in your browser with the formula shown on this page, so you can check any result by hand.
Questions people ask
What's the difference between a permutation and a combination?
In a permutation the order matters (1st, 2nd, 3rd place). In a combination it doesn't (a team or a hand of cards). For the same n and r there are r! times more permutations.
How do I calculate nCr?
Multiply n × (n − 1) × … for r terms, then divide by r!. C(10, 3) = (10 × 9 × 8) ÷ (3 × 2 × 1) = 120.
What is 0! and why is C(n, 0) = 1?
0! is defined as 1, because there's exactly one way to arrange nothing. So there's one way to choose no items: C(n, 0) = 1.
How many lottery combinations are there?
For a game where you pick 6 numbers from 49 and order doesn't matter, C(49, 6) = 13,983,816.
When is repetition allowed?
When an item can be picked again, like digits in a PIN or scoops of the same flavor. A PIN of 4 digits has 10⁴ = 10,000 possibilities.