You need to cast on 300 stitches but either run out at stitch #299, or make it to 300 but have enough yardage left over to knit a small hat. We've all been there. 

That's why we started using this long-tail cast-on calculation method decades ago and it's right every time. That said, you need to be certain that your yarn is snug on the needle, but neither too tight or too loose. It won't work as well if you pull too tight, or let your yarn get too loose and sloppy as you cast on.  

You can simply plug in your numbers into the equation at the bottom of this article.  But to understand how this works, read on.

This method calculates the circumference of the needle (the length needed to wrap the yarn around the needle once), then multiplies that by the number of stitches needed.

Say you need to cast on 20 stitches on a US 6 needle.  The US 6 needle is a size 4mm.  Calculate the needle circumference by multiplying the size (aka the radius) by 3.14 (Pi).   

    4mm x 3.14 = 12.6mm  That's the circumference of the needle or the length of one wrap of yarn around the needle.

If you need 20 stitches on a 4mm needle, and you know the circumference is 12.6mm (calculated above), then you know that you need 20 x 12.6mm or 251mm.

If you use the metric system, you only need to add another 10cm or so to ensure that you have a little left over to weave in.

If you use the imperial system, you'll need to convert that 251mm to inches. 

   1mm = 0.039 "  

   251mm x 0.039" = 9.8"

The metric to imperial conversion multiplied by Pi can be simplified to 2.54 * 3.14 = 7.98, rounded to 8

Thus for an US6 or 4mm needle:

   20 stitches x 4mm ÷ 8  = 10” for the tail + 4” extra to weave in = 14” tail

  

Try it yourself!

Metric

___ stitches   x   ___mm x 3.14  =   ___mm  minimum  + 10cm (not mm)  for tail

 

Imperial

___ stitches   x   ___mm ÷ 8 =   ___”  minimum  + 4” =  _____”  total needed for tail

 

BTW, we don't take credit for coming up with this.  This formula has been floating around for decades.