Probability

Combinatorics Calculator

Enter n and r to get permutations and combinations, with and without repetition, as exact whole numbers even when they have thousands of digits, plus the formula worked through.

Counting ruleFormulaResult
Working
    List the arrangements

    
    

    Runs entirely in your browser. Nothing is uploaded to any server.

    Why use this combinatorics calculator

    Exact answers

    BigInt arithmetic gives every digit, even for 1000!.

    Four rules in one

    With or without order, with or without repetition.

    See the arrangements

    List all combinations or permutations of your own items.

    How to count permutations and combinations

    1. Enter n and rn is how many items you have, r is how many you pick.
    2. Pick the right ruleDoes order matter? Can items repeat? Read that row.
    3. Check with a listFor small cases, list every arrangement to see the count.

    Permutations or combinations?

    Use permutations when order matters, such as podium places or PIN codes, and combinations when it does not, such as a lottery draw or a team of three. nPr = n!/(n − r)! and nCr = n!/(r!(n − r)!), so nCr is nPr divided by the r! ways to order each group.

    With repetition allowed, each of the r positions can be any of the n items, giving nʳ ordered arrangements. Unordered selections with repetition, like choosing 3 scoops from 5 ice-cream flavours, are counted with the stars and bars formula C(n + r − 1, r).

    Lottery

    6 numbers from 49: C(49, 6) = 13,983,816.

    Passwords

    4 digits with repetition: 10⁴ = 10,000.

    Race podium

    Top 3 of 8 runners: 8P3 = 336.

    Combinatorics FAQ

    What is the difference between nPr and nCr?

    nPr counts ordered arrangements and nCr counts unordered groups. nCr = nPr / r!.

    What is 0!?

    0! is defined as 1, so there is exactly one way to choose nothing.

    Why is nCr 0 when r is bigger than n?

    You cannot choose more distinct items than you have, so there are no ways to do it.

    How big can n be?

    Up to 10,000. Results are exact; very long numbers are shortened on screen but the Copy button copies every digit.

    How many items can I list?

    Up to 12 items. The list shows the first 5,000 arrangements and reports the full count.

    Try other math tools

    More free tools from My Panda Toolbox.