Some experienced machinists can identify, at a glance, screw gauge, thread type, length, etc. For those of us who do not have much experience, a homemade gauge like this can be helpful to identify the size and thread pitch of both nuts and bolts. It includes nut and bolt sizes commonly used at the workshop: # 6, # 8, # 10, # 12, 1/4, 5/16 and 3/8, in (standard) coarse and fine thread:
Although there are many commercial models, I preferred a homemade version.
You could also make a metric thread detective.