The 24 Game Solver is a browser tool that returns every valid arithmetic expression that turns four whole numbers into exactly 24, using each number once and only the four basic operations of addition, subtraction, multiplication, division, and parentheses. It runs an exhaustive search over all valid pairings and operation orders, then displays up to 50 distinct expressions that satisfy the rule. Each result is printed as a complete expression followed by = 24, so the parenthesization that produces the answer is visible in the output itself rather than hidden inside a yes/no verdict. Because the search keeps intermediate results as reduced fractions rather than floating-point numbers, hands such as 3, 3, 8, 8 that require a fractional intermediate are caught and reported correctly. When the tool finishes with no solution, that conclusion is the final answer for the four basic operations, not a guess after a partial search.

What the 24 Game Solver Does
The classic 24 Game rule, as documented by the University of California, Santa Cruz mathematics program, is simple to state and surprisingly hard to play: given four numbers, combine them with +, −, ×, ÷, and parentheses so the result equals exactly 24. Each number must be used exactly once, and no other operations are allowed. The 24 Game Solver applies that rule mechanically, exploring every legal grouping of your four inputs and reporting back the constructions that work.
Behind the scenes, the solver reduces the problem one step at a time. At each step, it picks two terms from the pool, combines them with addition, multiplication, both subtraction orders, and both nonzero division orders, and returns the new term to the pool. Repeating that process explores different pairings and parenthesis structures until only one term remains. If that final term equals 24, the full expression that built it is recorded. If the four inputs cannot be reduced to 24 under any of these steps, the search ends with no solution.
The output is capped at 50 expressions, which keeps the page readable even when a hand has many equivalent rearrangements. Different reorderings of the same arithmetic idea can still appear, so the list should be read as a set of valid constructions rather than a claim of one canonical answer per mathematical equivalence class.
How to Solve a 24 Game Hand Step by Step
- Type one whole number from 1 through 99 into each of the four input fields on the 24 Game Solver page.
- Select Solve to launch the exhaustive search over all valid pairings, both subtraction orders, both division orders, and every parenthesis structure.
- Read each returned expression from the innermost parentheses outward, applying the four basic operations in the order the parentheses specify.
- Treat the absence of any result as the verdict: if the page shows no solution, the four basic operations cannot combine those four numbers to make 24.
The four input fields each accept a single integer, and only integers in the range 1 to 99 are accepted. With inputs bounded at 99, intermediate integer products remain inside JavaScript's safe-integer range, so the arithmetic does not silently overflow. The search returns the complete parenthesized expression followed by = 24, which lets you check the proposed answer directly instead of taking an unexplained success message at face value.
Why Exact Fractions Matter for Some Hands
Several hands that solve 24 require a fractional intermediate result. The textbook example is 3, 3, 8, 8, which has no solution path that stays in whole numbers until the final step. A solver that compares values with floating-point arithmetic can either miss the path entirely or report a near miss as exact. The 24 Game Solver avoids both pitfalls by storing every intermediate result as a reduced fraction: an integer numerator, a positive integer denominator, and the greatest common divisor taken out at each step.
Equality with 24 is then checked as numerator = 24 × denominator, which is an exact integer comparison instead of a tolerance check on a floating-point number. A value merely close to 24 is never presented as exact, and a valid repeating fractional path is not lost to rounding noise. The 1, 5, 5, 5 hand exercises the same property: it solves, but only through a fraction in the middle, and an integer-only solver would have reported no solution.
How to Read a Returned Expression
Each expression in the result list is the full parenthesized form, not a flat left-to-right chain. The innermost parentheses are evaluated first, then the next layer outward, and so on until the whole expression resolves to 24. Removing parentheses casually can change the order of operations and is not safe; the tool shows them for a reason.
For a hand like 3, 3, 8, 8, one returned expression is 8 ÷ (3 − 8 ÷ 3) = 24. Reading it step by step: 8 ÷ 3 gives 8/3, then 3 − 8/3 equals 9/3 − 8/3, which is 1/3, and finally 8 ÷ (1/3) equals 8 × 3, which is 24. The same arithmetic without parentheses would resolve left-to-right and produce a different number, so the parentheses are part of the answer.
Because the search generates both subtraction orders and both division orders, you may see multiple expressions that differ only in the order of the operands. That is normal and reflects the underlying algebra, not different solutions to a different problem.
Hands That Anchor the Verification
A few hands reliably test different parts of the rule. The table below summarizes how the 24 Game Solver classifies each one, and why it sits in the test set.
| Hand | Has a solution under the four basic operations? | What it tests |
|---|---|---|
| 1, 2, 3, 4 | Yes | Simple product path that needs no fractions |
| 3, 3, 8, 8 | Yes | Fractional intermediate, the classic difficult hand |
| 1, 5, 5, 5 | Yes | Another fractional path, but constructed differently |
| 1, 5, 11, 13 | No | Confirms that an impossible hand is reported as no solution |
The 1, 5, 11, 13 hand is included because a correct solver must be able to say when a hand has no solution, not just when it does. An independent fraction-based checker reproduces the same solvability classification without importing the production implementation, which is a useful cross-check on the search behaviour.
When the Tool Reports No Solution
If the page returns no solution, the exhaustive search found no expression that uses each of the four numbers exactly once and combines them with addition, subtraction, multiplication, division, and parentheses to equal 24. That is a definitive verdict for the displayed rules and input limits, not a fallback after time ran out or operations were skipped.
Before treating no solution as final, it is worth checking two things. First, the four numbers should be copied correctly, since a single typo can change the solvability of a hand. Second, the source puzzle should use the same operation rules. A puzzle that allows powers, factorials, digit concatenation, or repeated use of a number is a different problem, and a deliberately constrained solver may not show answers for it. The 24 Game Solver does not add concatenation, exponentiation, factorials, roots, decimal-point insertion, unary negation as an extra operation, or reuse of a number, and a result depends on that contract.
If you want a second opinion on the classification, the same rule set is documented by the UC Santa Cruz 24 Game program and independently cross-checked against 4nums. Both treat the four basic operations as the allowed set, which is also the contract the solver implements.
For classroom or puzzle practice, the natural workflow is to try the hand yourself first, then select Solve and compare your construction with the returned list. If your expression matches one in the list, the tool simply confirms it. If the list contains an expression you missed, the inner-to-outer reading order is usually enough to see where the trick lies.
What the Solver Does Not Do
The 24 Game Solver answers one narrow question: whether the four numbers you supplied can make exactly 24 under the stated rules, and which concrete expressions demonstrate the answer. It does not generate random puzzles, rank difficulty, teach a guaranteed shortest solution, or verify an expression you typed. It is not a teaching tool for the 24 Game strategy more broadly, and it does not adjudicate alternative rule sets where powers or factorials are allowed.
All processing happens in the browser. The four numbers and the generated expressions are not uploaded, stored, or attached to an account, and no login is required. There is no usage limit, so the same hand can be run repeatedly while you work through it on paper, and it costs nothing to check a second hand immediately afterwards.
For a deeper walk through the puzzle itself, the related guide on how to make 24 from any four numbers takes a more pedagogical approach. The solver here is the verification counterpart: hand it a hand, and it returns the ledger of constructions that work.