you know that m5, m4 or whatever are just the bolt diameter in mm?
(not trivially easy to measure with a ruler, but do-able, and obviously very easy with a vernier, and a cheap digital vernier is pretty cheap)
There are coarse and fine alternative threads, but normally course is used for most things you'll come across (but not necessarily for motorcycles).
On older bikes, it may be summat different entirely in which case it's more tricky as you have to measure it properly and look up which it might plausibly be from diameter and thread pitch, but anything modern will likely be m5 or whatever coarse thread, so diameter to nearest mm is enough