1) Measure the length of the steerer from the shoulder that the bottom race sits on to the top of the threaded part.
2) Measure the length of the head tube from end to end (without any cups inserted).
3) Subtract 2 from 1.
The result is your stack height. However, if your headset had exactly the same stack height as (3) you risk not being able to adjust it perfectly, so in practice you need (3) to be a millimeter or two less than the stack height of your headset, or:
a) you can add a spacer to create room for adjustment, or
b) you can file down your steerer to create the adjustment margin.
1) Measure the length of the steerer from the shoulder that the bottom race sits on to the top of the threaded part.
2) Measure the length of the head tube from end to end (without any cups inserted).
3) Subtract 2 from 1.
The result is your stack height. However, if your headset had exactly the same stack height as (3) you risk not being able to adjust it perfectly, so in practice you need (3) to be a millimeter or two less than the stack height of your headset, or:
a) you can add a spacer to create room for adjustment, or
b) you can file down your steerer to create the adjustment margin.
z) I hope that's all clear!