G-code list: a complete list of common G-codes for CNC machining

G code List Guide

G code is one of the most common CNC codes we use in the process of CNC machining centers. In this paper, we have compiled a list of common G code instructions and detailed analysis, of course, different manufacturers of different CNC systems may be slightly different, in the actual operation in the manual shall prevail.

1. G-code list

G-codes for CNC machining (including lathes and milling machines) are instructions used to control machine movements, cutting modes, coordinate systems, and more. The following is a list of common CNC machining G-codes.

1
G0 - Rapid positioning (rapid traverse)

Used to move a tool or table quickly to a target position.

2
G1 - Linear interpolation (cutting feed)

Used for linear interpolation, usually for feed control during cutting.

3
G2 - Clockwise Circular Interpolation

Used for clockwise circular interpolation, usually for turning or milling circular paths.

4
G3 - Counterclockwise Circular Interpolation

Counterclockwise interpolation, usually used for turning or milling circular paths.

5
G4 - Stay (Delay)

Used in delay instructions to pause program execution for a specified time.

6
G5 - High Speed Interpolation

Used for high precision interference interpolation control to ensure accurate paths.

7
G6 - Automatic Tool Compensation

Used for linear interpolation, usually for feed control during cutting.

8
G7 - Roundness detection

Used to detect roundness deviations during machining.

9
G8 - Contour machining control

For precise control of contour machining.

10
G9 - Stop Interpolation

Used to stop the calculation of the current interpolation path, often used when it is necessary to stop feeding or cutting.

11
G10 - Input parameter setting (e.g. coordinates)

Used to enter specific parameters such as coordinate system, tool length, etc. settings.

12
G11 - Cancel G10 setting

Used to cancel the parameters set by G10.

13
G12 - Clockwise helical interpolation

Used for clockwise helical interpolation, usually used for turning threads.

14
G13 - Counterclockwise Helical Interpolation

For counterclockwise helical interpolation, typically used for turning threads.

15
G14 - Automatic drilling control

Enables the automatic drilling function for drilling operations.

16
G15 - Cancel automatic drilling control

Cancel the automatic drilling control.

17
G16 - Cutting direction setting

Used to set the direction of cutting during machining.

18
G17 - XY plane selection

Selects the XY plane for machining, usually used to set the machining plane during milling.

19
G18 - ZX Plane Selection

Selects the ZX plane for machining, typically used to select the plane when machining on a lathe.

20
G19 - YZ plane selection

Selects the YZ plane for machining, suitable for specific types of lathes or milling machines.

21
G20 - Programming Units: Inches (Imperial Units)

Sets the programming unit to inches.

22
G21 - Programming Units: millimeters (metric units)

Sets programming units to millimeters.

23
G22 - Absolute Programming Mode Activated

Activates absolute coordinate programming mode.

24
G23 - Incremental Programming Mode Initiates

Starts incremental coordinate programming mode.

25
G24 - Stop rotation (to avoid tool-workpiece collision)

Stops rotary motion to avoid accidental collisions.

26
G25 - Stop automatic tool compensation

Stops automatic tool compensation.

27
G26 - Depth of cut automatic setting

For automatic setting of the depth of cut.

28
G27 - Coordinate system checking

For checking the correctness of the coordinate system.

29
G28 - Return to machine origin

Moves the tool or table to the machine home position.

30
G29 - Return to current position from origin

Returns to the previous current position from the machine home position.

31
G30 - Return from Second Home position

Returns to the preset second home position.

32
G31 - Probe (Trigger Inspection) Function

Enables the probe function for part size inspection or position detection.

33
G32 - Thread Cutting

Enables the control of the lathe for thread cutting.

34
G33 - Thread cutting (for different types of cutting)

To control the lathe for different types of thread cutting.

35
G34 - Thread cutting for variable pitch threading

For variable pitch machining of threads.

36
G35 - Mirror Image Programming

Enables mirror image machining.

37
G36 - Single Step Cutting

Used to enable single-step cutting for high-precision cutting.

38
G37 - Self-Calibration

To enable the auto-calibration function to correct the tool position.

39
G38 - Auto Compensation

Enables automatic tool compensation.

40
G39 - High Precision Machining Control

Enables high precision machining control mode.

41
G40 - Cancel tool radius compensation

Cancel the tool radius compensation function.

42
G41 - Tool Radius Compensation Left side

Enables tool radius compensation and places the tool on the left side of the machining path.

43
G42 - Tool radius compensation right side

Enables tool radius compensation and places the tool on the right side of the machining path.

44
G43 - Tool Length Compensation Positive

Enables positive tool length compensation.

45
G44 - Tool Length Compensation Negative Values

Enables tool length compensation negative.

46
G45 - Tool Radius Compensation Increments

Enables the tool radius compensation increment setting.

47
G46 - Tool Radius Compensation Decrement Enables the Tool Radius Compensation Decrement setting.

Enables the tool radius compensation decrement setting.

48
G47 - Tool Radius Compensation Multiplier Enables the Tool Radius Compensation Multiplier setting.

Enables the Tool Radius Compensation Multiplier setting.

49
G48 - Tool Radius Compensation Decrement Enables the Tool Radius Compensation Decrement setting.

Enables the Tool Radius Compensation Decrement setting.

50
G49 - Cancel Tool Length Compensation

Cancels the tool length compensation.

51
G50 - Cancel Tool Parameter Setting

Cancels the previously set tool parameters.

52
G51 - Proportional transformations

Enables proportional transformation of coordinates or dimensions during machining.

53
G52 - Coordinate system setting

Sets the new working coordinate system.

54
G53 - Cancel coordinate system setting

Cancel the current working coordinate system setting.

55
G54-G59 - Working coordinate system selection

Selects different working coordinate systems (up to 6).

56
G60 - Precise positioning

For precise position control to ensure machining accuracy.

57
G61 - Precision Stop (Single Step Control)

Enables single-step feed mode for precise control.

58
G62 - Automatic feed rate adjustment

Automatically adjusts the feed rate to the machining requirements.

59
G63 - High Speed Cutting

Enables high speed cutting mode.

60
G64 - Cancel Precision Stop

Cancels the precision stop and resumes normal feed.

61
G65 - Call subroutine

Calls a subroutine to repeat the operation.

62
G66 - Call Subroutine Directly

Calls and executes a subroutine directly.

63
G67 - Cancel subroutine call

Cancels a call to a subroutine.

64
G68 - Coordinate rotation

Enables the coordinate rotation function to change the machining direction.

65
G69 - Cancel Coordinate Rotation Cancel the coordinate rotation function.

Cancel the coordinate rotation function.

66
G70 - Finishing Cycle (Milling)

Enables the finishing cycle for fine machining.

67
G71 - Roughing cycle (Milling)

Enables the roughing cycle for rough machining.

68
G72 - Roughing Cycle (Milling with Returns)

Enables the roughing cycle with return.

69
G73 - High Speed Roughing Cycle

Enables a high speed roughing cycle.

70
G74 - Left Hand Thread Cutting

Enables left hand thread cutting on the lathe.

71
G75 - High Speed Thread Cutting

Enables high speed thread cutting mode.

72
G76 - Fine Turning Cycle

Enables fine turning cycle for high precision turning.

73
G77 - Cutoff Machining

Enables cut-off machining mode.

74
G78 - Multiple Cutting

Enables multiple cutting mode.

75
G79 - Auto Compensation

Enables automatic compensation mode.

76
G80 - Cancel Fixed Cycle

Cancels the fixed cycle mode.

77
G81 - Drill Fixed Cycle

Enables the Drill Fixed Cycle, commonly used for drilling operations.

78
G82 - Drill Fixed Cycle with Stay

Enables the drill fix cycle with dwell.

79
G83 - Deep Hole Drilling

Enables the deep hole drilling cycle.

80
G84 - Thread Machining

Enables thread machining mode.

81
G85 - Drill cycle with return

Enables the drill cycle with return.

82
G86 - Tapered Hole Machining

Enables tapered hole machining mode.

83
G87 - Elevated Drilling Machining

Enables elevated drilling mode.

84
G88 - Incomplete Drilling

Enables the Incomplete Drilling mode.

85
G89 - Drill Cycle with Stay

Enables drill cycle mode with dwell.

86
G90 - Absolute Programming (using fixed coordinates)

Enables absolute programming mode where all coordinates are calculated with a fixed origin.

87
G91 - Incremental programming (relative coordinates)

Enables incremental programming mode where all coordinates are relative to the current position.

88
G92 - Set Workpiece Coordinate System Home Position

Sets the origin position of the workpiece.

89
G93 - Time Reverse Feed Mode

Enables reverse time feed mode, typically used for fine machining.

90
G94 - Normal feed mode (feed per minute)

Enables normal feed mode for machining at feed rates per minute.

91
G95 - Feed Per Revolution Mode (Turning)

Enables feed per revolution mode, commonly used for lathe operation.

92
G96 - Constant Surface Speed Control

Enables constant surface speed control to maintain a constant cutting speed during machining.

93
G97 - Cancel Constant Surface Speed Control

Cancels the constant surface speed control and reverts to normal speed.

94
G98 - Return to Initial Position (for cycle machining)

Returns to the initial position for cycle machining.

95
G99 - Return to point R for cyclic machining

Returns to point R for subsequent machining.

The above list of common CNC machining G codes covers most lathe and milling machine programming needs.

Summary of G code

Through in-depth understanding and application of G code, CNC operators can greatly improve machining efficiency, ensure machining quality, and adapt to a variety of different machining needs.
Therefore, the mastery and application of CNC G-code is a basic skill in the CNC machining industry, any CNC machinist should pay attention to and constantly practice.

Contact us today for a free quote!
G39 - High Precision Machining Control
Scroll to Top

Request a Free Quote

If you have any questions or need a quote, please send us a message. We will get back to you as soon as possible!
Click or drag a file to this area to upload.
If you already have drawings, please send them directly to us for a quick and accurate quote, all your information will be kept strictly confidential.