G-code reference

G12 G-Code: Circular Pocket Milling CW (Haas) / Polar Interpolation (Lathe G12.1)

Circular Pocket Milling CW (Haas) / Polar Interpolation (Lathe G12.1) — On Haas mills, G12 mills a circular pocket clockwise (G13 counter-clockwise) in one line, with optional stepping out and multiple depths. On Fanuc lathes…

By cnccode · Updated
PropertyValue
CodeG12
FunctionCircular Pocket Milling CW (Haas) / Polar Interpolation (Lathe G12.1)
Modal group00
TypeOne-shot (non-modal) — active only in its own block
Used onMilling machines
SyntaxHaas: G12 I_ K_ Q_ D_ L_ Z_ F_

What does G12 do?

On Haas mills, G12 mills a circular pocket clockwise (G13 counter-clockwise) in one line, with optional stepping out and multiple depths. On Fanuc lathes, G12.1 starts polar coordinate interpolation for milling flats with live tools.

G12 is a one-shot code: it only acts in the block where it is written, and the previously active modal codes take over again afterwards.

Syntax and parameters

Format
Haas: G12 I_ K_ Q_ D_ L_ Z_ F_
AddressMeaning
IRadius of first circle
KRadius of finished circle
QRadial step-over
DCutter comp offset number
LLoop count for depth
ZDepth of cut

G12 example program

Example
(Haas: 50 mm pocket, 10 mm cutter)
G00 X0 Y0 Z1.0
G12 I5.0 K25.0 Q4.0 D01 Z-3.0 F300.

▶ Open this example in the G-code viewer

Tips and common mistakes

  • Not available on standard Fanuc mills — use a G02/G03 or macro instead.
  • Lathe G12.1 must be cancelled with G13.1.

Controller compatibility

G12 follows the ISO/Fanuc dialect used by Fanuc, Haas, Brother, Doosan, Hurco (ISO mode), Mazak (EIA/ISO mode), Okuma (G-code mode) and Siemens in ISO dialect mode. Parameters, option packages and builder-specific behaviour can differ, so confirm the details in your machine's programming manual before running a new program.

Frequently asked questions

Is G12 modal?
No. G12 is a one-shot (group 00) code and only acts in the block where it appears.
What does G12 mean in CNC?
G12 means Circular Pocket Milling CW (Haas) / Polar Interpolation (Lathe G12.1). On Haas mills, G12 mills a circular pocket clockwise (G13 counter-clockwise) in one line, with optional stepping out and multiple depths. On Fanuc lathes, G12.1 starts polar coordinate interpolation for milling flats…
What is the difference between G12 and G13?
G12 is Circular Pocket Milling CW (Haas) / Polar Interpolation (Lathe G12.1), while G13 is Circular Pocket Milling CCW (Haas) / Cancel Polar Interpolation (G13.1). See the G13 page for its syntax and examples.
Can I use G12 on a lathe?
Usually not with the same meaning: G12 is documented here for milling machines. Check your control manual for the equivalent.