Play Masyu Online

Draw a single closed loop that passes through every circle. The loop must turn at black circles and go straight through white circles. A beautiful Nikoli classic.

Created by Brian Hamilton

Time
0:00
Edges
0
Wins
0
Turn here Go straight

Tap between dots to draw edges — form a single loop

How to play Masyu

Draw a single closed loop that passes through every circle. The loop runs horizontally and vertically between grid points, never diagonally, and never crosses or reuses itself.

  • Black circle: the loop must turn here, and must run straight for at least one cell on both sides of the turn.
  • White circle: the loop must run straight through, and must turn in at least one of the two cells immediately beside it.
  • The loop may pass through cells with no circle in any way it likes, and does not have to visit every cell.
  • Every puzzle has exactly one solution.

Controls: click between two adjacent dots to draw or erase that segment. Check reports the first rule you have broken.

Masyu loop puzzle — draw a single loop through black and white pearls on the grid

Each circle is a rule about three cells, not one

The usual summary — “turn on black, go straight on white” — is half the rule, and the missing half is where all the deductions come from. Both circles say something about the cells either side of them as well.

A legal black circle: the loop turns on it and runs straight for a cell either side The loop arrives horizontally, turns on the black circle, and leaves vertically. On both sides it continues straight for one more cell before it is allowed to turn again. That is what a black circle demands.
Black: the loop turns here, and runs straight for a full cell on both sides before it may turn again.
A legal white circle: the loop runs straight through it and turns immediately beside it The loop passes straight through the white circle without turning, and takes a turn in the very next cell along. A white circle needs at least one such turn on one side or the other.
White: the loop runs straight through, and must turn in the cell immediately before or immediately after.

Read them as three-cell patterns and the puzzle changes character. A black circle is not a corner; it is a corner with two straight arms attached, so it occupies five cells of loop in total. A white circle is not just a straight; it is a straight that is forbidden from being part of a long straight run — there has to be a turn touching it.

A white circle can never sit in a corner

This one is worth knowing because it is free information on every board, and it follows in a single step.

A cell in the corner of the grid has only two edges available: one going along each wall. If the loop visits that cell at all it must use both, and those two edges make a turn. A white circle demands a straight line. So a white circle in a grid corner is impossible, and a corner circle is always black.

Checked across 2,000 generated loops: of the 28,952 positions that could legally carry a white circle, exactly zero were in a grid corner. Of the positions that could carry a black circle, 1,402 were.

The same measurement kills a common assumption in the other direction: black circles are not interior features. 62% of the cells that can hold one sit on an outer row or column, because a wall is a perfectly good place to run a straight arm.

Start at the edges, not the middle

The two rules are most restrictive where the grid runs out of room, which makes the border the productive place to begin.

A black circle on an edge is nearly solved for you. It has to turn, and it needs two cells of straight run in both directions. On the top row it cannot go up, so one arm runs along the row and the other heads down — and both are pinned for two cells.

A white circle on an edge has only one orientation. A white circle on the top row cannot run vertically (there is nothing above it), so the loop must pass through it horizontally. That single fact often fixes several cells at once.

Three white circles in a row can never all be travelled along that row. The middle one would need a turn immediately beside it, and both its neighbours along the line are white circles, which are straight by definition. So at least one of the three must be crossed the other way. Measured over 2,000 generated loops: 2,704 such triples appeared, and in none of them did the loop run straight through all three.

Note what this does not say. Two white circles side by side are perfectly happy either way — in the same sample the loop ran along the line joining them 1,932 times and crossed it 2,995 times. Only the run of three is forbidden.

A worked board

Here is a 6×6 from the generator on this page. The dots sit on intersections, and the loop runs between them.

A six by six Masyu puzzle: the circles alone Black and white circles on a six by six grid of intersections. The loop has to pass through every one of them, turning on the black circles and running straight through the white ones.
The circles alone. Two black, twelve white.
The same Masyu puzzle with its loop drawn in The single closed loop that satisfies every circle. It turns on each black circle and continues straight for at least one cell either side; it runs straight through each white circle and turns immediately before or after it.
The one loop that satisfies them all — turning on both black circles with straight arms either side, and running straight through every white one.

Trace a black circle in the finished loop and count: one cell straight in, the turn, one cell straight out. Then find a white circle and look at its neighbours — there is always a turn touching it. Those two checks are the whole puzzle, applied everywhere at once.

Where solvers get stuck

Treating a black circle as just a corner. The straight arms are the useful half. A black circle rules out its own diagonal neighbours as turning points, which is usually worth more than the turn itself.

Forgetting that a white circle forbids a long straight. Three white circles in a line cannot all be run along that line, so one of them has to be crossed the other way. Spotting which one is often the whole deduction.

Closing a small loop early. The answer is one loop through every circle. A tidy little circuit that satisfies four circles and ignores the rest is not a partial solution — it is a dead end, and the sooner you rule it out the better.

Two things you can check about these puzzles

Every puzzle has exactly one solution, and the harder ones have fewer circles. Each board is generated by drawing a loop first, marking every intersection that could legally carry a circle, and then checking with a solver that those circles pin the loop down to a single answer. Circles are then removed one at a time, and a circle is only removed if the puzzle still has exactly one solution afterwards. Difficulty is how far that thinning is allowed to go.

Average number of circles left after thinning, over 10 generated puzzles per setting. Fewer circles, same single answer, more work for you.
BoardEasyMediumHard
5×510.46.35.5
6×614.49.58.3

The game marks you on the rules, not on its own answer. Winning is checked by testing your loop against the constraints — one closed loop, every circle on it, every black a turn with straight arms, every white a straight with a turn beside it. It does not compare your drawing against a stored solution. Since each puzzle has only one solution that is a distinction without a difference, but it does mean the check is telling you something true rather than something remembered.

Masyu, Mashu and the pearl puzzle

Masyu (ましゅ) means “evil influence”, and the puzzle is also written Mashu. It was first published by Nikoli, where it began life under a name meaning “pearl necklace” — which is why the circles are often called pearls, black and white.

It belongs to the loop family: a single closed circuit drawn on a grid, constrained by local clues. Slitherlink is the best known relative, but its clues count edges around a cell, whereas Masyu's clues dictate the loop's shape at the point it passes through.

More loop puzzles

If you like drawing a single closed circuit under constraints, try these:

Puzzle Solved!

Completed in 3:42.