Fasteners measured using the current AF (‘across flats’) imperial system relate directly to the spanner size. The measurement is taken between the two parallel sides of the head of the fastener. For example, a ¼” fastener fits a spanner with a ¼” head.
Metric fasteners often use a different size system to metric spanners and it can be confusing. The fastener size system relates to the size of their thread rather than the size of their heads. Some of the most common sizes are M6, M8, M10 and M12. ‘M’ stands for ‘metric’ and the number is the width of the threaded section of the fastener, in millimetres.