Permutations & Combinations Calculator
Calculate permutations and combinations with or without repetition for any n and r values.
About this calculator
This calculator counts permutations and combinations — with or without repetition — for a chosen number of Total Items (n) and Chosen Items (r), switching between four distinct counting formulas based on which Type you pick. It computes the result two ways in parallel: an exact factorial-based calculation for n up to 170, and a logarithmic version (log₁₀ of the result) that stays accurate even once n grows too large for an ordinary factorial to represent without overflowing. Total Items dominates the result far more than either Chosen Items or the Type selector do — but that's partly an illusion of how small whole numbers round.
Type and r are both rounded to the nearest integer, and a ten percent wiggle on small values like r = 3 or Type = 2 (roughly ±0.3 and ±0.2) isn't big enough to cross a rounding boundary, so a small nudge leaves them looking unchanged on a sensitivity check even though changing either one's whole-number value drives a massive swing in the result — picking r = 4 instead of r = 3 raises C(10, r) by 75%, from 120 to 210. Total Items, being large enough (10) that the same proportional wiggle crosses an integer, is the only one of the three that visibly moves under a small nudge, which is why it reads as the dominant lever even though the other two matter just as much once you actually change their value.
Inputs
Results
Result
120
How to Use This Calculator
- Enter n (total items) and r (items chosen).
- Select the Type: Permutation (order matters), Combination (order irrelevant), Permutation with Repetition, or Combination with Repetition.
- Review the Result and the Formula Type applied.
- For very large values, use log10(Result) to work with the magnitude without overflow.
- Switch between all four types to compare the effect of repetition and ordering assumptions on the result.
How the result changes with Total Items (n)
| Total Items (n) | Result |
|---|---|
| 5 | 10 |
| 7.5 | 56 |
| 15 | 455 |
| 25 | 2,300 |
What each input means
- Total Items (n)
- Total number of items to choose from
- Chosen Items (r)
- Number of items to select
- Type (1=P, 2=C, 3=P+Rep, 4=C+Rep)
- 1=Permutation, 2=Combination, 3=Perm w/ repetition, 4=Comb w/ repetition
How this is calculated
Worked example, using the default values
- Identify Input ParametersTotal Items (n) = 10, Chosen Items (r) = 3, Type (1=P, 2=C, 3=P+Rep, 4=C+Rep) = 2 = 3 input(s) provided
- Calculate ResultResult120 = 120
- Calculate Formula TypeCombination C(n,r) = Combination C(n,r)
Engine last updated . Checked against 8 independently-derived tests — how we verify calculators. Built by Paul Gunder, a software engineer, not a licensed financial, medical, or legal professional.
Frequently Asked Questions
Why does dragging r from 3 to 3.3 on a slider not change the result at all?
The calculator rounds r to the nearest whole number before using it in any factorial calculation, since you can't choose a fractional number of items. Nudging 3 up to 3.3 or down to 2.7 both round straight back to 3, so nothing about the computed permutation or combination actually changes until the input crosses the next whole integer.
What's the difference between selecting Type 1 (Permutation) and Type 2 (Combination)?
Permutations count arrangements where order matters, so choosing item A then B is treated as different from B then A, giving the formula n! divided by (n minus r)!. Combinations count selections where order doesn't matter, dividing that same permutation count by r! to collapse every reordering of the same r items down to a single count.
Why does the calculator also show a value called log₁₀(Result)?
Two different ceilings are at work here, and they're not the same one. JavaScript's standard number type can only represent whole numbers exactly up to about nine quadrillion, and a factorial-based result crosses that threshold around 18! to 19! — well before the 170-item mark. The engine's own factorial calculation additionally switches to the logarithmic path once n passes 170, since a true factorial that large would overflow to Infinity rather than merely losing precision. The logarithmic result sidesteps both ceilings by tracking the exponent of the answer instead of the answer itself, so relative magnitudes stay comparable even once n climbs into the hundreds.
What does 'Combination with Repetition' actually count that a plain Combination doesn't?
A plain combination assumes every item in the pool of n can be chosen at most once, so you're always picking r distinct items. Combination with repetition allows the same item to be picked more than once — like scoops of ice cream where repeats are fine — and is computed instead as C(n plus r minus 1, r), a larger count than the no-repetition version for the same n and r.
Related Calculators
The questions that sit next to this one — chosen by subject, including calculators filed under a different category.
Binomial Coefficient Calculator
Calculate nCr and nPr values with Pascal's triangle row visualization.
Discrete MathematicsCatalan Number Calculator
Calculate Catalan numbers and their combinatorial interpretations including binary trees and lattice paths.
Math & StatisticsFactorial Calculator
Calculate factorial (n!) and double factorial (n!!). Useful for permutations, combinations, and mathematical calculations.
Math & StatisticsProbability Calculator
Calculate probability of single events, combined events (AND/OR), permutations, and combinations.
LocksmithingKey System Expansion Calculator
Maximum key combinations from pin count and depths.
More in Math & Statistics.