The 24 Game Solver is a browser-based tool that finds every arithmetic expression that turns four whole numbers into exactly 24, using each number once and the four basic operations. It accepts any four integers from 1 through 99, runs an exhaustive search with exact reduced fractions rather than floating-point math, and returns up to 50 valid constructions ordered from shortest to longest. Every accepted expression uses each entered value exactly once, combines them with addition, subtraction, multiplication, division, and parentheses, and prints the full form such as 8 ÷ (3 − 8 ÷ 3) = 24 so a hand can be checked directly. The rules match the standard 24 Game documented by the UC Santa Cruz MBAMP mathematics program — no concatenation, exponentiation, factorials, or unary negation as extra moves. Processing happens entirely in the browser, so the numbers and expressions are never uploaded or stored. For Cool Math Games players who want a verified answer to a hand they have been stuck on, the 24 Game Solver gives the definitive verdict in a single click.

How Cool Math Games Players Reach a Solver
The 24 Game appears throughout Cool Math Games, classroom worksheets, and quick mental challenges in puzzle apps. The premise is simple: given four numbers, combine them with +, −, ×, ÷, and parentheses so the result equals 24. The catch is that many hands need a fractional intermediate value, and a player who tests only integer arithmetic will miss those solutions entirely. A solver exists for exactly this reason — it removes the trial-and-error burden and returns every valid construction at once. For players coming from Cool Math Games who just want to see the answer, the 24 Game Solver handles hands like the on-site puzzles in a single click.
Some hands are obviously solvable at a glance, such as 1, 2, 3, 4 where multiplying all four numbers together reaches 24 immediately. Other hands look impossible until a player spots a division that produces a useful fraction. Still others, like 1, 5, 11, 13, are genuinely unsolvable under the standard rules and stay unsolvable no matter how long someone works on them. Knowing which kind of hand you have is the first step toward using a solver efficiently: you either confirm a solution exists or confirm that none does, and either verdict is useful.
How to Find Every Expression That Equals 24
- Open the solver and enter exactly four whole numbers. Each field accepts a value from 1 through 99. Whole numbers only — fractions, decimals, and negative inputs are not allowed by the input contract, and the search will not run until four valid values are present.
- Select Solve to launch the exhaustive search. The solver picks every unordered pair of remaining terms, combines them with addition and multiplication, both subtraction orders, and both legal division orders, then returns the new term to the pool. It repeats that process until only one term remains, which is what makes the search exhaustive under the disclosed operation set.
- Read the returned expressions from the innermost parentheses outward. Parentheses are significant: they disclose the order in which operations were applied. Removing them changes the meaning of the expression and almost always breaks it.
- Check that every entry uses each number once. A valid expression contains all four of your inputs exactly once and equals exactly 24 — not approximately 24, not 23.99, not 24.000001. The fraction-based equality check guarantees that close-but-not-equal results never appear as solutions.
- Treat a no-result outcome as the verdict. If the page reports no solution, the exhaustive search confirmed that no valid construction exists under the standard rules for the hand you entered. A puzzle that allows powers, factorials, or concatenation is a different problem the solver will deliberately not answer.
The Four Rules the Solver Enforces
The tool follows a tight rule contract drawn from the common 24 Game documented by the UC Santa Cruz MBAMP mathematics program and cross-checked against 4nums. First, every entered number must appear exactly once in each accepted expression — the solver does not concatenate digits, reuse a number, or drop one from the construction. Second, only the four basic operations are allowed — addition, subtraction, multiplication, and division — plus parentheses to control order. Third, the final value must equal exactly 24, which is why the engine stores every intermediate result as a reduced fraction with a positive denominator and checks the final equality as numerator = 24 × denominator. Fourth, the input range is 1 through 99, broader than commercial card editions that limit to 1–13.
Operations that some puzzle variants permit — concatenation such as turning 1 and 2 into 12, exponentiation, factorials, decimal-point insertion, and unary negation as a separate move — are explicitly excluded. This is a deliberate scope choice, not a missing feature. Anyone using the solver as a class aid should confirm the source puzzle uses the same operation rules before accepting a no-result verdict as final; a hand that looks impossible under standard rules may be solvable under a wider rule set that this tool deliberately ignores.
Why Fractions Matter for Hands Like 3, 3, 8, 8
Some hands cannot be solved without a fractional intermediate value. The classic example is 3, 3, 8, 8. A player who tests only integer arithmetic will conclude the hand is impossible. In fact the construction 8 ÷ (3 − 8 ÷ 3) = 24 works, but only because 8 ÷ 3 is not an integer. The deeper explanation is in the 24 Game Solutions guide on fraction math, which walks through the same methodology in more depth.
Consider the worked example 8 ÷ (3 − 8 ÷ 3) = 24 step by step. First, evaluate the inner division: 8 ÷ 3 = 8/3. Second, perform the subtraction: 3 − 8/3 = 9/3 − 8/3 = 1/3. Third, evaluate the outer division: 8 ÷ 1/3 = 8 × 3 = 24. The arithmetic above is performed with reduced fractions: 8/3 is already in lowest terms, 1/3 has numerator 1 and positive denominator 3, and the final check is 8 × 3 = 24. No floating-point rounding is involved at any step. The solver uses the same fraction-based representation, so it returns this exact construction rather than missing it because of a binary rounding error or rejecting it as not exactly 24.
Reading the Returned Expressions
Every accepted expression is printed in full, followed by = 24. That format exists for two reasons. First, it lets a player check the proposed answer directly instead of accepting an unexplained success message. Second, it makes parentheses visible, which matters because they control order of operations and should not be removed casually. If the solver returns 8 ÷ (3 − 8 ÷ 3) = 24, the parentheses around (3 − 8 ÷ 3) are not decorative — they are required for the construction to evaluate correctly, and dropping them changes the result.
The result list is sorted by length first and locale order second, so the shortest constructions appear before rearranged equivalents of the same arithmetic idea. Up to 50 expressions are returned. That cap keeps the interface readable and prevents a hand with many equivalent forms from filling the page with hundreds of rearrangements. A hand with only a handful of distinct constructions will return fewer entries, and a hand with no solution will return none.
The list is a set of valid constructions, not a claim to contain one canonical answer per mathematical equivalence class. Reordered expressions that follow the commutative property of addition and multiplication, or that regroup parentheses in algebraically identical ways, can still appear in the output. If two expressions look different but evaluate to the same thing, they are treated as distinct valid answers within the 50-item cap.
Anchor Hands That Verify the Search
Several hands serve as verification anchors because each one proves a different property of the solver. The table below lists the hands the tool uses to confirm that the operation contract, fraction handling, and result bound are all working as intended.
| Hand | Outcome | Why it matters |
|---|---|---|
| 1, 2, 3, 4 | Solvable | Simple product 1 × 2 × 3 × 4 = 24 confirms basic multiplication is checked end-to-end |
| 3, 3, 8, 8 | Solvable | Requires 8 ÷ (3 − 8 ÷ 3) = 24 with a fractional intermediate that integer-only checks would miss |
| 1, 5, 5, 5 | Solvable | Requires 5 × (5 − 1 ÷ 5) = 24 with another fractional intermediate |
| 1, 5, 11, 13 | Unsolvable | Confirms the exhaustive search correctly returns nothing under the basic rules |
These anchors are not arbitrary. They prove that integer-only arithmetic would miss the solvable fractional cases, that an incomplete search would falsely declare 1, 5, 11, 13 solvable, and that the fraction-based equality check accepts exactly 24 without false positives from rounding. An independent fraction-based checker can reproduce the same solvability classification without importing the production implementation, which is exactly the property the solver relies on for trust.
Using the Solver as a Practice Partner
For classroom or puzzle practice, the recommended workflow is to try the hand yourself first, then select Solve, and finally compare your construction with the returned list. If your answer appears in the list, you have a correct expression. If your answer does not appear but the list is non-empty, your construction likely violated one of the four rules — usually an extra use of a number or a missing parentheses pair. If the list is empty, the hand is unsolvable under the basic rules and the puzzle you are working from must use a different operation set.
All processing happens in the browser. The four numbers you enter and the expressions the solver generates are not uploaded, stored, or attached to an account. There is no login and no usage limit, so the same tool works for a single quick check or for repeated classroom practice without setup. Privacy and repeat-use are both part of the design, not extras. The solver does not generate random puzzles, rank difficulty, teach a guaranteed shortest solution, or verify expressions a player has typed — it answers one focused question, and a well-defined question is what makes the answer trustworthy for both casual practice and graded exercises.
For a deeper look, see Cube Volume With Edge Length: One Input, Four Answers.