To know bolt size, you need a few things:
- Major diameter, e.g. on top of the threads.
- Minor diameter, e.g. bottom of threads.
- Thread pitch
- Thread form.
(By Jeremy Riley - Own work, CC BY-SA 3.0)
The two first one is relatively easy to measure - at least the first one. And it will give an indication, but it's not enough to know what threads you have.
To measure pitch, the easy way is to get a thread gauge, which easily let's you find the pitch.
For metric, the pitch is the distance in millimeters between threads. For imperial, it's specified as number of threads per inch. To measure without a thread gauge, measure a distance, and count the threads across that distance.
The thread form we can normally ignore, but there's a few differences worth knowing. Metric always has 60° thread angle. UN threads has 60°. British Whitworth has 55°. Bot UNC and Whitworth are imperial threads measured in inches, and the only difference is the thread angle. You can normally mix Whitworth and UNC, at some reduction in strength.
So - to figure out what bolt you have:
- Figure out the outer diameter
- Figure out the number of threads per inch, or the pitch. A thread gauge will tell you this with certainty in seconds. Without one, this may be difficult for small bolts.