Subset Calculator

Find the number of k-element subsets, all subsets, and proper subsets for a finite set.

Count subsets
Enter the set size n and the desired subset size k.

About subsets and combinations

A subset is a collection whose elements all come from another set. If a set contains n distinct elements, each element has two independent possibilities when forming a subset: included or excluded. Multiplying those choices gives 2 to the power n total subsets. This count includes both the empty set and the original set itself, which are valid subsets under the standard mathematical definition. Sometimes a problem asks only for subsets containing exactly k elements. Their number is the binomial coefficient C(n,k), read as n choose k. Its factorial formula is n factorial divided by k factorial times (n-k) factorial. The calculator evaluates the same ratio with an iterative product, avoiding unnecessarily huge intermediate factorials and returning an exact integer. Choosing two students from five, for example, gives C(5,2) = 10 possible pairs. A proper subset is any subset that is not equal to the complete original set. Therefore a set with n elements has 2 to the power n minus 1 proper subsets. Some introductory sources use a stricter convention that excludes both the original set and the empty set, calling the remainder nonempty proper subsets. Under that convention the count is 2 to the power n minus 2 when n is positive. This calculator follows the common definition in which the empty set is proper. Order does not matter in a subset. Selecting Alice and Bob produces the same subset as selecting Bob and Alice. This distinguishes combinations from permutations, where order creates different outcomes. Elements are also assumed to be distinct. If a written list repeats a value, convert it to a true set by removing duplicates before counting n. The calculator asks for cardinalities rather than individual values because names and values do not change the count. Subset counts appear throughout combinatorics, probability, computer science, data analysis, and discrete mathematics. They describe possible feature selections, committees, binary states, search spaces, and combinations of options. Counts grow quickly: a 20-element set already has 1,048,576 subsets. Exact whole-number arithmetic is used so large values do not acquire floating-point rounding errors. Inputs are limited to manageable sizes for a responsive browser calculation, but the formulas remain the same for every finite set.

Subset examples

These examples compare fixed-size combinations with complete power sets.

Set size and subset sizeCountsInterpretation
n = 5, k = 2C(5,2) = 10; total = 32Ten unordered pairs
n = 8, k = 3C(8,3) = 56; total = 256Fifty-six groups of three
n = 10, k = 0C(10,0) = 1; total = 1024The empty subset is unique

How to count subsets

  1. Enter the number n of distinct elements in the original set.
  2. Enter k, the exact number of elements wanted in each selected subset.
  3. Select Calculate Subsets to evaluate C(n,k) and the full power-set count.
  4. Use the proper-subset total when the original set itself must be excluded.

Subset calculator FAQ

Does the empty set count as a subset?

Yes, the empty set is a subset of every set, including itself. That is why C(n,0) always equals one.

What is the difference between a subset and a proper subset?

A subset may equal the original set. A proper subset must omit at least one element, so there is one fewer proper subset than total subsets.

Why is the total number of subsets 2 to the power n?

Every one of the n elements can independently be included or excluded. Multiplying two choices n times gives 2 to the power n possibilities.

Does order matter when choosing a subset?

No, subsets are unordered collections. If order matters, the problem calls for permutations rather than combinations.

Can a subset contain repeated elements?

Not when the original collection is a mathematical set, because sets contain distinct elements. Problems allowing repetition use multiset combinations and require a different formula.