G12 and G13 machine a circular pocket on a Haas mill in a single line. The only difference is direction: G12 cuts clockwise, G13 counterclockwise. These codes are Haas-specific and are not part of standard FANUC milling codes with the same meaning. Both are Group 00, so they are non-modal and act only on the line where they are written.
G12 or G13: which one?
- G12 implies cutter compensation right (G42) and cuts clockwise.
- G13 implies cutter compensation left (G41) and cuts counterclockwise.
According to the Haas workbook, G13 is usually preferred because it climb cuts with a standard right-hand cutter.
Addresses on the G12/G13 line
| Address | Meaning |
|---|---|
| X, Y | Pocket center (can be left out if positioned on the previous line) |
| Z | Pocket depth; with G91, the depth increment per pass |
| I | Radius of the first circle; without K, the finished radius |
| K | Radius of the finished pocket |
| Q | Radius step-over of the spiral (used with K only) |
| D | Offset number that holds the cutter size |
| L | With G91, how many times the depth increment is repeated |
| F | Feed rate |
Why D matters: the control uses the cutter size in the D offset to cut the pocket to the programmed size. Program D0 if you do not want compensation.
Single finish pass: I only

Without K and Q, no roughing is done; the tool makes a single finish pass at radius I. Use it to bring a drilled or roughed hole to size:
G13 Z-10. I15. D02 F250.Spiral roughing: I, K and Q

To clear the whole pocket, give I and Q smaller than the tool diameter and K equal to the pocket radius. The tool starts at radius I, spirals out by Q each turn and finishes at K.
Incremental depth with G91 and L
Deep pockets are cut in several depth passes. With G91, Z is read as an increment and repeated L times:
G01 Z0. F1000.
G13 G91 Z-3. I4. K15. Q4. D02 L4 F400.
G90This cuts the pocket in four 3 mm passes to a total depth of 12 mm. The workbook notes that with this method the Z feed cannot be separated from the X-Y feed; Z also feeds at F. Remember to return to G90 afterwards.
Metric sample program
%
O02002 (HAAS G13 CIRCULAR POCKET - DIMENSIONS ARE EXAMPLES)
(G54 X0 Y0 POCKET CENTER, Z0 TOP FACE)
(T2 = 12 MM CENTER-CUTTING END MILL, D02 = 12 MM)
(SETTING 9 = MM)
T2 M06
G00 G90 G17 G40 G49 G54
X0. Y0.
S2600 M03
G43 H02 Z25. M08
G01 Z2. F1000.
G13 Z-10. I4. K15. Q4. D02 F400.
G00 Z25. M09
G53 G49 Z0. M05
M30
%| Block | Explanation |
|---|---|
| X0. Y0. | Tool goes to the pocket center; G13 starts there |
| G01 Z2. | Approach above the pocket |
| G13 Z-10. I4. K15. Q4. D02 F400. | 30 mm diameter, 10 mm deep pocket; first circle R4, growing 4 mm per turn to R15 |
| G00 Z25. | G13 does not retract the tool; raise Z before moving to another X-Y |
Because the tool plunges at the pocket center, use a center-cutting end mill, or drill the center first.
Common mistakes
- Writing Q without K: Q only works with K.
- I or Q larger than the tool diameter: material is left between turns.
- Wrong cutter size in the D offset: the pocket comes out the wrong size.
- Moving sideways without raising Z: the manual specifically warns that G12/G13 does not bring the tool out of the pocket.
- Not returning to G90 after G91.
FAQ
Can G12/G13 cut square or free-form pockets?
No, only circular pockets. For free-form pockets use Haas G150 general purpose pocket milling.
Do I need to turn on G41/G42 separately?
No. G12 implies G42 and G13 implies G41, using the size from the D offset. For cutter compensation in general: Cutter radius compensation in CNC milling.
Safety notice and disclaimer
The program on this page is a training example and its dimensions are for illustration. Before running it on your machine, check the tool and work offsets, prove it out in graphics and run the first part in single block with reduced feed and rapid override. The same code can behave differently on different controls and software versions; the Haas operator’s manual always takes priority. Mentor CNC cannot be held responsible for damage or injury arising from the use of this information.
