Close Menu
  • MAKİNELER ve İMALAT
    • Tools & Equipment
    • Computer-Aided Drawing
    • CAD/CAM Education
    • CNC Machine Programming
    • Casting Technologies
    • Electrical & Electronics Technologies
    • Hydraulics & Pneumatics
    • Manufacturing Processes
    • Manufacturing Technologies
    • Occupational Safety
    • Mold & Die Design
    • Solid Modeling
    • Welding Technology
    • Machine Elements
    • Mechanical Trade Drawing
    • Materials Science
    • Automotive & Vehicle Technologies
    • Robotics Technologies
    • Health Technologies
    • Defense & Aerospace Technologies
    • Descriptive Geometry
    • Technical Drawing
    • Software & Hardware Technologies
    • Innovative Manufacturing Methods
  • TEKNOLOJİ ve YAŞAM
    • OTOMOBİLLER ve TAŞIT
      • Vehicle & Engine Knowledge
      • Safe Driving
      • Sürüş Destek Sistemleri
    • Genel Kültür
      • Movies & TV Shows
      • Görsel ve Grafik Sanat
      • Books & Literature
      • Music
      • Sports
      • History
      • History of Technology
    • GÜNDELİK YAŞAM TEKNOLOJİLERİ
    • Hobbies & Entertainment
    • Internet Technologies
    • Health
    • Mobile Technologies
Makine Eğitimi
  • Machines & Manufacturing
    Machine Elements
    Hydraulics & Pneumatics
    Technical Drawing
    Computer-Aided Design & Manufacturing
    Basic Manufacturing Processes
    Manufacturing Processes
    Industry Technologies
    Other Technical Courses
    Motion & Power Transmission
    Simple Machines
    Chains & Sprockets
    Shafts & Journals
    Gears
    Cams
    Couplings
    Belts & Pulleys
    Springs
    Bearings
    Keys
    Fastening Joining
    Retaining Rings
    Screws, Bolts & Nuts
    Cotter Pins
    Flanges
    Welding
    Rivets
    Pins & Bolts
    Washers
    Calculators
    Gear Ratio Calculator
    Spring Constant Calculator
    Belt Pulley Ratio Calculator
    Other Machine Elements
    Slides & Linear Guides
    Brakes
    Flywheels
    Clamps
    Shock Absorbers
    Gaskets & O-Rings
    Seals & Sealing Elements
    Hydraulics
    Introduction to Hydraulics & Principles
    Hydraulic Systems & Applications
    Accumulators
    Filters
    Motors
    Pumps
    Valves
    Pneumatics
    Introduction to Pneumatics & Principles
    Pneumatic Systems & Applications
    Pneumatic Circuit Components
    Valves
    Cylinders
    Silencers
    Motors
    Compressors
    Dryers
    Conditioning Units
    Common Topics & Maintenance
    Hydraulic & Pneumatic Maintenance
    Study Notes, Exams & Tests
    Technical Drawing
    Introduction to Technical Drawing
    Geometric Drawings
    Perspective & Projection
    Orthographic Views
    Dimensioning
    Sectioning
    Assembly & Detail Drawings
    Tolerances
    Surface Finish Symbols
    Mechanical Engineering Drawing
    Screws, Bolts & Nuts
    Pulley Drawings
    Gear Drawings
    Shafts & Journals
    Bearing Drawings
    Pins & Bolts
    Spring Drawings
    Welds in Technical Drawing
    Washers
    Cotter Pins
    Technical Drawing Exercises
    Mechanical Drawing Exercises
    Gear Exercises
    View Extraction Exercises
    Pulley Exercises
    Pin & Bolt Exercises
    Threaded Fastening Exercises
    Descriptive Geometry
    Computer-Aided Drawing
    AutoCAD Drawing Lessons
    Computer-Aided Drawing Exams
    Solid Modeling & Animation
    Solid Model Drawing Files
    Solid Model Assembly Examples
    Solid Model Drawing Lessons
    3D CAD Software Reviews
    Solid Modeling Exercises
    CNC Programming
    CAM
    Measurement & Inspection
    Dial Indicators
    Calipers
    Gauges
    Micrometers
    Materials Science
    Steels
    Cast Iron
    Aluminum
    Plastics
    Material Testing & Hardness Measurement
    Occupational Safety
    Workshop Safety
    Safety When Working With Electricity
    Machine Safety Rules
    Hand Operations
    Filing
    Marking
    Cutting Operations
    Reaming
    Tapping
    Threading With a Die
    Drill Bit Sharpening
    Working With Machines
    Basic Turning Operations
    Basic Milling Operations
    Shaper Machine
    Machining
    Turning
    Milling
    Grinding
    Innovative Manufacturing Methods
    EDM (Electrical Discharge Machining)
    Laser Machining
    Waterjet Machining
    3D Printing
    3D Scanners
    Welding
    Rolling
    Casting
    Mold & Die Design
    Mechanical & Hydraulic Presses
    Blanking & Piercing Dies
    Bending Dies
    Drawing Dies
    Plastic Injection Molds
    Extrusion Dies
    Compound Dies
    Progressive Dies
    Blow Molds
    Spinning Dies
    Spray Molds
    Manufacturing of Machine Parts
    Automotive & Vehicle Technologies
    Motor Vehicle Manufacturing
    Raw Material Production
    History of Technology
    Health & Medical Technologies
    Defense & Aerospace
    Robotics Technologies
    Software & Hardware Technologies
    Mechanics - Strength of Materials
    Physics Topics
  • Technology & Life
    Hobbies & Entertainment
    Sports
    Music
    Vehicle & Engine Knowledge
    Vehicle Maintenance & Repair
    Safe Driving
    Driver Assistance Systems
    History
    Movies & TV Shows
    Books & Literature
    Computers & Internet
    Computer Tips
    Software Reviews
    Hardware & Peripherals
    Practical & Safe Internet Use
    Visual & Graphic Art
    Mobile Technologies
    Travel
    Science
    Health
    First Aid Knowledge
    Everyday Technologies
Makine Eğitimi
Home»CNC Machine Programming»CNC Milling Programming Examples
29 August 2026

CNC Milling Programming Examples

CNC Milling Programming Examples

CNC sample programs and applications you can use in your machine technology coursework. CNC milling programming examples. CNC milling part-machining examples.

  • CNC Milling Programming Examples
    • Drilling and Tapping
      • Sample drilling program
      • Sample program with dwell at the bottom of the hole
      • Sample program for peck drilling on a CNC mill
      • Sample program for tapping on a CNC mill
      • Sample program for drilling equally spaced holes on a bolt circle
      • CNC milling programming example – drilling on a bolt circle
      • Sample drilling program on a CNC mill 2
    • CNC Milling Sample Applications – Pocket Milling
      • Rectangular pocket milling sample program
      • Circular pocket milling sample program
    • CNC Milling Sample Applications – Subprograms

CNC Milling Programming Examples

CNC milling sample programs.
Teachers preparing exams or assignments, and those starting CNC training or operator training, can use these sample programs to reinforce what they’ve learned.

Drilling and Tapping

Sample drilling program

G81 X...Y...Z...R...F...K...
X - Hole coordinate on the X axis
Y - Hole coordinate on the Y axis
Z - Hole depth
R - Rapid retract point
F - Feed rate
K - Repeat count
CNC MILLING drilling and tapping
00070
N0005 G54
N0010 T0505 G94:
N0015 S1500 M03 M08:
N0020 G90 X0 Y0:
N0025 G00 G43 Z50 H03:
N0030 Z5:
N0035 G81 X50 Y50 Z-30 R6 F100:
N0040 X100:
N0045 X150:
N0050 X200
N0055 Y100:
N0060 X150:
N0065 X100:
N0070 X50:
N0075 Y150:
N0080 X100:
N0085 X150:
N0090 X200:
n0095 G80:
N0100 G00 Z100:
N0105 X0 Y0:
N0110 M05 M09
N0115 M30:

Sample program with dwell at the bottom of the hole

G82 X...Y... Z...R... P... F... K...
X - Hole coordinate on the X axis
Y - Hole coordinate on the Y axis
Z - Hole depth
R - Rapid retract point
P - Dwell time at the bottom of the hole (milliseconds)
F - Feed rate
K — Repeat count
CNC milling programming - dwell at bottom of hole
00080
N0005 G54:
N0010 T0505 G94
N0015 S1500 M03 M08:
N0020 G90X0 Y0:
N0025 G00 G43 Z50 H03:
N0030 Z5:
N0035 G82 X50 Y50 Z30 R5 P1000 F100:
N0040 X100:
N0045 X150:
N0050 X200:
N0055 Y100:
N0060 X100:
N0065 Y150:
N0070 X100:
N0075 X150:
N0080 X200:
N0085 G80:
N0090 G00Z100:
N0095 X0 Y0:
N0100 M05 M09:
N0105 M30:

Sample program for peck drilling on a CNC mill

Explanation of the letters in the CNC milling program example: 

G83X... Y... Z... R... Q...F... K... X - Hole coordinate on the X axis Y - Hole coordinate on the Y axis Z - Hole depth R - Rapid retract point Q - Peck amount F - Feed rate K - Repeat count

sample program for peck drilling on a CNC mill
00090:
N0005 G54:
N0010 T0505 G94:
N0015 S1500 M03 M08:
N0020 G90X0 Y0:
N0025 G00 G43 Z50 H03:
N0030 Z5: N0090 X200
N0035 G81 X50 Z-30 R5 Q5 F100:
N0040 X100:
N0040 X150:
N0050 X200:
N0055 Y100
N0060 X150:
N0065 X100:
N0070 X50:
N0075 Yİ 50
N0080 X100:
N0085 X150:
N0090 G80:
N0100 G00Z100:
N0105 X0 Y0:
N0110 M05 M09:
N0115 M30:

Sample program for tapping on a CNC mill

Explanation of the letters in the CNC milling tapping program example: G84 X...Y...Z...R...P...F...K
X: Hole coordinate on the X axis
Y: Hole coordinate on the Y axis
Z: Thread length
R: Rapid retract point
P: Dwell time at the end of the thread
F: Thread pitch
K: Repeat count
sample program for tapping on a CNC mill
00090
N0005 G54:
N0010 T0808 G94:
N0015 S200 M03 M08:
N0020 G90 X0 Y0:
N0025 G00 G43 Z50 H03:
N0030 Z5:
N0035 G84 X50 Y50 Z-30 R5 P100 F1:
N0040 X100:
N0045 X150:
N0050 X200:
N0055 Y100:
N0060 X150:
N0065 X100:
N0070 X50:
N0075 Y150:
N0080 X100:
N0085 X150:
N0090 X200:
N0095 G80:
N0100 G00 Z100:
N0105 X0 Y0:
N0110 M05 M09:
N0115 M30:

Sample program for drilling equally spaced holes on a bolt circle

00110:
M0005 G54:
M0010 T0101 G94:
N0015 S1800 M03 M08:
N0020 G90X0 Y0:
N0025 G00G43 Z50 H01:
N0030 Z5:
N0035 G81 X50 Y75 Z30 R5 F150:
N0040 G34X125 Y100 N10:
N0045 G00Z50:
N0050 G80:
N0055 G00X0 Y0:
N0060 G80:
N0065 M05 M09:
N0070 M30:
cnc milling part machining examples

Explanation of the letters in the CNC milling bolt-circle drilling program example:
I – Distance of the circle center from the origin on the X axis
J – Distance of the circle center from the origin on the Y axis
N – Number of holes

CNC milling programming example – drilling on a bolt circle

Sample program to drill the Ø24 holes on the part shown below to a depth of 16mm

O1453 (ORNEK11)
N010 G91 G28 X0 Y0 Z0
N020 M06 T01
N030 M03 S1000
N040 G90 G54 G43 H1
N050 G52  X100 Y100
N060 G00 X0 Y0
N070 G00 Z5
N080 G16
CNC milling programming examples, hole milling
N090 G81 X80 Y45 Z-16 R2 F200
N100 Y135
N110 Y225
N120 Y315
N130 G15
N140 G52 X300 Y100
N150 G00 X0 Y0
N160 G16
N170 G81 X80 Y45 Z-16 R2
N180 Y135
N190 Y225
N200 Y315
N210 G15
N220 G28 Z0
N230 M30

Sample drilling program on a CNC mill 2

In the part shown below, the hole in the middle will be drilled with a 12mm bit, and the holes at the edges with a 6mm bit. Hole depth is 15 mm. Write the CNC program accordingly.

O1234 (ÖRNEK1);
N00 G90 G54 G40 G80 G21
N010 M6 T1 (12 DRILL)
N020 M03 S1000
N030 G00 X0 Y0
N040 Z5 G43 H1
N050 G01 Z-15 F400
N060 G28 Z0
N070 M6 T2 (6 DRILL)
N080 M03 S1600
N090 G00 X-22 Y -17
N100 Z5 G43 H2
N110 G01 Z-15 F400
N120 G00 Z5
N130 Y17
N140 G01 Z-15
N150 G00 Z5
N160 X22
N170 G01 Z-15
N180 G00 Z5
N190 Y-17
N200 G01 Z-15
N210 G28 Z0
N220 M05
N230 M30
sample drilling program on a CNC mill

CNC Milling Sample Applications – Pocket Milling

Rectangular pocket milling sample program

CNC milling sample programs, pocket milling
X - X-axis coordinate of the pocket's bottom-left corner
Y - Y-axis coordinate of the pocket's bottom-left corner
L - Pocket length along the X axis (Length)
W - Pocket length along the Y axis (Width)
Z - Pocket depth
R - Rapid approach distance
D - Side-shift amount for the cutter on the next pass
Q - Plunge depth per pass along the Z axis (Depth)
F - Cutting tool feed rate (Feed)
G24 X... Y... L... W... Z... R... Q... D... F...
T0303 - 12 mm end mill
00050;
N0005 G54
N0010T0303 G94:
N0015 S1500 M03 M08;
N0020 G90 X0 Y0;
N0025 G00 G43 Z50 H03:
N0030 Z5;
N0035 G 24 X20 Y20 L80 W162 Z 10 R3 Q6 D3 F125;
N0040 G24 X120 Y20 L110 W50 Z-10 R3 Q5 D3 F125:
N0045 G24 X120 Y90 L110 W92 Z-10 R3 Q6 D3 F125;
N0050 G00Z100;
N0055 XO Y0; N0060 M05 M09; N0065 M30:

Circular pocket milling sample program

O0060
N 0005 G54
N0010 T0202 G94
N0015 S1500 M03 M08
N0020 G90 X0 Y0
N0025 G00 G43 Z50 H03:
N0030 Z5:
N0035 G25 X35 Y100 I125 J100 Z-10 R3 Q5 D3 F150;
N0040 G00 X125 Y100
N0045 Z-5;
N0040 G25 X75 Y100 I125 J100 Z-20 R-8 Q5 D3 F150
N0050 G00 Z100
N0055 X0 YO;
N0060 M05 M09;
N0065 M30; 
circular pocket milling sample program
Explanation of the letters in the CNC milling circular pocket milling program example:
X – X-axis coordinate of a point on the circle
Y – Y-axis coordinate of a point on the circle
I – Distance of the circle center from the origin on the X axis
J – Distance of the circle center from the origin on the Y axis
Z – Pocket depth
R - Rapid approach distance
D - Side-shift amount for the cutter on the next pass
Q – Plunge depth per pass along the Z axis (Depth)
F – Cutting tool feed rate (Feed) T0202 — 10 mm end mill

CNC Milling Sample Applications – Subprograms

M99 – End of subprogram

Subprograms are written incrementally (G91). Each one starts at the bottom-left corner and ends at the bottom-left corner.

CNC milling program examples 2
CNC milling programming examples 2
CNC milling sample programs 2
CNC milling sample programs 4
CNC milling sample programs 5

Related Posts

G01 Linear Motion with Cutting Cnc code G01 Code. Linear Motion with Cutting modern CNC machines video series The World’s Most Modern CNC Machines Video Series The structure of CNC milling machines The Structure of CNC Milling Machines What the Keys on the CNC Milling Control Panel Mean What the Keys on the CNC Milling Control Panel Mean Fanuc CNC hata kodları Fanuc CNC Error Codes – Fanuc Fault Codes Cnc Freze Atölyesi çalışma talimatı CNC Milling Workshop Operating Instructions G74 CNC drilling code cycle diagram G74 CNC Peck Drilling Cycle Explained CNC G code list beginner guide CNC G Code List and Meanings (Beginner’s Guide)
Share. Facebook Twitter WhatsApp Tumblr Email Telegram Copy Link

Leave A Reply Cancel Reply


Learning to Think: Beginner’s Books on Philosophy
5 Tips for Fuel Economy
  • Contact
  • Terms of Service
  • Privacy & Cookie Policy

Type above and press Enter to search. Press Esc to cancel.