Granny Square Color Layout Generator
Tell it the size of the grid and what colours you have, and it works out how many squares of each colour the blanket needs and where each one goes. It can keep matching squares from touching, it reports how many touching pairs are left rather than scoring the result, and every layout carries a seed so you can get the same one back tomorrow.
How the squares get divided between colours
The grid decides the total before any colour does. Eight rows of six is forty-eight squares, and no choice of palette changes that. What the three methods change is only how those forty-eight are shared out.
Equal splits them as evenly as the grid allows. Forty-eight between four colours is twelve each. Fifty between four is not, so three colours get thirteen and one gets eleven — the remainder has to land somewhere, and the generator puts it on the earlier colours rather than pretending the split came out level.
By share takes the proportions you set. They do not have to add up to a hundred: 3, 2 and 1 works exactly as well as 50, 33 and 17, because what matters is the ratio between them.
Exact counts is for when the squares already exist. You have made what you have made, and the question is where to put them rather than how many to make.
Why a percentage rarely lands on a whole number of squares
Ask for forty per cent of forty-eight squares and the arithmetic gives 19.2. A blanket cannot hold two tenths of a granny square, so something has to give.
The generator rounds every colour down first, which leaves it short, then hands the spare squares to the colours that were closest to the next whole number. For a 40 / 30 / 20 / 10 split of forty-eight the exact shares are 19.2, 14.4, 9.6 and 4.8. Rounding down gives 19, 14, 9 and 4, which is forty-six — two short. The two nearest to rounding up were 4.8 and 9.6, so those two colours get the spare squares, and the final counts are 19, 14, 10 and 5.
Notice what that does. The colour you asked for ten per cent of ends up with five squares out of forty-eight, which is closer to eleven per cent, while the thirty per cent colour lands just under twenty-nine. That is not an error to be corrected. It is what happens when a proportion meets a small whole number, and the generator shows you the counts it actually used rather than the percentages you asked for, because the counts are what you will crochet.
Keeping the same colour from touching itself
Left alone, any placement will sometimes drop two squares of the same colour next to each other. Whether that matters is a matter of taste, so it is a setting rather than a default rule.
When avoidance is switched on, the generator fills the grid square by square, and at each position it first works out which colours would not sit against their own kind. Among those it places whichever colour has the most squares still waiting. That ordering is the part that does the work: leaving the scarcest colour until last is precisely what strands it, because by the time only one colour remains it has no choice about where it goes.
A single pass through the grid still occasionally paints itself into a corner near the end, so a second pass looks at any square that ended up touching its own colour and swaps it with one elsewhere that fixes the problem. Swapping two squares cannot change how many of each colour exist, which is why this is safe to do — the split you asked for cannot drift while the layout is being tidied.
Diagonal contact is left alone. On a grid, corners meet constantly, and a rule against it would reject almost every arrangement.
When no arrangement can exist
Some requests cannot be met, and no amount of reshuffling will change that.
Picture a chessboard. If you take only the dark squares, no two of them ever share a side — and on a board of any size, the dark squares are half of it, rounded up. That is the ceiling. On a four-by-four grid of sixteen squares, at most eight can be placed without any two touching.
So if you ask for nine squares of one colour on a four-by-four grid and insist that none of them touch, there is no arrangement that satisfies you. The ninth square has nowhere left to go. The generator works this out from the counts before it starts placing, and tells you plainly, rather than shuffling in the hope of finding an arrangement that cannot exist.
It still gives you a layout. It just places the impossible squares as well as it can and reports how many touching pairs are left, so you can decide whether to change the grid, change the counts, or accept it.
Reading the layout without relying on colour
Every square in the generated grid carries the letter of its colour, and every colour has its own fill pattern as well as its own shade. The key lists the letter, the name you gave it, and the number of squares.
This is deliberate. Printed in black and white, viewed on a phone in sunlight, or read by someone who does not distinguish red from green, a grid of coloured tiles alone tells you nothing. A grid of lettered tiles still works. It also makes the layout far easier to follow while you are actually joining squares, because you can read a row as “A, C, B, D” instead of holding four shades in your head.
The text version below the grid gives the same layout row by row, which is what you want next to you on the sofa, and it copies to the clipboard in one click.
Getting the same layout twice with a seed
Every layout is produced from a seed — a number you can see and change. The same seed with the same grid, palette and settings always produces the same layout, on any device, today or next month.
That matters more than it might sound. Blankets take weeks. If you plan a layout, close the tab, and come back after finishing the first fifteen squares, a generator that shuffled randomly would give you a different arrangement and no way back to the one you started. Writing down the seed is enough to recover it exactly.
It is also how you shop around. Press “try another seed” a few times, note the number of the one you liked, and you can return to it.
Your palette is kept in this browser's local storage as well, so the colour names and swatches are still there when you come back. Clearing your browsing data for this site removes them.
Planning from the squares you have already made
Plenty of granny square blankets start as a stash project: the squares come first, the layout question arrives later. Exact-count mode is for that.
Count what you have of each colour, type the counts in, and set the grid to match. The one rule is that the counts have to add up to the grid — forty-eight squares will not fill a seven-by-seven, and the generator says so rather than inventing one or dropping one. If they do not add up, either the grid needs to change or you need another square.
It is worth checking the total both ways round. Forty-eight squares fit a six-by-eight, an eight-by-six, a four-by-twelve, a three-by-sixteen, a two-by-twenty-four or a one-by-forty-eight, and those are very different blankets. The granny square calculator works the other way, from a finished blanket size to the number of squares you need, if you have not settled the grid yet.
What this generator does not decide
It does not tell you whether your colours work together. There is no balance score, no harmony rating, and no percentage claiming your palette is well distributed, because no such number exists to be calculated. Colour choice is a judgement, and dressing a judgement up as a measurement would only make it harder to argue with.
The one quality figure it does report is a count, not an opinion: how many pairs of same-coloured squares ended up sharing a side, split into side by side and stacked. That is checkable. You can look at the grid and count them yourself.
It also does not know how much yarn you need. Squares differ in size, tension and stitch pattern, so the yarn yardage calculator is the right tool for that, and it is worth doing before you commit to a palette rather than after.
Methodology and limits
- The total comes from the grid. Rows multiplied by columns, and every method divides that same total.
- Shares are converted by largest remainder. Every colour is rounded down, then the leftover squares go to the colours with the largest fractional parts. The counts always sum to the grid.
- Placement is deterministic. Squares are placed in reading order, each time choosing among the colours that would not touch their own kind, preferring whichever has most left to place. The seed only breaks ties between colours with equal numbers remaining.
- The tidy-up pass only swaps. Because it exchanges two existing squares, no colour's count can change while it runs.
- The impossibility test is exact, not a guess. On any grid, the largest number of squares that can be placed with no two sharing a side is half the grid rounded up. If a colour needs more than that, the generator says so before placing anything.
- Touching pairs are counted, not scored. The figure reported is the number of same-coloured squares sharing a side, horizontally and vertically.
- Diagonals are ignored by design, as corner contact on a grid is near-unavoidable.
- Nothing here is a claim about taste. No ideal proportion, no recommended number of colours, and no assertion that avoiding contact produces a better blanket.
- Grids are capped at 20 by 20, which is 400 squares.
Related calculators and guides
- Granny Square Calculator — how many squares a given blanket size needs, and how much yarn.
- How to Join Granny Squares — the joining methods, once the layout is settled.
- Crochet Colorwork Techniques — changing colours cleanly within a piece.
- Yarn Yardage Calculator — working out how much of each colour to buy.