The arithmetic, worked out loud
Gauge is not a formality. It is the exchange rate between the numbers in a pattern and the object on your needles, and every other instruction in the pattern is denominated in it. The conversion is one multiplication: stitches per inch times width in inches equals cast-on count. A pattern that says cast on 200 stitches at 5 stitches per inch is describing a piece 40 inches wide, whether or not it says so anywhere on the page.
Now knit that pattern at 5.5 stitches per inch, which is what a slightly tighter hand gets on the same needle. The same 200 stitches now measure 200 divided by 5.5, which is 36.4 inches. You have lost three and a half inches of chest circumference, and there is no point later in the pattern where that comes back. Going the other way at 4.5 stitches per inch gives 44.4 inches, and the sweater fits somebody else.
The half stitch is the number to remember. Half a stitch per inch of error, over a 40 inch garment, is exactly twenty stitches. On most adult sweater patterns twenty stitches is more than one full size step, sometimes two. This is why a difference you can barely see on a four inch swatch is a difference you cannot possibly miss on a finished garment, and it is why the swatch has to be measured rather than eyeballed.
Measuring a swatch so the number is real
Knit it larger than the measuring window. A four inch gauge needs at least a six inch swatch, because the outer stitches at every edge are distorted by the selvedge and by having nothing pulling on them from outside. Measure in the middle, away from the cast-on and bind-off edges as well as the sides.
Block it the way the finished piece will be blocked. This is the single most common reason a gauge swatch lies. Many yarns change measurably when they are wet, and superwash wool, cotton and linen can change a lot, sometimes relaxing enough to shift the gauge by a full stitch per inch. If the sweater will be washed and laid flat, wash the swatch and lay it flat. If it will be steamed, steam the swatch. A swatch measured straight off the needles is a measurement of a different fabric from the one you are going to own.
Count over more than four inches if you can, then divide. Counting 22 stitches over four inches and counting 44 over eight give the same figure, but the second has half the counting error, and counting error is what makes a swatch disagree with itself between Tuesday and Thursday. Enter whatever distance you actually measured over in the field at the top of this page rather than converting it in your head.
Rounding to the stitch repeat
The exact stitch count that hits the target width is rarely a number the pattern can use. A pattern worked over a 12 stitch cable repeat with 4 selvedge stitches needs a total of the form 12n plus 4, and no other number will work. Set the repeat and the edge stitches at the top and the adjusted count comes back rounded to a legal total, with the width you will actually finish at shown next to it.
When the rounding pushes you a full repeat away from the target, the choice is between running slightly wide and running slightly narrow, and the answer depends on the garment. Ease is easier to live with than tightness in a sweater body, so round up. A hat worked in the round has negative ease by design and needs to grip, so round down. A blanket does not care.
The row gauge trap
Stitch gauge and row gauge are separate measurements and they do not fail together. Changing needle size moves both, but not by the same proportion, so it is entirely normal to land the stitch gauge exactly and be eight percent out on rows. Nothing is wrong with your knitting when that happens.
What it means in practice is that instructions phrased in inches are safe and instructions phrased in rows are not. Work to length wherever the pattern gives you a length. Where it gives you only a row count, or where shaping has to be spread across a specific number of rows, convert with the row section above. Armhole depth, sleeve length and body length are the usual casualties, and a sweater with a correct chest and a two inch deep error in the armhole is a sweater that never sits right.
Once the counts are converted, the shaping still has to be placed. Spreading increases or decreases over a different number of rows than the pattern assumed is handled on the increase and decrease spacing calculator, and converting the finished dimensions of a whole piece from scratch is on the size planner.
Questions people ask
Do I have to change needle size or can I just change the stitch count?
It depends on what is wrong. If your gauge is close and only the size is off, changing the cast-on count is a legitimate fix and this page gives you the number. If your gauge is far off, changing the count fixes the width and leaves you with the wrong fabric: too tight to drape or too loose to hold its shape, and a yardage figure that no longer matches what you bought. As a rough dividing line, under about five percent of gauge error is comfortably fixed by recounting, and more than ten percent is a signal to change needles and swatch again. Between those, judge the swatch by hand rather than by the number.
My gauge changed after blocking. Which figure do I use?
The blocked one, always, because the finished garment will be blocked. This is the most common reason a careful swatch still produces the wrong sweater. Superwash wools frequently relax and grow when wet, cotton and linen can move substantially in either direction, and some yarns bloom and fill in, tightening the apparent gauge. Wash and dry the swatch by exactly the method you intend to use on the garment, let it settle, and measure then. If you are not sure how you will wash the finished piece, decide that before you swatch rather than afterwards.
Why does my row gauge never match when my stitch gauge does?
Because they are governed by different things. Stitch width is dominated by needle diameter, which is why a needle change moves it predictably. Row height is dominated by how much yarn you pull through and how you tension the working yarn, which is a property of your hands more than your needles, and it also shifts with fibre and with blocking. Many knitters run consistently long or consistently short on rows across every project. Once you know your own tendency you can predict it, but you cannot generally fix it by needle size without wrecking the stitch gauge. Work to measured length instead.
Does this work for crochet?
Yes, with a vocabulary substitution. Stitches per four inches and rows per four inches behave identically in crochet, the multiplication is the same, and the conversion of a pattern to your own gauge is the same operation. Two differences are worth flagging. Crochet gauge is more sensitive to how the hook is held and how tightly the loop is pulled up, so swatches vary more between sittings, and many crochet patterns give gauge over a pattern repeat rather than a plain fabric, in which case measure over the same repeat and enter the distance you measured. Hook sizing itself is on the needle and hook converter.
How much error is acceptable in a finished garment?
For a fitted sweater, aim to land within about an inch of the intended chest circumference, which on a 40 inch garment is around two and a half percent. That is roughly a tenth of a stitch per inch of gauge error, which is why gauge is fussed over. For an oversized or drapey garment the tolerance is wider, perhaps two inches, because the ease absorbs it. For a hat or a sock, where the fabric has to grip, half an inch is already noticeable. For a blanket, nobody has ever measured one. Decide which of these you are making before deciding how hard to chase the swatch.