Combinations without repetition
Choosing 3 items from 10 distinct ones, with no repeats and order ignored, gives 120 combinations. Enter the pool size and the group size to get the exact count, even for very large pools, for committees, card hands or samples. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- N
- 10
- K
- 3
- Quantity
- 120
Combinations without repetition answer a basic counting question in statistics and discrete mathematics: given n distinct items, how many different groups of size k can you form when no item may appear twice and the order of selection does not matter? That quantity is the binomial coefficient C(n,k), also written n choose k. There is no sampling, no network, and no date-dependent rounding: every valid pair (n, k) yields the same integer every time.
What combinations without repetition count
Combinations without repetition count the number of ways to choose a subset of k items from a pool of n distinct items when each item may appear at most once and the order of selection does not matter. In classroom language this is n choose k; in statistics notation it is the binomial coefficient C(n,k). The classic identity is C(n,k) equals n factorial divided by k factorial times (n minus k) factorial.
That formula is the same quantity that appears as a coefficient in the binomial expansion of (x plus y) to the n, and as the number of k-subsets of an n-element set. Because order is ignored, choosing Alice then Bob is the same combination as choosing Bob then Alice, so the count is strictly smaller than the corresponding permutation P(n,k) whenever k is at least two.
Because repetition is forbidden, you cannot pick the same person twice, which is the difference versus combinations with repetition, also called multiset combinations, whose count is C(n plus k minus one, k). Boundary cases are part of the definition: C(n,0) and C(n,n) are both one, C(n,1) equals n, and C(0,0) is one by the empty-product convention. If k is larger than n there is no k-subset of an n-set, so this calculator rejects the pair instead of returning zero or a generalized binomial value.
The implementation never samples, never depends on the clock, and never rounds: it evaluates the reduced product from (n minus k plus one) through n, divided step by step by one through k, with exact BigInt arithmetic so large coefficients stay exact integers rather than overflowing a floating-point mantissa.
Classroom, sampling, and contest uses
Statistics teachers use combinations without repetition when they introduce sampling without replacement: the number of distinct k-person committees from a class of n, the number of hands of k cards from a fifty-two-card deck, or the number of ways to pick k defective units in a lot of n for a hypergeometric setup. Those problems all share the same integer C(n,k); this page is written for people who search that phrase explicitly, including learners who have just been told not to confuse it with combinations that allow repeats.
Exam generators can pin the success path with n equals ten and k equals three, which yields one hundred twenty, and the rejection path with any k that exceeds n, which must fail rather than return zero. Contest programmers and interview sandboxes need an exact oracle for combination-counting problems without reimplementing multiprecision arithmetic in every language harness. Sibling landings may target permutations, combinations with repetition, or a generic nCr calculator; this landing is specifically the without-repetition wording.
Pair the count with your own listing code if you need the actual subsets; this capability returns the integer count only.
What you can do with it
Committees and sampling without replacement
Count how many distinct k-person committees or k-item samples you can draw from n distinct people or units when order does not matter and no one is picked twice.
Homework and exam checks for C(n,k)
Let students submit n and k and verify their hand-computed combinations-without-repetition answer against a deterministic count, including the hard reject when k exceeds n.
Contest and hypergeometric setup
Pull exact C(n,k) values when building hypergeometric tables or judging combination-counting problems so the integer layer stays exact before any probability step.
FAQ
What are combinations without repetition?
They count the ways to choose k items from n distinct items when order does not matter and no item may be chosen twice. The number is C(n,k) = n! / (k! × (n−k)!).
What happens if k is greater than n?
You cannot choose more items than the pool contains when repetition is forbidden, so k must satisfy 0 ≤ k ≤ n.
How is this different from combinations with repetition?
Without repetition each item appears at most once (subsets). With repetition an item may be chosen more than once (multisets), and the count is C(n+k−1, k) instead of C(n,k).
Why is the combination count a string?
Large C(n,k) values exceed JavaScript safe integers. A decimal string keeps every digit exact for every supported n and k.
What does the combinations-without-repetition calculator cost?
The browser tool is free and runs locally.
Related tools
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/stat/combinations-without-repetition \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"n":10,"k":3}'const res = await fetch("https://api.kit.forhosting.com/stat/combinations-without-repetition", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"n": 10,
"k": 3
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/stat/combinations-without-repetition",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"n": 10,
"k": 3
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/stat/combinations-without-repetition", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"n":10,"k":3}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"n":10,"k":3}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/stat/combinations-without-repetition", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"n": 10,
"k": 3
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "stat.combinations_without_repetition",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Limits
max_n | 10000 |
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
This calculator accepts the pair n and k, evaluates the exact identity n factorial over k factorial times (n minus k) factorial, and returns the combination count as a deterministic JSON result. When k is larger than n the selection is impossible, so the task fails with invalid_input instead of inventing a zero or a signed extension.
How to send n and k and read the count
Field n is the size of the distinct pool — the upper index of C(n,k) — and must be a whole number from zero through ten thousand. Field k is how many items you choose without putting any item back — the lower index — and must be a whole number from zero through n. /(k!( n-k)!) so clients can display or log the rule without hard-coding it. POST a JSON body with two required non-negative integers. Aliases total and N are accepted for the same meaning. Aliases r, choose, and K map to k. A successful response echoes n and k as numbers, returns count as a decimal string of the exact combination value, and includes formula as the identity C(n,k)=n! Failed validation — missing n or k, a non-integer, a fraction, a negative value, a value above the published maximum, or k greater than n — returns invalid_input and is never charged. Pricing is a flat $0.002 per successful request with unit item. Use the endpoint from homework graders, programming-contest validators, interview-prep sandboxes, spreadsheet enrichment jobs, and probability demos that need C(n,k) before any floating probability step. Prefer the string count over forcing a JavaScript Number so coefficients larger than the safe-integer limit never lose low-order digits in JSON transport.
Classroom, sampling, and contest uses
Keep n at most ten thousand so the worst-case C(10000,5000) still finishes quickly on a Worker isolate and in the browser while covering teaching and contest sizes far beyond the safe Number range. Failed tasks that return invalid_input do not consume prepaid balance, which keeps exploratory scripts cheap when students type an impossible k while learning the contract.