What is the correct socket size for M3 and M4 nuts?

I’m looking to get a drill bit for quickly fastening M3 and M4 nuts. When I look online I see many mentions of the socket size but no mention which size that socket fits. Based on the dimensions of the M3 nut the link below might be the right size but I’m not 100% confident. Can you confirm?

A quick search on McMaster Carr lists them as 5.5 mm for M3 and 7 mm for M4. That’s not necessarily universal so YMMV.


looks like the 5.5 McMaster-Carr will do the job. Thanks!

For reference (you want a driver matching the WAF - width across flats):