Allen Key Size Calculator: Hex Key for Socket, Button and Flat Head Screws
The key follows the head, not just the thread. A 1/4-20 socket head cap screw takes 3/16 in; the same thread with a button or flat head takes 5/32 in, and a 1/4-20 set screw takes 1/8 in. In metric, M6 is 5 mm for a cap screw, 4 mm for button and countersunk heads, and 3 mm for a set screw. Each size below names the table it was read from.
Pick the screw, read the key
Choose inch or metric, the head type and the size. The result updates as you change any field.
If the only key at hand is from the other system
Reverse lookup: what does this key drive?
Allen wrench size chart, inch: four head types on one row
Read across a row and the pattern shows: at every size listed, button and flat heads take a smaller key than the cap screw, and set screws a smaller one still. Coarse and fine threads of the same diameter take the same key (1/4-20 and 1/4-28 both take 3/16 in in a cap screw), because the socket is sized to the head, not the pitch. Where a cell says “not listed”, none of the tables opened for this page gives that size, so it is left blank rather than guessed. Download the full table as CSV (CC BY 4.0) (every row carries its source URLs).
On a phone, scroll the table sideways. The size column stays in place.
| Screw size | Socket head cap screw | Button head | Flat head (82°) | Set screw |
|---|---|---|---|---|
| #0 (0.060 in) | 0.050 0.0500 in · 1.27 mm | 0.035 0.0350 in · 0.889 mm | 0.035 0.0350 in · 0.889 mm | not listed |
| #1 (0.073 in) | 1/16 0.0625 in · 1.588 mm | 0.050 0.0500 in · 1.27 mm | 0.050 0.0500 in · 1.27 mm | not listed |
| #2 (0.086 in) | 5/64 0.0781 in · 1.984 mm | 0.050 0.0500 in · 1.27 mm | 0.050 0.0500 in · 1.27 mm | not listed |
| #3 (0.099 in) | 5/64 0.0781 in · 1.984 mm | 1/16 0.0625 in · 1.588 mm | 1/16 0.0625 in · 1.588 mm | not listed |
| #4 (0.112 in) | 3/32 0.0938 in · 2.381 mm | 1/16 0.0625 in · 1.588 mm | 1/16 0.0625 in · 1.588 mm | 0.050 0.0500 in · 1.27 mm |
| #5 (0.125 in) | 3/32 0.0938 in · 2.381 mm | 5/64 0.0781 in · 1.984 mm | 5/64 0.0781 in · 1.984 mm | not listed |
| #6 (0.138 in) | 7/64 0.1094 in · 2.778 mm | 5/64 0.0781 in · 1.984 mm | 5/64 0.0781 in · 1.984 mm | 1/16 0.0625 in · 1.588 mm |
| #8 (0.164 in) | 9/64 0.1406 in · 3.572 mm | 3/32 0.0938 in · 2.381 mm | 3/32 0.0938 in · 2.381 mm | 5/64 0.0781 in · 1.984 mm |
| #10 (0.190 in) | 5/32 0.1562 in · 3.969 mm | 1/8 0.1250 in · 3.175 mm | 1/8 0.1250 in · 3.175 mm | 3/32 0.0938 in · 2.381 mm |
| 1/4 in | 3/16 0.1875 in · 4.763 mm | 5/32 0.1562 in · 3.969 mm | 5/32 0.1562 in · 3.969 mm | 1/8 0.1250 in · 3.175 mm |
| 5/16 in | 1/4 0.2500 in · 6.35 mm | 3/16 0.1875 in · 4.763 mm | 3/16 0.1875 in · 4.763 mm | 5/32 0.1562 in · 3.969 mm |
| 3/8 in | 5/16 0.3125 in · 7.938 mm | 7/32 0.2188 in · 5.556 mm | 7/32 0.2188 in · 5.556 mm | 3/16 0.1875 in · 4.763 mm |
| 7/16 in | 3/8 0.3750 in · 9.525 mm | not listed | 1/4 0.2500 in · 6.35 mm | not listed |
| 1/2 in | 3/8 0.3750 in · 9.525 mm | 5/16 0.3125 in · 7.938 mm | 5/16 0.3125 in · 7.938 mm | 1/4 0.2500 in · 6.35 mm |
| 5/8 in | 1/2 0.5000 in · 12.7 mm | 3/8 0.3750 in · 9.525 mm | 3/8 0.3750 in · 9.525 mm | 5/16 0.3125 in · 7.938 mm |
| 3/4 in | 5/8 0.6250 in · 15.875 mm | not listed | 1/2 0.5000 in · 12.7 mm | 3/8 0.3750 in · 9.525 mm |
| 7/8 in | 3/4 0.7500 in · 19.05 mm | not listed | 9/16 0.5625 in · 14.288 mm | not listed |
| 1 in | 3/4 0.7500 in · 19.05 mm | not listed | 5/8 0.6250 in · 15.875 mm | not listed |
| 1-1/8 in | not listed | not listed | 3/4 0.7500 in · 19.05 mm | not listed |
| 1-1/4 in | 7/8 0.8750 in · 22.225 mm | not listed | 7/8 0.8750 in · 22.225 mm | not listed |
| 1-3/8 in | not listed | not listed | 7/8 0.8750 in · 22.225 mm | not listed |
| 1-1/2 in | 1 1.0000 in · 25.4 mm | not listed | 1 1.0000 in · 25.4 mm | not listed |
Decimal and millimetre values are the exact conversions of the nominal fraction (1 in = 25.4 mm). The 0.028, 0.035 and 0.050 in keys have no common fraction and are sold by their decimal size.
Hex key size chart, metric
Metric is more regular than inch: from M3 to M16 the button head and the countersunk head take the same key, always smaller than the cap screw's. The socket limits under each key come from the ISO tables themselves. They matter in the next sections, because they decide whether an inch key fits.
| Thread | Cap screw (ISO 4762) | Button head (ISO 7380-1) | Countersunk (ISO 10642) | Set screw |
|---|---|---|---|---|
| M1.6 | 1.5 mm socket 1.52 to 1.58 | not listed | not listed | not listed |
| M2 | 1.5 mm socket 1.52 to 1.58 | not listed | not listed | 0.9 mm |
| M2.5 | 2 mm socket 2.02 to 2.08 | not listed | not listed | 1.3 mm |
| M3 | 2.5 mm socket 2.52 to 2.58 | 2 mm socket 2.02 to 2.08 | 2 mm socket 2.02 to 2.06 | 1.5 mm |
| M4 | 3 mm socket 3.02 to 3.08 | 2.5 mm socket 2.52 to 2.58 | 2.5 mm socket 2.52 to 2.58 | 2 mm |
| M5 | 4 mm socket 4.02 to 4.095 | 3 mm socket 3.02 to 3.08 | 3 mm socket 3.02 to 3.08 | 2.5 mm |
| M6 | 5 mm socket 5.02 to 5.14 | 4 mm socket 4.02 to 4.095 | 4 mm socket 4.02 to 4.095 | 3 mm |
| M8 | 6 mm socket 6.02 to 6.14 | 5 mm socket 5.02 to 5.14 | 5 mm socket 5.02 to 5.14 | 4 mm |
| M10 | 8 mm socket 8.025 to 8.175 | 6 mm socket 6.02 to 6.14 | 6 mm socket 6.02 to 6.14 | 5 mm |
| M12 | 10 mm socket 10.025 to 10.175 | 8 mm socket 8.025 to 8.175 | 8 mm socket 8.025 to 8.175 | 6 mm |
| M14 | 12 mm | not listed | 10 mm socket 10.025 to 10.175 | not listed |
| M16 | 14 mm | 10 mm socket 10.025 to 10.175 | 10 mm socket 10.025 to 10.175 | 8 mm |
| M20 | 17 mm | not listed | 12 mm socket 12.032 to 12.212 | 10 mm |
| M24 | 19 mm | not listed | not listed | not listed |
ISO 10642 prints two maximum socket sizes for each thread. The larger one is used here, so the fit checks below lean toward more slack, not less. ISO 10642 has been revised since 1997 (editions 2019 and 2026); the socket column of the newer editions was not compared for this page.
How deep the key goes: socket depth by head type
A smaller key is one difference between a button head and a cap screw. Depth is the other. ISO gives a minimum key engagement t for each head, and the low heads give the key much less to bite on. On an M6, the cap screw guarantees 3 mm of engagement on a 5 mm hex; the button head guarantees 2.08 mm on a 4 mm hex. Smaller hex, 31% less depth, same hand on the wrench.
| Thread | Cap screw t min | Button head t min | vs cap | Countersunk t min | vs cap |
|---|---|---|---|---|---|
| M3 | 1.3 mm 2.5 mm key | 1.04 mm 2 mm key | -20% | 1.1 mm 2 mm key | -15% |
| M4 | 2 mm 3 mm key | 1.3 mm 2.5 mm key | -35% | 1.5 mm 2.5 mm key | -25% |
| M5 | 2.5 mm 4 mm key | 1.56 mm 3 mm key | -38% | 1.9 mm 3 mm key | -24% |
| M6 | 3 mm 5 mm key | 2.08 mm 4 mm key | -31% | 2.2 mm 4 mm key | -27% |
| M8 | 4 mm 6 mm key | 2.6 mm 5 mm key | -35% | 3 mm 5 mm key | -25% |
| M10 | 5 mm 8 mm key | 3.12 mm 6 mm key | -38% | 3.6 mm 6 mm key | -28% |
| M12 | 6 mm 10 mm key | 4.16 mm 8 mm key | -31% | 4.3 mm 8 mm key | -28% |
| M16 | not in the 2004 preview | 5.2 mm 10 mm key | – | 4.8 mm 10 mm key | – |
In the shop this turns into three habits. Push the key to the bottom of a button head socket before you load it; if it stops short, there is paint, chips or threadlocker in the socket, and a pick costs less than an extractor. Use the short arm of the L for breaking a button head loose, so the long arm does not tempt you past what 2 mm of engagement will carry. And keep a dedicated, unworn key for the M4 to M8 button heads, the range where the engagement is between 1.3 and 2.6 mm.
Using an inch key in a metric socket
Most conversion charts pair keys by nearest size, as if 3/16 in and 5 mm were the same tool. They are not, and the error has a size. The slack between a key and its socket, across the flats, runs between two limits:
slack min = socket smin − key amax · slack max = socket smax − key amin
Socket limits come from ISO 4762. Key limits come from the AFT Fasteners key table, which lists across-flats maximum and minimum for each inch and metric key. If the smallest key is wider than the largest socket, it will not go in. If the least slack of the substitute is larger than the most slack the right key can ever have, the substitute is loose in every case, and loose is how sockets round out.
| Socket | Socket limits (mm) | Slack with the right metric key | Nearest inch key | Slack with the inch key | Verdict |
|---|---|---|---|---|---|
| 1.5 mm M2 cap screw | 1.52 to 1.58 | 0.02 to 0.11 | 1/16 in 1.588 mm | -0.067 to 0.018 (can interfere) | may not enter |
| 2 mm M2.5 cap screw | 2.02 to 2.08 | 0.02 to 0.11 | 5/64 in 1.984 mm | 0.036 to 0.122 | usable in a pinch |
| 2.5 mm M3 cap screw | 2.52 to 2.58 | 0.02 to 0.11 | 3/32 in 2.381 mm | 0.14 to 0.225 | loose |
| 3 mm M4 cap screw | 3.02 to 3.08 | 0.02 to 0.12 | 1/8 in 3.175 mm | none: key 0.057 to 0.155 mm too wide | will not enter |
| 4 mm M5 cap screw | 4.02 to 4.095 | 0.02 to 0.135 | 5/32 in 3.969 mm | 0.053 to 0.166 | usable in a pinch |
| 5 mm M6 cap screw | 5.02 to 5.14 | 0.02 to 0.18 | 3/16 in 4.763 mm | 0.258 to 0.416 | loose |
| 6 mm M8 cap screw | 6.02 to 6.14 | 0.02 to 0.19 | 1/4 in 6.35 mm | none: key 0.159 to 0.33 mm too wide | will not enter |
| 8 mm M10 cap screw | 8.025 to 8.175 | 0.025 to 0.225 | 5/16 in 7.938 mm | 0.088 to 0.276 | usable in a pinch |
| 10 mm M12 cap screw | 10.025 to 10.175 | 0.025 to 0.225 | 3/8 in 9.525 mm | 0.5 to 0.701 | loose |
Three of these are usable in a pinch: 5/64 in for a 2 mm socket, 5/32 in for a 4 mm socket and 5/16 in for an 8 mm socket, because their slack overlaps the right key's range. 3/16 in in a 5 mm socket starts at 0.258 mm of play, already more than the 0.180 mm worst case of a real 5 mm key. A 1/4 in key will not enter a 6 mm socket at all: its smallest size, 6.299 mm, is wider than the largest 6 mm socket, 6.14 mm.
The reverse direction, a metric key in an inch socket, cannot be checked the same way here, because the socket limits of ASME B18.3 are not in any table opened for this page. The calculator gives the nominal difference instead. A 5 mm key is 0.238 mm wider than a 3/16 in key, so it should not enter a 3/16 in socket; do not drive it in.
Four mistakes in published Allen wrench charts, and the correction
These come from charts on the first page of results for this search, read on November 22, 2026. Each correction cites the table it comes from.
“Flat head socket screws use the same key as cap screws of the same thread.” Not in either system. A 1/4-20 flat head takes 5/32 in (ASME B18.3 Table 2A; AFT), not the 3/16 in of the cap screw. An M6 ISO 10642 flat head takes 4 mm, not 5 mm. The flat head takes the same key as the button head, at every size where both are listed (#0 to 5/8 in, M3 to M16).
A 3/8-16 button head listed with a 1/4 in key. The button head table gives a 0.219 in socket, which is 7/32 in (ASME B18.3 Table 3; AFT lists 7/32 in too). A 1/4 in key cannot enter a 7/32 in socket, so the reader who trusts the chart is left with a key that does not fit and no explanation.
A #4 set screw listed with a 1/16 in key. Two other charts give 0.050 in (Albany County Fasteners; Edmund Optics). 1/16 in is the #6 set screw key. Grab a 1/16 in key for a #4 set screw and it will not go in; grab a 0.050 in key for a #6 and it sits 0.0125 in under size.
“5 mm = 3/16 in”, “6 mm = 7/32 in”, “7 mm = 1/4 in” in conversion tables. These are nearest sizes, not equivalents. 3/16 in is 4.763 mm, 7/32 in is 5.556 mm and 1/4 in is 6.350 mm. The table above shows what the 0.238 mm gap between 5 mm and 3/16 in does to the fit. A related error: the key size is not the thread diameter. It is the width across the flats of the socket.
Three worked examples
- 3/8-16 button head, inch. ASME B18.3 Table 3 gives a 0.219 in socket: key 7/32 in = 0.21875 in = 5.556 mm. Nearest metric keys: 6 mm is 0.444 mm wider (will not enter), 5 mm is 0.556 mm narrower, 10.0% of the key, on top of the normal slack. Neither is a substitute.
- M6 countersunk head, ISO 10642. Key 4 mm, socket 4.020 to 4.095 mm, minimum engagement 2.2 mm. The right 4 mm key (3.96 to 4.00 mm) leaves 4.020 − 4.00 = 0.020 to 4.095 − 3.96 = 0.135 mm. A 5/32 in key (3.929 to 3.967 mm) leaves 4.020 − 3.967 = 0.053 to 4.095 − 3.929 = 0.166 mm: usable in a pinch.
- M6 cap screw, ISO 4762. Key 5 mm, socket 5.02 to 5.14 mm. Right key: 0.020 to 0.180 mm of slack. A 3/16 in key (4.724 to 4.763 mm) leaves 5.02 − 4.763 = 0.258 to 5.14 − 4.724 = 0.416 mm: loose in every case.
And the reverse lookup: a 5/32 in key drives a #10 cap screw, a 1/4 in button or flat head and a 5/16 in set screw. One key, four different screws.
Next step for the same screws: the socket head cap screw counterbore chart, the flat head countersink chart, the clearance hole chart and the bolt torque chart.
Questions about Allen key sizes
What size Allen key fits a 1/4-20 screw?
It depends on the head. A 1/4-20 socket head cap screw takes a 3/16 in key, a 1/4-20 button head or flat head takes 5/32 in, and a 1/4-20 set screw takes 1/8 in. The thread pitch does not change the key: 1/4-28 takes the same keys.
What size hex key fits an M6 screw?
An M6 socket head cap screw (ISO 4762) takes a 5 mm key. M6 button head (ISO 7380-1) and M6 countersunk flat head (ISO 10642) screws take 4 mm. An M6 set screw takes 3 mm.
Can I use a 3/16 in key on a 5 mm socket?
It goes in, but it fits loose. With the limits used on this page, a 3/16 in key leaves 0.258 to 0.416 mm of slack in an M6 cap screw socket, while the right 5 mm key leaves 0.020 to 0.180 mm. That extra play is what rounds a socket under torque.
Do flat head socket screws use the same key as cap screws?
No. A 1/4-20 flat head socket cap screw takes 5/32 in, not the 3/16 in of the cap screw, and an M6 ISO 10642 flat head takes 4 mm, not 5 mm. In both systems the flat head takes the same key as the button head of the same thread, at every size where both are listed (#0 to 5/8 in, M3 to M16).
Not on this page yet
- Spline sockets, Torx and low-head cap screws: not covered.
- Inch socket limits (ASME B18.3): the standard is sold, not open, so inch fit checks give the nominal difference only.
- Metric cap screws above M24, and the socket limits and engagement of M14 to M24 cap screws: not in the sources opened for this page.
- Inch set screws #0 to #3 and 7/16 in: the charts opened disagree or do not list them, so they are left out.
Sources
- ISO 4762:2004, Table 1 (public preview), read November 22, 2026.
- ISO 7380-1:2022, Table 1 (public preview), read November 22, 2026.
- ISO 10642:1997, Table 1 (public preview), read November 22, 2026.
- ASME B18.3 Table 3 as reproduced by fasten.it, read November 22, 2026.
- ASME B18.3 Table 2A as reproduced by fasten.it, read November 22, 2026.
- AFT Fasteners, socket cap screw dimensions, read November 22, 2026.
- AFT Fasteners, Allen wrench sizes and dimensions, read November 22, 2026.
- Eugene Fastener, socket screw torque and hex key chart, read November 22, 2026.
- Edmund Optics, Allen wrench size chart, read November 22, 2026.
- Albany County Fasteners, set screw size and torque chart (PDF), read November 22, 2026.
Cite this page
ToolSpecVault Engineering Data Team. (2026, November 22). Allen Key Size Calculator. ToolSpecVault. https://toolspecvault.com/allen-key-hex-key-size-calculator/