A threaded fastener's size includes information about the major external diameter followed by the number of threads.
For standard fasteners, sizes less than 1/4" are assigned values from #0 to #16, and at 1/4" and larger, sizes are given as fractions of an inch. A typical fastener size may be #10-32, or 1/4"-20. The #10-32 is the smaller fastener, with 32 threads per inch; the 1/4"-20 has a larger diameter, but fewer threads per inch than the #10-32.
For metric fasteners, the diameter is followed by the thread pitch, in millimeters per thread. For example, a M3-0.5 indicates a 3 millimeter diameter with 0.5 millimeters per thread pitch.