Beginner's Guide to CNC Lathe G‑Code: Simple Example & Step‑by‑Step Tutorial
CNC lathe simple g code example for CNC machinists/CNC programmers who just started their journey to learn CNC programming.
Simple G Code Example CNC Lathe

CNC Lathe Simple G Code Example
O0001 N5 M12 N10 T0101 N15 G0 X100 Z50 N20 M3 S600 N25 M8 N30 G1 X50 Z0 F600 N40 W-30 F200 N50 X80 W-20 F150 N60 G0 X100 Z50 N70 T0100 N80 M5 N90 M9 N100 M13 N110 M30 N120 %
Code Explanation
N5 Clamping workpiece
N10 Changing No.1 tool and executing its offset
N15 Rapidly positioning to A point
N20 Starting the spindle with 600 r/min
N25 Cooling ON
N30 Approaching B point with 600mm/min
N40 Cutting from B point to C point
N50 Cutting from C point to D point
N60 Rapidly retracting to A point
N70 Canceling the tool offset
N80 Stopping the spindle
N90 Cooling OFF
N100 Releasing workpiece
N110 End of program, spindle stopping and Cooling OFF
CNC Machine
- CNC Programming for Beginners: Step‑by‑Step Lathe Example
- Beginner-Friendly Lathe CNC Programming Guide
- CNC Programming for Beginners: Learn with a Practical Example
- Step‑by‑Step CNC Lathe Programming Guide: Chamfer, Taper, Groove & Arc
- Beginner-Friendly Fanuc CNC Lathe Programming Example – Straight, Taper, and Arc Cuts
- Simple CNC Lathe Programming: Inch-Based Example for Beginners
- CNC Milling Machine Programming: Beginner-Friendly Example Guide
- Beginner's Guide to G‑Code: Simple Milling Example & Practical Tips
- Master G71 Rough Turning Cycle: Fanuc CNC Lathe Code Example
- CNC Lathe Facing Program Demo – Tool Movements & Settings Explained