Cryptarithm Solver
What is a cryptarithm?
A sum written in letters instead of digits, where each letter stands for a different digit and the same letter always means the same digit. No number may start with 0. The aim is to find the digits that make the sum true. They are also called alphametics, cryptarithmetic puzzles or verbal arithmetic, and the best ones, like SEND + MORE = MONEY, have exactly one answer and spell out something as well.
The solver takes sums with any number of words, subtractions, and products written with × or *. It finds every answer, so it also tells you whether a puzzle is fair.
SEND + MORE = MONEY: the solution, step by step
Henry Dudeney published it in 1924, and it is still the one everybody knows. The answer is 9567 + 1085 = 10652, and it can be found by pure reasoning. MONEY has one more letter than SEND or MORE, and adding two four-figure numbers carries at most 1, so M = 1. In the thousands column, S + 1 plus a carry has to reach ten or more to make that 1, which forces O = 0, and then S = 9.
The hundreds column now says E + 0 plus a carry gives N, and N cannot equal E, so there is a carry and N is E + 1. Put that into the tens column, N + R plus a carry ends in E, and the only way is R = 9 or 8; 9 is taken, so R = 8. What is left is D + E = Y + 10 with the digits still free, and only E = 5, N = 6, D = 7, Y = 2 works. The solver above prints exactly this chain of reasoning for any sum you give it, and says where logic runs out.
How to solve cryptarithms
Start at the left. If the answer is longer than every word being added, its first letter is a carry, and with two words a carry is 1. Then work column by column, writing each as an equation with the carry from its right added in. Letters that appear in many columns, and columns where a letter meets itself, like O + O, give the most away: O + O is always even before the carry. When a column alone tells you nothing more, read two neighbouring columns together, which is how R = 8 falls out of SEND + MORE. When logic runs dry, try the remaining digits for the most constrained letter and see which survive.
When a puzzle has more than one answer
TWO + TWO = FOUR has seven answers, such as 734 + 734 = 1468, so it is a fine exercise but not a fair puzzle. The solver lists them, which is the quickest way to check a puzzle you have made yourself before you give it to someone: change a word until it reports exactly one.
More puzzles with numbers
If the satisfaction here is digits clicking into the only place they can go, the magic square solver and the sudoku solver, which also explains its moves, are the same pleasure. For the same click in wood and metal, our mechanical puzzles have exactly one way together, and Cube Alchemy comes with 180 challenges to reason through from one set of seven pieces. There are more solvers on the puzzle tools page.
For sums made of matches instead of letters, the matchstick puzzle solver finds every answer to move, take away or add.
Frequently Asked Questions
What is the answer to SEND + MORE = MONEY?
9567 + 1085 = 10652. It is the only answer: S = 9, E = 5, N = 6, D = 7, M = 1, O = 0, R = 8 and Y = 2.
How do you solve SEND + MORE = MONEY?
Start at the left. MONEY is one letter longer than the words being added, and two four-figure numbers carry at most 1, so M = 1. That forces O = 0 and S = 9. The middle columns give N = E + 1 and R = 8, and the ones column leaves only E = 5, N = 6, D = 7 and Y = 2.
What is a cryptarithm?
A sum written in letters, where each letter stands for a different digit and no number starts with 0. Solving it means finding the digits that make the sum true. They are also called alphametics or cryptarithmetic puzzles.
Can a cryptarithm have more than one answer?
Yes. TWO + TWO = FOUR has seven answers, for example 734 + 734 = 1468. A well-made puzzle has exactly one, and the solver tells you how many there are.
Can it solve multiplication cryptarithms?
Yes. Write the product with × or *, for example TO × GO = OUT, and it finds every answer. The step-by-step column logic is shown for sums and subtractions.