← Back to CNC Programming

Quick Reference

A one-page lookup of the most common G-codes, M-codes, and formulas. Use this while working — not while learning. For explanations, follow the links to each topic.

G-Codes

CodeFunctionModal?
G00Rapid positioningYes (motion group)
G01Linear feed interpolationYes
G02Clockwise circular arcYes
G03Counterclockwise circular arcYes
G04Dwell (P / X seconds)No (one block)
G17/G18/G19XY / XZ / YZ plane selectionYes
G20/G21Inch / millimeter unitsYes
G40/G41/G42Cutter comp off / left / rightYes
G43/G49Tool length comp on / offYes
G53Machine coordinates (one block)No
G54–G59Work coordinate systemsYes
G70Finish turning cycle (lathe)Yes
G71Rough turning cycle (lathe)Yes
G76Threading cycleYes
G80Cancel canned cycleYes
G81Drilling cycleYes
G82Drill with dwellYes
G83Peck drilling cycleYes
G84Right-hand tapping cycleYes
G85Boring cycleYes
G90/G91Absolute / incrementalYes
G94/G95Feed per minute / per revolutionYes
G96/G97Constant surface speed / fixed RPMYes
G98/G99Cycle retract to initial / R planeYes

M-Codes

CodeFunction
M00Program stop (unconditional)
M01Optional stop (switch-dependent)
M03/M04/M05Spindle CW / CCW / stop
M06Tool change (mill)
M08/M09Coolant on / off
M30Program end and rewind
M98Call subprogram
M99Return from subprogram

Common Formulas

Common Mistakes

This page is intentionally brief. For each code, follow the link to the detailed lesson. M-codes are machine-specific — always verify against your manual.

Quick Self-Test

1. Quick: G83 is what?

Ans

Peck drilling cycle (G83 with Q peck depth).

2. Quick: M08?

Ans

Coolant on.

3. Quick: G41?

Ans

Cutter radius compensation, left side of cut direction.

4. Quick: G96?

Ans

Constant surface speed (CSS) on a lathe — RPM varies with diameter.