Water Sort Solver

Stuck on a level? Upload a screenshot of your water sort or ball sort game (or copy the tubes by hand), press Solve, and follow the shortest solution one move at a time.

1 · Enter your puzzle
or paste one (Ctrl+V) or drop it here. The picture is read on your device and never uploaded.
Or set it up by hand
Colors 7
Tubes 9
Tube size 4

How to use the water sort solver

  1. Start from a screenshot. Upload, paste or drop a screenshot of your level and the tubes are filled in for you (more on that below). To set a level up by hand instead, carry on with the next steps.
  2. 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).
  3. 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.
  4. 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.
  5. 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.

Solve a level from a screenshot

The quickest way in is a picture of your level. Take a screenshot in your game, then press Upload a screenshot, paste it with Ctrl+V, or drop the file onto the panel. The solver finds the tubes, reads every layer of water or every ball from the bottom up, works out whether it is a water sort or a ball sort level and how much each tube holds, and fills in the editor for you. It all happens in your browser: the picture is never uploaded.

A small copy of your screenshot appears with a number under each tube. Those are the numbers the solution uses, so tube 3 to tube 7 means the third and the seventh tube in that picture. Before you press Solve, compare each tube with your screen:

  • Similar colors. Two shades of blue or green can get mixed up. Remove takes layers off the top of a tube; take them off down to the wrong one, then add the right colors back.
  • Empty tubes. An empty tube has no color to read. When its glass is too faint to see, the solver adds two empty tubes at the end; change Tubes if your level has a different number.
  • Hidden colors. Question marks cannot be read. Uncover them in the game first.

If the solver picked the wrong puzzle type, switch between Water sort and Ball sort straight away and the screenshot is read again.

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. Switch to Ball sort and this page works as a ball sort solver, screenshots included.

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?

Upload a screenshot of your level, or 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.

Can I solve a level from a screenshot?

Yes. Upload, paste or drop a screenshot of your game screen. The solver finds the tubes, reads every layer or ball from the bottom up, and works out the tube size and whether it is water sort or ball sort. The picture is read in your browser and never uploaded. Empty tubes have no color to read, so check the number of tubes and fix any color that looks wrong before you press Solve.

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, including your screenshot.