A gauge number on its own is not a thickness. It is a row in a table, and there are several tables. That is why a gauge converter is not one formula. It is a small lookup tool with one real formula inside it, for wire, and tables for everything else.
Wire is the part with a formula. American Wire Gauge follows a fixed rule. The diameter in millimetres is 0.127 times 92 raised to the power of (36 minus AWG) divided by 39. Put 12 in for AWG and you get about 2.05 mm. Put 14 in and you get about 1.63 mm. Put 16 in and you get about 1.29 mm. Put 18 in and you get about 1.02 mm. Each step up in AWG cuts the diameter by a fixed ratio, close to 0.89, so the sizes shrink in even steps even though the numbers look uneven.
In JavaScript that is one line once you have the input:
function awgToMm(awg) {
return 0.127 * Math.pow(92, (36 - awg) / 39);
}
Round the result to two decimal places for display. More digits look precise but the wire itself is made to a tolerance, so the extra digits mean nothing on a real coil. A check with calipers on a 12 AWG copper wire should read near 2.05 mm. If it reads far off that, the wire is probably labelled to a different standard, or the label is wrong.
Sheet metal has no formula like that. The Manufacturers Standard Gauge is a table that mills agreed on, not a curve you can calculate. In mild steel, 16 gauge is about 1.5 mm, 18 gauge is about 1.2 mm, and 20 gauge is about 0.9 mm. The metal matters as well. Sixteen gauge copper is 1.651 mm while 16 gauge brass is 1.291 mm, so a converter needs a table per metal, not one table for all sheet. The sheet metal gauge chart guide lists the common metals side by side, which is the table to copy from when you build the lookup.
A plain object holds that table well enough for a small tool:
const sheetMm = {
mildSteel: { 16: 1.5, 18: 1.2, 20: 0.9 },
copper: { 16: 1.651 },
brass: { 16: 1.291 }
};
Needles are a third table again. A medical needle marked 18 gauge has an outside diameter of about 1.27 mm. A 21 gauge needle is about 0.82 mm across, and a 22 gauge needle is about 0.72 mm. Those sizes are fixed by an international standard, so a lookup table is the right shape here too. There is no formula to derive them from.
The structure that falls out of this is simple. Ask the user for the system first: sheet, wire, or needle. Then ask for the metal where it changes the answer. Then look the number up, or run the AWG formula if the system is wire. If the gauge is not in the table, say so plainly instead of guessing a nearby row. A converter that admits it does not know a size is more useful than one that invents one.
One more detail that trips people up in code: the numbers run backwards in all three systems. A higher gauge number means a thinner piece. If your UI sorts the table by gauge number, the millimetres will run the other way, and that looks like a bug to a first time user even though it is correct. A short note next to the result saves that confusion. The full tables on gaugetomillimeters.com show sheet, wire, and needle sizes in one place, which is handy when you are checking your own lookup values against a second source.
Top comments (0)