How to Solve Train Tracks Puzzle
Updated Saturday, October 3, 2026 · 9 min read
Every Train Tracks puzzle can be solved by logic alone. No guessing, no trial and error.
What you're looking at
A Train Tracks board is a square grid with numbers along the top and down the left edge, and two dark tabs on its border: the entrance and the exit. Your job is to lay a single railway from one tab to the other, so that every row and every column contains exactly as many track squares as its number says.
Each number is a count of squares, not a count of turns or the length of a run. A 3 beside a row means exactly three squares in that row hold a piece of track, wherever they are. Add up all the row numbers and you get the total length of the railway in squares; add up the column numbers and you get the same total. That's a handy sanity check, and we'll use it later.
The solving order at a glance
Good solving is mostly about doing things in the right order, because the cheap deductions make the expensive ones easy. This is the sequence the rest of this guide walks through:
- Cross out every row and column whose clue is 0.
- Fill every line whose clue equals the number of squares still open in it.
- Apply the border rule to every square on the edge of the grid.
- Grow the line outward from the entrance, the exit and the grey squares, following each forced connection.
- Count and cross out: compare every clue with what's placed and what's still open, and repeat until nothing new appears.
- Check that the finished line is one unbroken piece with every clue matched.
Step 1: Cross out every zero
A 0 clue means that whole row or column is empty. Mark every square in it with an ✕. This is the easiest deduction on the board and it often rules out entire stretches of grid, which shrinks everything that follows.
It's worth marking the squares rather than just noting them mentally. The ✕ tool is free and unlimited, and a board with the dead squares visibly crossed out is far easier to read than one where you're holding the exclusions in your head. A crossed-out square also acts as a wall: the railway can't enter it, so its neighbours lose one possible connection each, and that's what drives the later steps.
Step 2: Fill the full lines
If a clue equals the width of the grid, say a 5 in a 5×5 puzzle, every square in that line holds track. You don't yet know which piece goes where, but you know the squares are used, so you can stop worrying about them being empty and start working out how they connect.
Worked example
A clue becomes full once squares are crossed out
Suppose a row on a 7×7 board has the clue 3. At the start there are seven open squares, so nothing is forced. But the columns above two of those squares are zeros, so those two squares get an ✕. Now five squares remain open and the clue is still 3: still not forced.
Then the border rule (step 3) removes two more of the five. Three open squares, clue 3: all three are track. The row went from 'could be anything' to 'fully decided' without placing a single piece, just by crossing squares out.
Step 3: Apply the border rule
A piece can't point off the edge of the grid. So a square in the top row can't be a vertical straight, because that would need a connection going up and out. In the top row only horizontal straights and corners that turn down are possible; the same logic applies to every edge. The only exceptions are the entrance and exit squares, which connect to the border on purpose.
- Top row: horizontal straight, or a corner that turns down.
- Bottom row: horizontal straight, or a corner that turns up.
- Left column: vertical straight, or a corner that turns right.
- Right column: vertical straight, or a corner that turns left.
- The four corners of the grid: only the one corner piece that turns inward.
Step 4: Grow the line from the tabs and the grey squares
The entrance and exit squares must connect to their tabs, and the grey squares already contain pieces. Start your placements there. A piece with an open end forces the next square: whatever sits on the other side of that end has to connect back. Follow each forced connection as far as it will go.
Worked example
A forced run from the entrance
The entrance tab sits on the left edge, in row 2. The square beside it must connect to the tab, so it's either a horizontal straight or a corner. Row 2's clue is 1, so the line can't run along row 2 beyond this single square: it must be a corner.
Check the neighbours: the square above is in row 1 and the square below is in row 3. If the column clue and the border rule remove 'up' (say row 1 in that column is crossed out), the corner must turn down. Without placing anything else, you now know two squares and the direction the line leaves the entrance.
Step 5: Count and cross out, then repeat
After each placement, go back to the clues. For every row and column, compare the number with two figures: how many squares already hold track, and how many are still open (neither track nor crossed out). If track-placed plus open equals the clue, every open square must be track. If track-placed already equals the clue, every remaining open square must be empty.
This count-and-cross loop is the engine of the whole puzzle. Most Easy boards are finished in one or two passes, and Medium boards in three or four. Hard boards need patience, but the method doesn't change: it just takes more passes, and sometimes a more careful look at a particular bottleneck (see the strategy guide for those).
Step 6: Check the line is one piece
A finished board has one unbroken railway: no branches, no loops, no loose ends, and every number matched. If you've placed a piece with an end that connects to nothing, something earlier is wrong, and it's usually the most recent placement or the one before.
When you're stuck, look for a square that has only one possible neighbour left. Track squares need two connections (or one, plus a tab), so a square with a single option can't hold track. Cross it out and see what that does to the squares around it. This 'dead end' check is the most reliable way to restart a stalled board.
Frequently asked questions
Do I ever need to guess in Train Tracks?
No. Every puzzle has exactly one solution and it can always be reached by logic. If you feel you have to guess, a deduction has been missed, almost always a miscount or an overlooked border-rule exclusion.
Where should I start on a new board?
Cross out the zero lines, fill any line whose clue equals the number of open squares, then apply the border rule to the edge squares. After that, grow the line from the entrance, exit and grey squares.
What does the number beside a row or column mean?
It is the number of squares in that row or column that contain track. It does not count turns, and it does not say how long any single run is.
References
- Simon Tatham's Portable Puzzle Collection: Tracks: The rules of the Tracks puzzle, in its best-known open-source implementation.
- Logic puzzle (Wikipedia): Background on logic puzzles and the formats they take.
- Deductive reasoning (Wikipedia): The kind of reasoning every Train Tracks solution relies on.
- Constraint satisfaction problem (Wikipedia): The general framework behind clue-based puzzles.