Permutation & Combination Calculator

Enter n and r to get permutations (nPr), combinations (nCr), permutations and combinations with repetition, and n! all at once — with the working shown step by step.

Number of distinct items (0–1000)

How many you pick or arrange (0–1000)

What to calculate

—

Exact value

—
Digits
—
Scientific notation
—

Step-by-step solution

    About the Permutation & Combination Calculator

    This permutation and combination calculator counts the number of ways to choose or arrange items, the core of combinatorics and probability. All five results appear together; tap one to see the formula, the numbers substituted in and every simplification step.

    It uses exact integer arithmetic (BigInt), so even huge values such as 100! — a 158-digit number — are shown with every digit, alongside scientific notation (9.3326 × 10¹⁵⁷).

    How to use

    1. Enter n, the total number of distinct items, and r, how many you choose or arrange.
    2. Permutations, combinations, both “with repetition” variants and the factorial appear instantly.
    3. Tap a result to see its exact value, digit count, scientific notation and the step-by-step solution.
    4. Use “Copy value” to copy every digit of a large result.

    Permutation and combination formulas

    TypeNotationFormulaExample (n=5, r=2)
    PermutationsP(n, r), nPrn! / (n−r)!5 × 4 = 20
    CombinationsC(n, r), nCr, “n choose r”n! / (r!(n−r)!)20 / 2 = 10
    Permutations with repetitionnʳnʳ5² = 25
    Combinations with repetitionC(n+r−1, r)(n+r−1)! / (r!(n−1)!)C(6, 2) = 15
    Factorialn!n × (n−1) × … × 15! = 120

    Permutation or combination?

    Ask whether order matters. Electing a president and a vice-president from 10 people is a permutation (P(10, 2) = 90) because the roles differ; picking a 2-person committee is a combination (C(10, 2) = 45).

    If an item can be used more than once, you need the “with repetition” version: a 4-digit code using only the digits 1–3 has 3⁴ = 81 possibilities, and buying 2 pieces of fruit from apples, pears and oranges (two of the same allowed) gives C(4, 2) = 6 options.

    Useful values

    • Poker hands (5 cards from 52): C(52, 5) = 2,598,960
    • Powerball white balls: C(69, 5) = 11,238,513
    • 10! = 3,628,800; 20! = 2,432,902,008,176,640,000
    • 0! = 1, C(n, 0) = C(n, n) = 1, C(n, r) = C(n, n − r)

    FAQ

    What happens if r is bigger than n?

    For permutations and combinations without repetition you need r different items, so the answer is 0. With repetition, r can be larger than n.

    Why is 0! equal to 1?

    There is exactly one way to arrange zero items (do nothing), and the rule n! = n × (n − 1)! only works for n = 1 if 0! = 1. That is also why C(n, 0) = C(n, n) = 1.

    How large can the numbers be?

    n and r can each go up to 1000. 1000! has 2,568 digits, and the calculator gives every one of them exactly.

    Why is the number of combinations with repetition C(n + r − 1, r)?

    Line up r stars (the chosen items) and n − 1 bars (dividers between the n types). Every arrangement is one selection, and you only need to choose which r of the n + r − 1 positions are stars.