Slitherlink solver

Type the numbers of your slitherlink and the solver draws the one closed loop that fits them, or shows the logic one step at a time. Grids up to 30 by 30.

Tap a cell and type its number, or tap again to cycle 0, 1, 2, 3 and blank. Keyboard: arrow keys move, 0 to 3 type, Backspace clears.

Solver

Paste or copy the puzzle as text

This slitherlink solver draws the loop for the puzzle you enter. Set the width and height, type each number where it appears, and press Solve to see the finished loop. Press Next step to reveal it one deduction at a time instead, with the reason for each line and each cross. The solver also tells you whether your numbers allow exactly one loop.

The rules

Connect the dots with horizontal and vertical lines to make one single closed loop. The loop never crosses or touches itself and has no loose ends. A number in a cell says how many of that cell's four sides are part of the loop; a cell without a number can have any count. Slitherlink is also known as fences or loop the loop.

How to enter a puzzle

Choose the size by counting cells, not dots: a grid with 8 dots across is 7 cells wide. Tap a cell and type 0, 1, 2 or 3, or tap a selected cell again to cycle through the numbers. You can also paste the grid as text, one line per row with a dot for each empty cell.

How the solver works

Every edge between two dots is either part of the loop, empty, or still unknown. The solver applies four rules over and over: a number already met means its other sides are empty; a number that needs all its remaining sides gets them; at each dot exactly zero or two lines meet, so a line that arrives at a dot with one way out must continue there; and a line that would close a small loop while other lines or unmet numbers remain outside must stay empty. When those rules stall, it tries one edge each way and keeps the result if the other choice leads straight to a contradiction. On larger grids it combines this with a search that follows the loose end of the line, and it keeps searching after the first loop to make sure there is no second one. Every loop it shows has been walked from start to end to check it is one closed loop that meets every number.

Worked example

A 0 is the best place to start: all four of its sides are empty, so mark them with crosses. A 3 next to a 0 then has its side against the 0 empty, so its other three sides are all drawn. In a corner, a 3 has two sides on the edge of the grid; both are drawn, because the line at the corner dot has nowhere else to go. These three patterns open most puzzles; Next step shows deductions like these one at a time, each with its reason.

Solving tips

  • Cross out the sides of every 0 first.
  • Two 3s side by side: the side between them and the two outer sides parallel to it are all lines.
  • A 1 in a corner: its two outside edges are empty, since a line there would have to turn into the corner and use both.
  • Count the loose ends: each must continue, so a dot with one line and one free edge forces that edge.

Other pencil puzzles with simple rules and deep logic: Flow Free joins pairs of dots with paths that fill the grid, and star battle places stars so that no two touch.

To play, open slitherlink online: new 5x5 to 10x10 loops at three levels and a daily grid.

Solver tested . Found a problem? Tell us.

Questions

Can a slitherlink have more than one solution?

A well-made one has exactly one loop. If you leave out a number or type one in the wrong cell, several loops may fit; the solver then shows two of them and marks the edges where they differ in yellow.

What does a 0 mean in slitherlink?

None of the four sides of that cell is part of the loop. It is the strongest clue in the puzzle and usually the place to start.

How large a slitherlink can it solve?

Grids up to 30 by 30 can be entered. Example puzzles of 15 by 15 solve in about a second or two; the solver runs in the background, so the page stays responsive and you can cancel a long search.

Why does the solver stop explaining before the loop is finished?

The explained steps use rules a person can follow plus one-step assumptions. Some hard puzzles need longer chains of reasoning; there the steps stop and the remaining edges come from the solver's search, which you see with Solve.

Can the loop touch itself at a corner?

No. At every dot either no line passes or exactly two lines meet, so the loop can never branch, cross or touch itself.