Machining Center CNC Program G-codes and M-codes

Jun 09, 2026

Leave a message

 

CNC Program G-Codes

 

G00 Point-to-point positioning G01 Linear interpolation G02 Clockwise circular interpolation
G03 Counter-clockwise interpolation G04 Dwell G05 Unassigned
G06 Parabolic interpolation G07 Unassigned G08 Acceleration
G09 Deceleration G10 Data setting G11 Data setting cancel
G12~G16 Unassigned G17 X-Y plane selection G18 Z-X plane selection
G19 Y-Z plane selection G20 Imperial units G21 Metric units
G22 Stroke check ON G23 Stroke check OFF G24 Unassigned
G25 Spindle speed fluctuation check ON G26 Spindle speed fluctuation check OFF G27 Reference point return check
G28 Reference point return G29~30 Unassigned G31 Skip function
G32 Unassigned G33 Constant pitch threading G34 Increasing pitch threading
G35 Decreasing pitch threading G36~G39 Unassigned G40 Tool compensation/offset cancel
G41 Tool compensation (left of workpiece) G42 Tool compensation (right of workpiece) G43 Add tool offset to coordinate
G44 Subtract tool offset from coordinate G49 Tool length compensation cancel G45~G51 Tool offset (+, -, or 0) compensation
G52 Local coordinate system setting G53 Linear displacement cancel G54 1st workpiece coordinate system setting
G55 2nd workpiece coordinate system setting G56 3rd workpiece coordinate system setting G57 4th workpiece coordinate system setting
G58 5th workpiece coordinate system setting G59 6th workpiece coordinate system setting G60 Exact stop positioning (fine)
G61 Exact stop positioning (medium) G62 Rapid positioning (coarse) G63~G64 Unassigned
G65 Macro program call G66 Macro call modal G67 Macro call cancel
G68 Tool offset (inner corner) G69 Tool offset (outer corner) G70~G72 Unassigned
G73 High-speed deep-hole drilling cycle G74 Left-hand tapping cycle G75 Unassigned
G76 Fine boring cycle G77~G79 Unassigned G80 Canned cycle cancel
G81 Drilling cycle G82 Drilling cycle G83 Deep-hole drilling cycle
G84 Tapping cycle G85 Fine boring cycle G86 Boring cycle
G87 Back boring cycle G88 Unassigned G89 Boring cycle
G90 Absolute coordinate input G91 Incremental coordinate input G92 Workpiece coordinate origin setting
G93 Inverse time feed (mm/min) G94 Feed per minute G95 Feed per spindle revolution (mm)
G96 Constant surface speed (m/min) G97 Spindle speed (RPM) G98~G99 Unassigned

 

 

 

Auxiliary Code (M-Code) Functions

 

M00 Program stop M01 Optional stop M02 Program end
M03 Spindle CW rotation M04 Spindle CCW rotation M05 Spindle stop
M06 Automatic tool change M07 Coolant 2 ON M08 Coolant 1 ON
M09 Coolant OFF M10 Clamp M11 Unclamp
M12 Unassigned M13 Spindle CW, coolant ON M14 Spindle CW, coolant ON
M15 Rapid traverse, positive M16 Rapid traverse, negative M17~18 Unassigned
M19 Spindle orientation stop M20~29 Unassigned M30 Program end and rewind
M31 Interlock bypass M32~35 Unassigned M36/M37 Feed range 1/2
M38/M39 Spindle speed 1/2 M40–45 Gear shifting M46–47 Unassigned
M48 Cancel M49 M49 Return to specified speed/feed rate M50 Coolant No. 3 ON
M51 Coolant No. 4 ON M52 Automatic door open M53 Automatic door close
M54 Unassigned M55/M56 Tool linear movement to point 1/2 M57–59 Unassigned
M60 Workpiece change M61/M62 Workpiece linear movement to position 1/2 M63–70 Unassigned
M71/M72 Workpiece angular movement, position 1/2 M73 Unassigned M74 Error detection ON
M75 Error detection OFF M76–97 Unassigned M98 Subprogram call

 

 

 

Send Inquiry
Contact us if have any question

You can either contact us via phone, email or online form below. Our specialist will contact you back shortly.

Contact now!