FIFTY LINETurn G-code
Online generatorOnline calculatorsReference

← All calculators

Hex and square: across flats and across corners

From the across-flats size get the across-corners size and the round bar you need. From a bar diameter get the hex, square or octagon it will make.

Quick answer

Across corners E = S / cos(180°/n): hex E = 1.1547 × S, square E = 1.4142 × S. Example: 3/4″ hex → 0.866″ across corners; 17 mm hex → 19.63 mm, so you need at least a Ø20 mm bar.

Profile
Known
Units

Result

Across corners (circumscribed circle)
—
Minimum round bar
—
nearest standard size
—
Full round from this bar without flat spots — up to
—
Flat width
—

Leave some stock for finishing the flats: a bar exactly the across-corners size leaves sharp corners with nothing to clean up.

Who needs it and why

A 3/4″ hex measures about 0.866″ across the corners. Use a 13/16″ bar and the corners stay round and unfinished; use a 1-1/4″ bar and you waste metal and time. The calculator suggests the nearest bar that works.

  • Choosing stock — which round bar to order for a hex or square on the part.
  • Parts from hex bar — fittings, nuts, adapters: the largest full round you can turn without flat spots.
  • Using what's on the shelf — which wrench size a bar you have will give.
  • Chamfering a hex — nut corners are usually chamfered at a diameter just under the across-flats size; across-corners shows how much comes off.

The formulas

  • across corners E = S / cos(180° / n): hex 1.1547·S, square 1.4142·S, octagon 1.0824·S
  • from a bar Ø D S = D · cos(180° / n)
  • flat width S · tg(180° / n)

The round part of the workpiece, chamfers and faces next to the hex come straight out of Turn G-code — turning, facing and Chamfer/Radius cycles with a 2D simulator.