Solve a 24 Puzzle Instantly
Enter any four numbers, choose a target (default is 24), and this calculator will search for valid expressions using + − × ÷ and parentheses.
What is a 24 game calculator?
The 24 game is a classic mental math puzzle: you are given four numbers, and your goal is to combine them with arithmetic operations to make exactly 24. You must use each number once, and you can use parentheses to control the order of operations. This calculator automates the search and gives you a valid expression when one exists.
How to use this tool
- Enter four numbers in the inputs.
- Set your target value (24 by default).
- Click Find Solution to get one valid expression.
- Enable Find all distinct solutions if you want a complete list.
- Use Random Puzzle to generate practice rounds quickly.
How the solver works
1) It checks every number order
Because order matters in subtraction and division, the solver tests all permutations of the four inputs. For example, using 8, 3, 8, 3 may produce a different expression path than 3, 8, 3, 8.
2) It tries all operator combinations
For each number order, it applies all combinations of +, -, *, and / in three operator slots. That means many expression candidates are evaluated quickly and safely.
3) It evaluates all parenthesis patterns
Parentheses create different expression trees, such as (a op b) op (c op d) and
a op (b op (c op d)). The script tests all standard binary grouping patterns for four numbers.
Example puzzle ideas
- 3, 3, 8, 8 can produce 24 with:
8 / (3 - (8 / 3)) - 1, 5, 5, 5 is a popular challenge set.
- 4, 7, 8, 8 often has multiple solutions.
Why this helps with math fluency
Practicing 24 game puzzles strengthens number sense, operation intuition, and flexible problem-solving. If you are teaching, it is also a great way to discuss precedence, associativity, and why parentheses matter. If you are learning, it helps build confidence with fast arithmetic reasoning.
Tips for solving by hand first
- Look for multiplication pairs that get close to 24 (like 6×4, 8×3, 12×2).
- Use division to create useful fractions (for example, 8/4 = 2).
- Try building 1 or 2 from two numbers, then scale up with the remaining numbers.
- When stuck, change the order and regroup with parentheses.
FAQ
Does it always find a solution if one exists?
Yes. The search is exhaustive for four numbers and the basic arithmetic operators.
Can I use targets other than 24?
Absolutely. Change the target input to any number and the solver will aim for that value.
Can decimal numbers be used?
Yes. This calculator accepts decimals as well as integers.