Possibility Calculator — Combinations & Permutations

How many possibilities are there? Enter n items and choose r to get combinations, permutations and both “with repetition” variants at once — exact, even for huge numbers — plus lottery odds and PIN/password possibilities.

Runs in your browser
Examples:

How many possible codes?

Your data never leaves your computer. All processing happens 100% locally in your browser.

How to use the Possibility & Combination Calculator

  1. Enter the total number of items n (for example 49 lottery numbers) and how many are chosen, r (for example 6).
  2. Read all four results: combinations, permutations, and both versions with repetition. Pick the one that matches your question — does order matter, and can items repeat?
  3. Hover or open “Exact value” to see huge results digit by digit.
  4. Use How many possible codes? for PINs, lock codes and passwords.

Which formula do I need?

No repetitionWith repetition
Order mattersPermutations: n! / (n−r)!nʳ (PINs, passwords)
Order doesn’t matterCombinations: n! / (r!(n−r)!)(n+r−1)! / (r!(n−1)!)

Ask two questions: does the order matter? (a podium does, a lottery ticket doesn’t) and can an item be used more than once? (a PIN can repeat digits, a lottery draw can’t).

Examples

  • Lotto 6 of 49: C(49, 6) = 13,983,816 — the odds of the jackpot are 1 in about 14 million.
  • Poker hands: C(52, 5) = 2,598,960 different 5-card hands.
  • 4-digit PIN: 10⁴ = 10,000 possibilities (order matters, digits repeat).
  • Gold, silver, bronze among 8 runners: P(8, 3) = 336.
  • Ice cream: 3 scoops from 10 flavours (repeats allowed, order irrelevant): C(12, 3) = 220.

Big numbers, exact

Factorials grow incredibly fast — 70! already has 101 digits. The calculator uses arbitrary-precision integers, so results stay exact instead of turning into rounded floating-point numbers. For password security, possibilities translate directly into cracking time — see the Password Strength Checker. For simple ratios and percentage changes use the Percentage Calculator, and for random draws the Random Number Generator.

Tools that pair well with the Possibility & Combination Calculator

  • Number Base Converter — Type a number in any base and see it in all the others instantly.
  • Unit Converter — Convert between metric, imperial and technical units in ten categories — with a two-way converter and a table of every unit at once.
  • Age Calculator — Enter a date of birth to get the exact age in years, months and days — plus total days and weeks lived, the weekday you were born on, a countdown to the next birthday and your star sign.
  • Date Difference Calculator — Count the days between two dates — including business days and a years/months/days breakdown — add or subtract time from a date, or run a live countdown.

Frequently asked questions

What is the difference between combinations and permutations?
Permutations count arrangements where order matters (ABC ≠ CBA). Combinations count selections where order doesn’t matter (ABC = CBA), so there are always fewer combinations than permutations.
What does nCr mean?
“n choose r” — the number of ways to pick r items from n without caring about order: n! / (r! × (n−r)!). It’s also written C(n, r) or as a binomial coefficient.
How many combinations does a 4-digit code have?
10,000 (0000 to 9999), because each of the 4 positions can be any of 10 digits: 10⁴. A 6-digit PIN has 1,000,000.
What are my odds of winning the lottery?
For a draw of 6 numbers from 49, there are 13,983,816 combinations, so one ticket has a 1 in 13,983,816 chance. Games with an extra bonus number multiply this further.

Related tools