Comprehensive CNC Milling Sample Program – G-Code Tutorial & Explanation
CNC milling sample program with program code explanation.
This cnc milling machine programming tutorial shows how Circular Interpolation G2 / G3 G-code are programmed. As well as programming of straight lines for cnc milling machine.
This cnc milling sample program is easy to understand without the help of any CNC professional programmer.

CNC Milling Sample Program
N5 G90 G71 N10 T1 M6 N15 G92 X-100 Y86 Z95 N20 G0 X0 Y0 S2500 M3 N25 Z12.5 N30 G1 Z-12.5 F150 N35 X-20 Y30 N40 G2 X10 Y100 R80 N45 G1 X140 Y60 N50 G2 X150 Y0 R50 N55 G1 X0 Y0 N60 G0 Z12.5 N65 G91 G28 Z0 M5 N70 G91 G28 X0 Y0 N75 M30
N5 absolute positioning, metric unit
N10 tool change to T1
N15 define work zero point at A
N20 rapid traverse to A, spindle on (2500 RPM, CW)
N25 rapid plunge to 12.5 mm above Z0
N30 feed to Z-12.5, feed rate 150 MMPM
N35 cut line AB to B
N40 cut arc BC to C
N45 cut line CD to D
N50 cut arc DE to E
N55 cut line EA to A
N60 rapid retract to Z12.5
N65 reference point return in Z direction, spindle off
N70 reference point return in X and Y directions
N75 end of program
CNC Machine
- Mastering CNC Milling: Precision Metal Fabrication Explained
- CNC Milling vs. Manual Milling: Choosing the Right Approach for Your Project
- CNC Milling: Precision, Efficiency, and Versatility in Modern Manufacturing
- CNC G02 Clockwise Circular Interpolation: Beginner‑Friendly Sample Program
- Beginner CNC Slot Milling Program: Simple Example & Step‑by‑Step Guide
- Understanding CNC Program Blocks: A Comprehensive Guide
- Siemens Sinumerik 4‑Axis Milling Program: A Practical CNC Example
- CNC Milling Arc Example: Using G2 with I & J Parameters
- Heidenhain CNC Milling Program: Precision Toolpath for Efficient Manufacturing
- CNC Pocket Milling Example: Peck Milling Tutorial