Calculation method
The formulas, stitch conventions, rounding rules, unit conversions and practical limits behind all four Knitkind calculators.
Gauge and rectangular counts
Horizontal density is counted stitches ÷ measured width; vertical density is counted rows ÷ measured height. Multiply each by the desired size. Round to the nearest whole count, with a minimum of one; halfway values round up. Recalculate actual size by dividing the rounded count by density. Counts may be fractional when measuring a swatch, but output counts are whole.
Comparing with a pattern
Both measured densities are scaled to the entered pattern reference size. Percentage difference is (measured density ÷ pattern density − 1) × 100. The preview of following pattern counts uses desired size × pattern density ÷ measured density, before integer rounding. This comparison does not rewrite a fitted garment.
Evenly spaced increases and decreases
Protect the entered edge count at both ends. For an increase, one kfb consumes one original stitch and produces two. For a decrease, one k2tog consumes two original stitches and produces one. Split all remaining ordinary stitches into operations + 1 gaps by cumulative nearest-integer rounding. The resulting gaps differ by at most one stitch and conserve both the original and final counts.
Shaping limits and reading order
The plan is read left to right in the direction the row is worked, including on a wrong-side visual orientation. It represents a plain knit row, not a chart with right-side/wrong-side alternation. At most 500 operations and 10,000 starting or target stitches are allowed. An increase cannot use the same original stitch twice and a decrease cannot reuse a pair.
Whole pattern multiples
Cast-on count = repeat count × repeat size + 2 × edge stitches. At least one full repeat is required. Choose the whole repeat count whose total is nearest to width × measured horizontal density; on a tie choose the larger. Report the achieved width and signed difference. No row-repeat or motif-centering constraints are included.
Yarn from a weighed swatch
Base grams = project rectangular area ÷ whole swatch area × swatch grams. Add base grams × allowance percentage ÷ 100. Divide the total by grams per ball and round up to whole balls. The swatch is a reference and is not added separately. Allowance is user-defined from 0 to 200%. This model assumes a uniform fabric, yarn and tension.
Exact units and display precision
One inch is exactly 2.54 cm. All length fields convert together when units change; counts and grams stay the same. Calculations use JavaScript floating-point numbers; displayed results use up to four decimals and converted input text up to ten. CSV keeps the underlying result precision. Very small display or conversion differences can occur.
Input and scope limits
All dimensions and weights must be positive. Dimensions are limited to 100,000 selected units, swatch counts and repeat sizes to 10,000, edge stitches to 5,000 per side, and swatch/ball weights to 100,000 g. Count outputs above 1,000,000 and yarn outputs above 1,000,000,000 g are rejected. A positive target that rounds below one stitch or row uses one. The yarn model is for rectangles, not shaped garments.