Free Online Calculators
A combination sum calculator finds all unique groups of numbers from a given set that add up to a specific target value. You enter your numbers and a target sum, and the tool shows every possible combination no programming knowledge required.
Enter positive integers separated by commas, spaces, or line breaks
Each number can be used multiple times. Example: {2, 2, 3} is valid.
Candidates: 2, 3, 6, 7
Target: 7
With Reuse: {2, 2, 3}, {7}
Without Reuse: {7} only
A combination sum calculator is a mathematical tool that takes a list of numbers and a target value, then finds every possible combination of those numbers that adds up to the target. It removes the guesswork from manual trial-and-error and gives you every valid answer instantly.
This type of calculator appears in many real-world situations. Budget planning, inventory matching, exam preparation, data reconciliation in Excel or Google Sheets, and competitive programming problems all of them require you to find which numbers combine to hit a specific total.
The core problem it solves is called the Combination Sum Problem in computer science and mathematics. Given a set of candidate numbers and a target, return all combinations where the chosen numbers sum to the target. Numbers can sometimes be reused (depending on the version of the problem), and the order does not matter meaning {2, 3} and {3, 2} count as the same combination.
Before you use a combination sum calculator tool, it helps to understand why this problem is meaningful across so many fields.
Reconciling transactions is a classic use case. You might have ten invoices and need to figure out which ones add up to a specific payment you received. Doing this manually for even five or six numbers becomes tedious. For ten or more numbers, it becomes nearly impossible without a tool.
The combination sum problem teaches core concepts about recursive thinking, backtracking, and combinatorial logic. Students preparing for competitive mathematics or data science roles encounter these problems regularly.
This is one of the most frequently asked algorithm problems in technical interviews. Companies like Google, Amazon, and Microsoft use combination sum variants to test a candidate's ability to think recursively and optimize solutions.
Understanding the problem deeply not just using a calculator gives you an edge in all three areas.
A combination sum calculator uses a method called backtracking. Think of backtracking like exploring a tree of choices. You start with an empty combination, then add one number at a time. If the running total equals the target, you record that combination. If it exceeds the target, you stop that branch and go back (backtrack) to try a different number.
Here is how the process flows step by step:
You provide two things: a list of candidate numbers (for example: 2, 3, 6, 7) and a target sum (for example: 7).
Starting from the first number, it builds combinations by adding one number at a time.
After each addition, the running total is checked against the target. Equal = record the combination. Exceeds target = backtrack.
Once every branch of the decision tree is explored, the tool returns a full list of valid combinations.
For the example above (candidates: 2, 3, 6, 7 | target: 7), the valid combinations are:
2 + 2 + 3 = 7
7 = 7
These are the only two unique combinations that sum to 7 from that set.
Using a combination sum calculator online is straightforward. Most tools follow the same basic interface:
Type them in separated by commas. For example: 2, 3, 5, 10, 15.
This is the value you want your combination to reach. For example: 20.
Some calculators let you decide whether numbers can repeat or whether each number can only be used once. Make sure you select the correct mode for your use case.
The tool processes all possible combinations and returns a list of every group that adds up to your target.
Results typically display as grouped sets. {5, 15}, {10, 10}, {5, 5, 10}, and so on — depending on what is valid.
Many online combination sum calculators also show you the number of valid combinations found, which is useful when you just need to know whether any solution exists.
Many professionals need to find combinations that equal a given sum directly inside a spreadsheet without switching to an external tool. Excel and Google Sheets do not have a built-in combination sum function, but you can replicate the logic using formulas or built-in features.
The most practical approach in Excel is using the Solver add-in:
=SUMPRODUCT(A2:A10, B2:B10)Solver will find one combination. If you need all combinations, you must run Solver multiple times with exclusion constraints added each time.
For small sets, you can test combinations manually using IF and SUM formulas. However, this approach does not scale beyond five or six numbers.
Google Sheets has no native Solver equivalent for this problem. For combination sum in Google Sheets, the cleanest approach is to use Google Apps Script to write a backtracking function and run it as a custom formula. This requires basic scripting knowledge but produces complete, automated results.
If you regularly need this functionality, a dedicated combination sum calculator online tool is faster and more reliable than building it in a spreadsheet from scratch.
People sometimes confuse two related but different concepts. Here is a clear side-by-side breakdown:
| Feature | Combination Formula (nCr) | Combination Sum Problem |
|---|---|---|
| What it does | Counts how many ways you can choose r items from n items | Finds every specific group of numbers that adds up to a target total |
| Also written as | C(n, r) or nCr | Combination Sum Calculator |
| Formula used | C(n, r) = n! / (r! × (n − r)!) | Backtracking / Recursive Algorithm |
| Example | C(5, 2) = 10 ways to choose 2 items from 5 | Candidates: {2, 3, 6, 7} → Target: 7 → Results: {7}, {2, 2, 3} |
| Output type | A single number (count of arrangements) | A list of all valid number groups |
| Cares about order? | No | No |
| Cares about values? | No only counts selections | Yes actual numbers must sum to target |
| Used in | Probability, statistics, combinatorics | Finance, programming, exam prep, reconciliation |
| What you get | How many combinations exist | Which exact combinations exist |
| Tool needed | nCr calculator | Combination sum calculator |
Not all combination sum problems are the same. The calculator you use should match the type of problem you have.
In this version, you can use any number from the candidate list as many times as needed. Example: candidates = {2, 3}, target = 6. Valid combinations include {2, 2, 2}, {3, 3}, and {2, 2, ... wait 2+2+2=6, 3+3=6}. Both are valid.
This is the classic LeetCode Combination Sum I problem and the most common version in programming interviews.
Here, every candidate number can only be used one time. Example: candidates = {2, 3, 5}, target = 8. You cannot use 2 twice. Valid combinations are only those where each number appears at most once.
This is the LeetCode Combination Sum II variant, often seen in real-world scenarios like invoice matching.
Some problems restrict candidates to digits 1–9 and require you to find combinations using exactly k numbers. This variant appears in advanced mathematics problems and some school-level competitive exams.
A finance team receives a payment of PKR 85,000. They have seven open invoices of different amounts. They need to know which invoices add up to exactly 85,000 so they can allocate the payment correctly. A combination sum calculator handles this in seconds.
Students in mathematics, computer science, and data science programs encounter combination sum problems in coursework. Using a combination sum calculator helps verify manual solutions and build intuition for how backtracking works.
A warehouse needs to fill a 500 kg shipping container. They have items of various weights. Which items can they combine to fill exactly 500 kg? A number combination sum calculator finds every valid packing option.
Technical interviews at top companies regularly feature combination sum problems. Practicing with a calculator helps candidates check their algorithm's output against the correct answer.
In points-based games and fantasy leagues, players and managers check whether specific score combinations reach a given total for example, finding which combination of goals, assists, and bonuses reaches 50 fantasy points.
Some calculators treat {2, 3} and {3, 2} as different combinations. A correctly built tool should treat them as identical since order does not matter in combination sums. Always check whether your tool produces duplicate results.
This changes the output dramatically. Always confirm whether your problem allows a number to be reused before interpreting the results.
The number of valid combinations can grow exponentially as your candidate list grows. If you have 30 numbers and a large target, the calculator may produce thousands of results. Filter your candidate list first to keep results manageable.
A combination sum calculator adds numbers. It does not multiply them. If you need a target product (numbers that multiply to a value), you need a different type of tool.