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
| Code | Function | Modal? |
|---|---|---|
| G00 | Rapid positioning | Yes (motion group) |
| G01 | Linear feed interpolation | Yes |
| G02 | Clockwise circular arc | Yes |
| G03 | Counterclockwise circular arc | Yes |
| G04 | Dwell (P / X seconds) | No (one block) |
| G17/G18/G19 | XY / XZ / YZ plane selection | Yes |
| G20/G21 | Inch / millimeter units | Yes |
| G40/G41/G42 | Cutter comp off / left / right | Yes |
| G43/G49 | Tool length comp on / off | Yes |
| G53 | Machine coordinates (one block) | No |
| G54–G59 | Work coordinate systems | Yes |
| G70 | Finish turning cycle (lathe) | Yes |
| G71 | Rough turning cycle (lathe) | Yes |
| G76 | Threading cycle | Yes |
| G80 | Cancel canned cycle | Yes |
| G81 | Drilling cycle | Yes |
| G82 | Drill with dwell | Yes |
| G83 | Peck drilling cycle | Yes |
| G84 | Right-hand tapping cycle | Yes |
| G85 | Boring cycle | Yes |
| G90/G91 | Absolute / incremental | Yes |
| G94/G95 | Feed per minute / per revolution | Yes |
| G96/G97 | Constant surface speed / fixed RPM | Yes |
| G98/G99 | Cycle retract to initial / R plane | Yes |
M-Codes
| Code | Function |
|---|---|
| M00 | Program stop (unconditional) |
| M01 | Optional stop (switch-dependent) |
| M03/M04/M05 | Spindle CW / CCW / stop |
| M06 | Tool change (mill) |
| M08/M09 | Coolant on / off |
| M30 | Program end and rewind |
| M98 | Call subprogram |
| M99 | Return from subprogram |
Common Formulas
- RPM = Vc × 1000 / (π × D)
- Feed (mm/min) = fz × flutes × RPM
- Feed (mm/rev) = mm/min / RPM
- Cutting time = distance / feed
- MRR (mm³/min) = width × depth × feed
- Tap feed = pitch × RPM
- Drill tip height = (D/2) / tan(point_angle/2)
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.