How to measure a screw
Diameter, pitch and length, in that order.
Diameter
Measure across the outside of the thread. A reading just under 6 mm is an M6.
Pitch
Hold a pitch gauge blade against the thread. When no light shows between them, read the number on the blade.
Length
Measure cap screws from under the head to the tip. Measure countersunk screws from the top of the head.