Water Sort Solver

Stuck on a level? Copy the tubes from your water sort or ball sort game, press Solve, and follow the shortest solution one move at a time.

1 · Enter your puzzle
Colors 7
Tubes 9
Tube size 4

How to use the water sort solver

  1. Match your game. Choose Water sort or Ball sort, set how many colors and tubes your level has, and the tube size (most games use 4).
  2. Copy the tubes. Pick a color, then tap a tube to add it on top. Build each tube from the bottom up, exactly as on your screen. When a color is complete the picker moves to the next one by itself. Tap Remove and then a tube, or right-click a tube, to take off its top.
  3. Check the counters. Every color must appear exactly as many times as a tube holds. The counter on each color shows how many you have placed, and the line under the tubes tells you what is still missing.
  4. Press Solve. You get the number of moves, the full list, and a picture of the tubes. Use Next and Back (or the arrow keys) to go one move at a time, or Play to watch. The tube to pour from is outlined in yellow, the tube to pour into in green.

Tubes are numbered from left to right. If your game shows two rows, count along the top row first, then the bottom row, and enter them in that order.

How the solver finds the shortest solution

A water sort position is just a list of tubes and the colors inside them. From any position there are only a handful of legal pours, so the puzzle is a huge map of positions linked by moves. The solver explores that map with A* search: it always looks next at the position that seems closest to the goal, counting the moves made so far plus a careful estimate of the moves still needed.

The estimate is the key. For water sort it counts how many separate color bands are on the board; one pour can join at most two bands, so each extra band needs at least one more pour. For ball sort it counts the balls that sit on top of a different color, since every one of them must move at least once. Because these estimates never guess too high, the first complete solution A* finds is guaranteed to be the shortest. It also treats two positions with the same tubes in a different order as one, which keeps the search small: a 12-color puzzle usually takes well under a second.

When there is no solution

Not every position can be solved. A random shuffle is sometimes impossible from the start, and a careless pour, such as filling the last empty tube with a color that has nowhere to go, can turn a solvable level into a dead end. When the solver says No solution, it has checked every possible sequence of moves. Check the colors first, because one swapped layer is the most common mistake. If they are right, undo a few moves in your game and enter that earlier position.

Water sort or ball sort?

The two puzzles look the same but move differently. In water sort, a pour moves the whole top band of one color, as much as fits. In ball sort, you move a single ball at a time. The same tubes can need very different solutions in each mode, so make sure the mode matches your game. Most "color sort", "liquid sort" and "bottle sort" games follow the water rules; "bubble sort" and "sort balls" games follow the ball rules.

Want a puzzle that never gets stuck?

Our own water sort puzzle and ball sort puzzle are built on this same solver: 300 levels each that are proven solvable, three daily puzzles, unlimited undo, and a warning the moment your moves lead into a dead end, so you never need to come back here for them.

Frequently asked questions

How does the water sort solver work?

Enter the tubes exactly as they look in your game, color by color from the bottom up, and press Solve. The solver searches through possible pours, most promising first, until it finds the shortest way to sort every color. Then it lists every move and lets you step through them on a picture of the tubes.

Is the solution the shortest possible?

Almost always. The solver uses A* search with a rule that never overestimates the moves left, so the first solution it finds is the shortest one. For very large puzzles it may run out of room and fall back to a fast search; the result then says it is a good solution rather than the shortest.

Can it solve ball sort puzzles too?

Yes. Switch the mode to Ball sort. Balls move one at a time, while in water sort a whole layer of one color pours at once, so the two modes give different solutions for the same tubes.

Why does it say there is no solution?

Some positions really cannot be solved, for example after a pour that filled the last empty tube with the wrong color. First check that every color is entered correctly. If it is, undo a few moves in your game and enter that earlier position instead.

What about levels with question marks?

The solver needs to know every color. In levels that hide colors behind question marks, play until the colors are uncovered, or use the game's own hint, then enter the position here.

My game has tubes that hold 3, 5 or 6. Does it work?

Yes. Set the tube size to match your game, from 3 to 6. Each color must then appear exactly that many times, and the counter on each color shows how many you still need to place.

Is the water sort solver free?

Yes. It runs in your browser for free, with no download and no account, and nothing you enter leaves your device.