Haas G-codes73 codesMill
Haas Mill G-code List
Because the numbering follows Fanuc almost everywhere, a Fanuc program usually runs on a Haas mill. It goes wrong in the details: settings that change what a code does, L instead of K for loops, dwells where P10. is ten seconds and the G154 extended offsets. Below is every G-code the reference marks for a Haas mill except G10.9.
Haas Mill G-code: 73 codes
Codes in colour link to a full page with a worked example and controller differences; the rest link to their row on the G-code list.
| Code | Function |
|---|---|
| G00 | Rapid PositioningMoves the tool at maximum speed to the specified position. Used for non-cutting moves to position the tool quickly. Movement is typically not in a straight line - each axis moves at its maximum rate independently. |
| G01 | Linear InterpolationMoves the tool in a straight line at a specified feed rate. Used for cutting operations where precise linear movement is required. |
| G02 | Circular Interpolation CWMoves the tool in a clockwise arc. The arc center is defined by I/J/K offsets or R radius. Direction is clockwise when viewed from the positive direction of the perpendicular axis. |
| G03 | Circular Interpolation CCWMoves the tool in a counter-clockwise arc. The arc center is defined by I/J/K offsets or R radius. Direction is counter-clockwise when viewed from the positive direction of the perpendicular axis. |
| G04 | DwellPauses program execution for a specified time. Useful for chip clearing, allowing spindle to reach speed, or timing operations. |
| G05 | High-Speed Machining ModeActivates high-speed machining mode for smoother motion at high feed rates. Reduces acceleration/deceleration for better surface finish. |
| G09 | Exact Stop CheckNon-modal exact stop. Machine decelerates to a complete stop at the end of the current block only. Unlike G61, it only affects the single block it appears on. |
| G10 | Data Setting / Offset EntryProgrammable data entry for work offsets, tool offsets, and parameters. Allows automatic offset adjustment during program execution. |
| G12 | Circular Pocket Milling CWMills a circular pocket using clockwise tool motion. The tool starts at the center and spirals outward to the specified diameter, then retracts. Simplifies circular pocket programming without CAM. |
| G13 | Circular Pocket Milling CCWMills a circular pocket using counter-clockwise tool motion. Identical to G12 but with opposite rotation direction. Use for conventional milling approach. |
| G15 | Polar Coordinate Mode CancelCancels polar coordinate mode and returns to Cartesian (X/Y) coordinate programming. |
| G16 | Polar Coordinate ModeEnables polar coordinate programming. X specifies radius (distance from origin) and Y specifies angle in degrees. Useful for bolt circles and patterns. |
| G17 | XY Plane SelectionSelects the XY plane for circular interpolation (G02/G03). Arc movements will occur in the XY plane with Z as the perpendicular axis. This is the default plane for most milling operations. |
| G18 | XZ Plane SelectionSelects the XZ plane for circular interpolation. Arc movements will occur in the XZ plane with Y as the perpendicular axis. Common for lathe operations. |
| G19 | YZ Plane SelectionSelects the YZ plane for circular interpolation. Arc movements will occur in the YZ plane with X as the perpendicular axis. |
| G20 | Inch ModeSets the unit system to inches. All position values and feed rates will be interpreted as inches and inches per minute. |
| G21 | Metric ModeSets the unit system to millimeters. All position values and feed rates will be interpreted as millimeters and mm per minute. |
| G27 | Reference Point Return CheckMoves to reference point and verifies position. Alarms if machine does not reach reference position. Used for safety verification. |
| G28 | Return to Reference PointReturns the machine to its reference point (machine home). Can pass through an intermediate point if coordinates are specified. Often used for safe tool changes. |
| G29 | Return from Reference PointMoves from reference point through intermediate point to final position. Reverses the G28 path. |
| G30 | Return to 2nd Reference PointReturns the machine to its second reference point. Similar to G28 but goes to an alternate reference position. Useful when G28 position is inconvenient for tool changes. |
| G31 | Skip Function / ProbeMoves at feed rate until the skip signal (probe trigger) is received, then stops. Used for touch probing and measuring. |
| G37 | Automatic Tool Length MeasurementInitiates automatic tool length measurement using a tool length measuring device (probe). Measures the tool and stores the offset automatically. |
| G38.2 | Probe Toward - Stop on ContactMoves toward workpiece until probe contact, then stops. Standard probing move. Error if probe doesn't trigger. |
| G40 | Cutter Compensation CancelCancels cutter radius compensation (G41/G42). Tool path returns to programmed path. Should be called before tool changes and at program end. |
| G41 | Cutter Compensation LeftActivates cutter radius compensation to the left of the programmed path. Tool is offset by its radius to the left of the direction of travel. Used for climb milling on external profiles. |
| G42 | Cutter Compensation RightActivates cutter radius compensation to the right of the programmed path. Tool is offset by its radius to the right of the direction of travel. Used for conventional milling on external profiles. |
| G43 | Tool Length Compensation +Activates tool length compensation in the positive direction. Adds the offset value to the Z axis position. Standard for milling operations. |
| G44 | Tool Length Compensation -Activates tool length compensation in the negative direction. Subtracts the offset value from the Z axis position. Less commonly used than G43. |
| G49 | Tool Length Compensation CancelCancels tool length compensation. Returns Z axis to programmed values without offset. |
| G50 | Scaling Cancel / Max Spindle SpeedOn mills: Cancels scaling (G51). On lathes: Sets maximum spindle speed for constant surface speed mode (G96). |
| G50.1 | Mirror Image CancelCancels mirror image mode. Returns axes to normal direction of movement after G51.1 mirroring. |
| G51 | ScalingActivates scaling of programmed coordinates. Multiplies all moves by the scale factor around the specified center point. |
| G51.1 | Mirror Image EnableEnables mirror image mode for specified axes. Reverses the direction of programmed moves around the specified mirror center point. Useful for machining symmetric parts. |
| G52 | Local Coordinate SystemSets a local coordinate system offset that is added to the active work coordinate system. Creates a temporary shift without changing the work offset. |
| G53 | Machine Coordinate SystemTemporarily use machine coordinates for the current block only. Coordinates are interpreted relative to machine zero, ignoring work offsets. Non-modal - only affects the block it's on. |
| G54 | Work Coordinate System 1Selects work coordinate system 1. This is typically the primary/default work offset used for most machining operations. Origin is set during setup. |
| G54.1 | Extended Work Coordinate SystemsSelects additional work coordinate systems beyond G54-G59. Provides up to 48 additional offsets (P1-P48) for complex multi-fixture setups. |
| G55 | Work Coordinate System 2Selects work coordinate system 2. Use for second fixture or part setup. |
| G56 | Work Coordinate System 3Selects work coordinate system 3. Use for third fixture or part setup. |
| G57 | Work Coordinate System 4Selects work coordinate system 4. |
| G58 | Work Coordinate System 5Selects work coordinate system 5. |
| G59 | Work Coordinate System 6Selects work coordinate system 6. |
| G60 | Single Direction PositioningApproaches the final position from one direction only to eliminate backlash error. Machine overshoots and returns from the specified direction for precise positioning. |
| G61 | Exact Stop ModeMachine decelerates to complete stop at each programmed point. Ensures precise positioning but slower cycle time. Use for sharp corners. |
| G63 | Tapping ModeActivates tapping mode where spindle and feed are synchronized. Feed override and spindle override are disabled. |
| G64 | Cutting Mode / Continuous PathEnables continuous path mode for smooth motion. Machine does not decelerate fully at corners, allowing faster cycle times with slight corner rounding. |
| G65 | Macro CallCalls a custom macro program with optional arguments. Allows parameterized subprograms for repetitive operations. |
| G66 | Macro Modal CallActivates modal macro call. The macro is executed after every subsequent motion block until cancelled. |
| G67 | Macro Modal Call CancelCancels modal macro call activated by G66. |
| G68 | Coordinate System RotationRotates the coordinate system around a specified point by a specified angle. All subsequent moves are in the rotated system. |
| G69 | Coordinate System Rotation CancelCancels coordinate system rotation activated by G68. Returns to normal coordinate system. |
| G73 | High Speed Peck DrillingChip breaking peck drill cycle with minimal retract. Drills incrementally with small retracts to break chips without fully retracting. Faster than G83 for most materials. |
| G74 | Left-Hand Tapping CycleLeft-hand (reverse) tapping cycle. For cutting left-hand threads. Spindle runs CCW during cutting. |
| G76 | Fine Boring CycleFine boring cycle with oriented spindle stop and shift. Tool retracts off the wall before withdrawing to prevent scratching. |
| G80 | Canned Cycle CancelCancels any active canned cycle (G73, G81-G89). Returns to normal motion mode. |
| G81 | Drilling CycleSimple drilling cycle. Rapids to R-plane, feeds to Z depth, then rapids out. No dwelling or pecking. |
| G82 | Drilling Cycle with DwellDrilling cycle with dwell at the bottom. Rapids to R-plane, feeds to depth, dwells, then rapids out. Used for counterboring and spot drilling. |
| G83 | Deep Hole Peck DrillingFull retract peck drilling cycle. Drills incrementally with full retract to R-plane for chip evacuation. Essential for deep holes. |
| G84 | Tapping CycleRight-hand tapping cycle. Feeds in at specified rate, reverses spindle, feeds out. Synchronizes spindle and feed for threading. |
| G85 | Boring CycleSimple boring cycle. Feeds in at specified rate, feeds out at same rate. Provides better finish than rapid retract. |
| G86 | Boring Cycle with Spindle StopBoring cycle that stops spindle at bottom before rapid retract. Prevents drag marks on bore wall. |
| G87 | Back Boring CycleBack boring cycle for machining from the back side. Tool enters through hole, orients, shifts, and bores upward. |
| G88 | Boring Cycle with Manual RetractBoring cycle with dwell and manual retract. Stops at bottom for operator inspection or manual intervention. |
| G89 | Boring Cycle with DwellBoring cycle with dwell at bottom, then feed retract. Dwell allows spring pass for improved finish. |
| G90 | Absolute PositioningSets absolute positioning mode. All coordinates are interpreted as absolute positions relative to the current work coordinate system origin. |
| G91 | Incremental PositioningSets incremental positioning mode. All coordinates are interpreted as distances relative to the current position. |
| G92 | Position Register / Coordinate System OffsetSets the current position to specified values without moving. Creates an offset to make current position equal to given coordinates. Use with caution - can cause confusion. |
| G93 | Inverse Time Feed ModeFeed rate specifies time to complete the move (1/minutes). F2.0 means move completes in 0.5 minutes. Used for complex multi-axis moves. |
| G94 | Feed Per MinuteSets feed rate mode to units per minute. Feed rate value represents distance traveled per minute. |
| G95 | Feed Per RevolutionSets feed rate mode to units per revolution. Feed rate value represents distance traveled per spindle revolution. Common for turning and drilling operations. |
| G98 | Return to Initial LevelIn canned cycles, tool returns to the initial Z level (where cycle started) after each hole. Safer for fixtures with varying heights. |
| G99 | Return to R-LevelIn canned cycles, tool returns to the R-plane after each hole. Faster for flat surfaces with clear paths between holes. |
Where Haas differs
- Setting 56, M30 Restore Default G: when on, M30 resets modal G codes to their defaults, cancelling G43 and returning to G54 and G80.
- Setting 33, Coordinate System, decides what G52 and G92 do to the work offsets. In FANUC mode the G52 values are added to every work offset, a global shift; in YASNAC mode G52 becomes another work offset, like G55.
- Setting 40, Tool Offset Measure, decides whether the offset column is read as a radius or a diameter, so the same D value cuts two different parts on two machines.
- Setting 58, Cutter Compensation, FANUC or YASNAC, changes how the tool goes round an outside corner: YASNAC joins every outside corner with an arc, FANUC makes a sharp corner and adds a linear move where the angle is over 270 degrees.
- 2D cutter compensation, G41 and G42, works in X and Y with G17; 3D compensation is G141.
- G154 P1 to P99 are the extended work offsets; G110 to G129 are the older names for G154 P1 to P20.
- Canned cycle loop count is L, not Fanuc's K.
- G04 P with a decimal point is read in seconds and without one in milliseconds: G04 P10. is ten seconds, G04 P10 is ten milliseconds, so P0.5 is half a second.
- Setting 57, Exact Stop Canned X-Y, decides whether the control comes to a full stop at each hole before the Z move of a canned cycle.
- G73 and G83 take I, J and K for a reducing peck: I the first peck, J the amount taken off each following peck, K the smallest peck allowed. G83 also takes P as a dwell at the bottom. Setting 22, Can Cycle Delta Z, is the G73 backoff and Setting 52, G83 Retract Above R, controls the G83 retract height.
- A G28 block with no axis word returns every axis to machine zero.
- G12 and G13 circular pocket milling and G154 are on the Haas list and not on most others. G10.9, which the reference also marks for Haas, is not on the Haas G-code list, so the table leaves it out.
Frequently asked questions
Will a Fanuc program run on a Haas mill?
Usually, with three checks first. Loop counts are L not K, a P dwell with a decimal point is read in seconds, and Setting 56 decides what M30 leaves behind. Work offsets beyond G59 are G154 P1 to P99. See G54 to G59: work offsets.
Why does my G41 cut differently on two Haas machines?
Setting 40 decides whether the tool offset column is a radius or a diameter, and Setting 58 decides how the tool goes round an outside corner. The same D value and the same program give two different parts if the settings differ. See G40, G41 and G42: cutter compensation.
How does a Haas reduce the peck depth in G83?
With I, J and K on the cycle block: I is the first peck, J the amount taken off each following peck and K the smallest peck allowed. Setting 52 controls how far above R the drill retracts between pecks. See G73 and G83: peck drilling.
What does Setting 56 do?
M30 Restore Default G. When it is on, M30 puts every modal G code back to its default, so G43 is cancelled, G54 is restored and a canned cycle left running is cancelled. With it off, the modal G codes of the last run carry into the next, although M30 still cancels the tool length offset.
Other controller lists
Last updated 11 Oct 2026