About this tool
This calculator gives the Allen (hex) key size for standard socket screws: socket head cap screws, button heads, flat (countersunk) heads, and set screws, in metric sizes from M1.6 to M48 and inch sizes from #0 to 1-3/4". It also works backwards from a key you already have, and when you only own the other measurement system it shows which keys are a close fit, which are loose, and which are too large.
How to use
- Choose Screw → key size to start from a screw, or Key → screw sizes to start from a key you have.
- For a screw, pick Metric or Inch, then the head type — socket head cap, button head, flat head, or set screw — and the thread size, such as M6 or 1/4".
- Read the key size beside the inputs, plus the other screws that use the same key.
- If you only own the other system, read the list of keys to try. Prefer a close fit; never use a key marked too large, and avoid loose keys on tight screws.
- Use the chart below to scan every size at once, or select a screw size to open its full result.
How the key size is set
A socket screw’s key size is fixed by its standard, not calculated from the thread diameter. Metric cap screws follow ISO 4762, button heads ISO 7380, flat heads ISO 10642, and set screws ISO 4026–4029; inch socket screws follow ASME B18.3. This tool stores the key size from those tables for each size and head style, so every answer is a lookup. For example, an M6 cap screw takes a 5 mm key and a 1/4" cap screw takes a 3/16" key.
Why the head style changes the key
Button and flat heads are lower than a cap screw head, so they use a smaller socket and a smaller key; set screws, which have no head at all, are smaller again. An M6 cap screw takes 5 mm, an M6 button or flat head takes 4 mm, and an M6 set screw takes 3 mm. In inch sizes, a 1/4" cap screw takes 3/16", a 1/4" button or flat head takes 5/32", and a 1/4" set screw takes 1/8". This is why one key can fit several different screws — the result lists them.
Using a metric key on an inch screw, or the reverse
Metric and inch keys were never designed to match, but a few pairs are within 0.05 mm of each other: 5/32" and 4 mm, 5/64" and 2 mm, and 3/4" and 19 mm. The tool marks these as a close fit — usable, but check that the key goes fully into the socket. A key that is larger than the socket will not go in. A key that is smaller, such as 3/16" (4.76 mm) in a 5 mm socket or 5/16" (7.94 mm) in an 8 mm socket, turns with play and can round out the socket under load. The fit ratings compare nominal sizes; real keys and sockets have small manufacturing tolerances.
Finding the screws a key fits
Switch to Key → screw sizes and pick the key you have. The tool lists every listed screw that uses it, grouped by head style. A 5 mm key, for example, fits an M6 cap screw, an M8 button or flat head, and an M10 set screw. It also shows how the key fits the nearest sockets in the other system, so you can tell whether a 5 mm key will turn a 3/16" socket (it will not — it is too large).
Avoiding stripped sockets
Push the key fully into the socket before turning, and keep it square to the screw. Use the short arm for breaking a tight screw loose and the long arm for reach and speed. Ball-end keys reach screws at an angle but contact less of the socket, so use a straight end for the final tightening or for a stuck screw. Worn keys with rounded corners slip more easily; replace them rather than forcing them.
Privacy
The sizes you select are processed in your browser. This tool does not send them to a server or store them after you close or reload the page.
Continue this workflow
Use the adjacent tool when the next step calls for a different input, output, or method.
Assumptions and limitations
- Covers standard hexagon socket screws only: cap screws, button heads, flat (countersunk) heads, and set screws, in the sizes listed in the chart. Low-head cap screws, shoulder screws, and other special screws can use a different key.
- Sizes come from current ISO and ASME B18.3 tables as published in the Unbrako engineering guide. Hardware made to other national standards or by other manufacturers may differ.
- Metric-to-inch fit ratings compare nominal sizes with a 0.05 mm close-fit band. They are a guide, not a guarantee — always confirm the key seats fully before applying torque.
- Torx (hexalobular), Pozidriv, Phillips, square, and tamper-resistant drives are not covered.
- This is a reference chart, not engineering advice. It does not give tightening torques or screw lengths.
Sources and standards
These authoritative references were used to verify the method and guidance on this page.
- UNBRAKO Engineering Guide — Inch & Metric socket screw products — Unbrako (copy hosted by the University of Arizona)
- B18.3 — Socket Cap, Shoulder, Set Screws, and Hex Keys (Inch Series) — ASME
- ISO 4762:2004 — Hexagon socket head cap screws — International Organization for Standardization
- Hex key — Wikipedia
Frequently asked questions
What size Allen key do I need for an M6 screw?
A 5 mm key for an M6 socket head cap screw. An M6 button head or flat head takes a 4 mm key, and an M6 set screw takes a 3 mm key.
What size Allen key fits a 1/4" socket head cap screw?
A 3/16" key. A 1/4" button or flat head takes 5/32", and a 1/4" set screw takes 1/8".
Can I use a metric Allen key on an inch screw?
Only when the sizes are within about 0.05 mm, such as a 4 mm key in a 5/32" socket or a 2 mm key in a 5/64" socket. Otherwise the key is either too large to enter or loose enough to round out the socket. Use the correct key for tight or high-torque screws.
Is a 5/32" Allen key the same as 4 mm?
Nearly. 5/32" is 3.97 mm, about 0.03 mm smaller than 4 mm, so each usually fits the other’s socket. Check that the key seats fully before applying much torque.
Why does my button head screw need a smaller key than a cap screw?
Button and flat heads are lower, so their sockets are shallower and smaller. For the same thread size they use the next smaller key — an M8 cap screw takes 6 mm, but an M8 button head takes 5 mm.
Are Allen keys and hex keys the same thing?
Yes. Allen key is a common name for a hexagon (hex) key, the L-shaped tool that drives screws with a hexagonal socket.