How to measure a bolt? I've been asked this many times over the years. Below I put some information on this topic. Also more information and photos can be found on the Toronto Cycles website. If you are ordering bolts please make sure you are measuring properly.
Bolt size is measured from the end of the threads to the bottom of the bolt head. The bolt head diameter makes no difference in general measurements. When threads are cut or rolled the outside diameter will be reduced a bit. So a 5mm bolt will have a thread diameter measurement of something like 4.9mm.
The socket the bolt uses does not determine the bolt size! This is really important and a common mistake made. You measure the diameter of the shaft to come up with the value. For example a M5x10 bolt has a 5mm shaft diameter and is 10mm long from the bottom of the head to the end of the fastener. If a bolt or screw uses a hex socket or a screwdriver then there is the standard to measure. Don't use the allen key for measuring.
Measuring Countersunk Bolts. When measuring a countersunk bolt it is always measured by the TOTAL bolt length. Items like Thomson seat post bolts are also measured like this because the bottom of the head has a chamber.