Gauge Swatch Planner
Knitting / Practical workbench

The formula reference

Every output is calculated from the equations below. Results are evaluated in the order shown.

No account neededWorks in your browserEditable assumptions

Input variables

VariableMeaningUnit
stStitches in swatchstitches
rowsRows in swatchrows
swMeasured swatch widthcm
shMeasured swatch heightcm
wTarget widthcm
hTarget heightcm
repeatStitch repeatstitches

Equations

Unrounded target stitches · stitches

raw = st/sw*w

Stitches rounded to repeat · stitches

cast = ceil(raw/repeat)*repeat

Target rows · rows

rowcount = round(rows/sh*h)

Width at rounded stitch count · cm

actual = cast/(st/sw)

Notation

PI means π. ** means a power, sqrt means square root, and abs gives the absolute value. Trigonometric functions use radians. min and max select the smallest or largest argument.

ceil rounds upward, floor rounds downward, and round rounds to the nearest integer with halves toward positive infinity. roundup(value, step) rounds upward to the next multiple of the step; a zero step leaves the value unchanged.

Assumptions

  1. Measure a washed and dried swatch in the intended stitch pattern.
  2. Repeat rounding changes the achieved width; the calculator shows that effect.
  3. Selvage stitches are not automatically added.
  4. Shaping and ease require a garment pattern beyond a rectangular gauge calculation.

Precision and verification

The tool uses ordinary double-precision numeric arithmetic. Output is displayed to at most four decimal places; measurement precision is usually much lower. Check the worked examples, your project’s specifications, and a real sample before committing material.