Solve ABC is a brute-force solver for alphametics
(word sums like SEND + MORE = MONEY) and general constraint puzzles
over letters. You give each letter a range of possible values and a set of equations or
inequalities it must satisfy, and the tool searches every combination for the assignments that
make all of them true at once. Everything runs in your browser — nothing is uploaded.
Quick start
- Press a Try a sample button in the header to load a worked example, or start from scratch.
- Set each letter's min/max value and whether its value must be unique in the Constraints grid.
- Type one expression per line in the Expressions box
(e.g.
SEND+MORE==MONEY). - Press Analyze. Solutions stream into the Output panel as they are found.
On this page
The constraints grid
Each usable letter — the Latin letters A–Z followed by the Greek
letters α β γ δ ε ζ η θ κ λ ξ ρ σ τ ψ ω — has a row with three controls:
| Control | Meaning |
|---|---|
| Checkbox (left of the letter) | Whether this letter's value must be unique among the other ticked letters. |
| First number box | The minimum value the letter can take
(default 0). |
| Second number box | The maximum value (default
9) — or a comma-separated list of
the exact values allowed. |
A letter you don't use in any expression is simply ignored, so you only need to set ranges for letters that appear.
Uniqueness
Tick a letter's checkbox to require it to hold a value different from every other
ticked letter. This is what makes a classic alphametic work: in
SEND + MORE = MONEY every letter stands for a different digit, so all the
participating letters are ticked.
- Toggle Uniqueness flips every letter's checkbox at once — a fast way to turn the whole alphabet unique (then untick any exceptions).
- Each expression's variable values are unique (the checkbox below the grid) is a different, looser rule: it requires the letters within a single expression to differ from each other, without forcing global uniqueness. Useful for grid puzzles where each equation's terms must be distinct but values may repeat across equations.
Allowed-value lists
Instead of a single maximum, the max box accepts a comma-separated list
of the only values the letter may take, e.g. 2,4,6,8 to restrict it to even
digits.
Important: the search still starts a letter at its
min value, so set the min to the lowest value in your list (e.g. min
2 for a list of 2,4,6,8). Otherwise the min value leaks in as an
extra, unwanted candidate.
Writing expressions
Enter one expression per line. Each line is a relationship that a valid solution must satisfy. Two shapes are common:
- Assignment / equality:
D = EorA == B*D*G— the two sides must be equal. - Inequality:
A > B,D > I + 10— a comparison that must hold.
A single = is treated the same as == (equality), so you can
write equations naturally. Whitespace is ignored.
Operators
| Operator | Meaning |
|---|---|
= / == | Equal to |
!= | Not equal to |
> < | Greater than / less than |
>= <= | Greater/less than or equal to |
+ - * / | Arithmetic |
^ | Power (e.g. I ^ 2) |
% | Modulo / remainder (e.g. D % 10 == 9) |
( ) | Grouping |
Alphametic words
A run of two or more capital Latin letters is read as a multi-digit
number, with each letter a digit and the leftmost the most significant. So SEND
is expanded to S·1000 + E·100 + N·10 + D automatically. That is what lets you
write SEND+MORE==MONEY directly instead of spelling out the place values.
This expansion applies only to capital-letter runs. Greek letters are always single variables, so use them when you want plain one-digit unknowns rather than word digits.
For genuine alphametics, give each leading letter a min of 1 so a number
doesn't start with a zero (e.g. in SEND+MORE=MONEY, set S and
M to min 1).
Math functions
Expressions are evaluated with the math.js engine, so its functions are available — for example:
floor(x),ceil(x),round(x)— roundingsqrt(x),abs(x),x ^ y— roots and powersx % y— remainder
Example: A = floor(C / D), I = sqrt(C).
Output & controls
- Analyze — runs the search. Solutions appear in the Output panel as
A=…;B=…;…lines, one per solution, ending withFinished!(orNo solutions found!). The search stops after 100 solutions. - Clear — empties the input, output and all constraints.
- Time spent — how many seconds the current search has taken; large unconstrained puzzles can take a while, so tighten ranges to speed them up.
- The search runs in a background worker, so the page stays responsive and partial progress is shown while it works.
Tips
- Narrow the ranges. The search tries every combination, so every letter you pin down (a tighter min/max or an allowed-value list) makes it dramatically faster.
- Add the obvious constraints. Inequalities and leading-digit minimums prune huge parts of the search space.
- Start from a sample. The four header samples cover the common shapes — a chained-arithmetic puzzle, a classic alphametic, a functions puzzle, and a large unique-value sum grid — and are a good template to edit.