A sock is fundamentally a tube, and the heel and toe are where that tube has to turn a corner around the foot without a seam. Two families of construction solve this, short-row shaping and afterthought shaping, and they split the sock's stitch count differently before any heel-specific math happens.

Splitting stitches between heel and instep

Both methods start by dividing the total cast-on stitch count roughly in half: one half becomes the heel flap or heel turn, the other half stays as the instep, which continues in pattern across the top of the foot. An even total makes this split clean. An odd total (common when a stitch pattern forces a specific multiple) usually gives the heel one extra stitch, since the sole takes more wear and slightly more ease there is rarely noticeable.

Short-row heels

A short-row heel works the heel stitches back and forth in progressively shorter rows, wrapping a stitch (or using a similar short-row technique) at each turn to avoid holes, then working back out the same way to unwrap and rebuild width. The math tracks how many stitches remain unworked at the center of the heel cup, typically leaving roughly a third of the heel stitches at the deepest point before reversing direction. This method is worked as you go, with no live stitches left dangling, which is why many patterns default to it for a one-pass construction.

Afterthought heels and toes

An afterthought heel or toe is added after the main tube is complete. The knitter runs a contrasting waste-yarn line (or otherwise marks) a round where the heel or toe will go, keeps knitting the tube straight through that section, then later removes the waste yarn to expose live stitches above and below the gap and shapes the heel or toe as a small separate piece, usually with a straightforward round-toe decrease pattern. The stitch math for the shaping itself is simpler, an even decrease spread across the exposed stitches, but the technique requires picking up live stitches accurately along the gap edges, which is the trade-off for deferring the shaping.

Toe shaping

Most toe shaping, whether afterthought or worked in-line at the end of the foot, follows a round decrease pattern: reduce stitches at four points each round (two per side) at a regular interval until a small number of stitches remain, then graft or cinch closed. The decrease interval scales with total stitch count the same way sleeve cap or crown shaping does elsewhere, using an evenly-spaced distribution so the decreases don't cluster.

Neither method is mathematically superior. Short-row heels fit snugly and reinforce naturally from the back-and-forth rows. Afterthought construction makes it easy to replace a worn heel later without reknitting the whole sock. The stitch math adapts to whichever the pattern or the knitter prefers.