Fanuc G21 G‑Code Example: Millimeter‑Based CNC Lathe Programming
Fanuc G21 Measuring in Millimeter or Programming in Millimeter. CNC gives us the flexibility to program in metric system or in inches system.
Fanuc G21 G-code changes cnc to metric system.
So here is another cnc programming example, for beginner level cnc programmers. This cnc programming example uses Fanuc G21 G-code.

Fanuc G21 Programming Example
N1 T0505 N2 G92 S1500 M03 N3 G21 G96 S150 N4 G00 X0 Z5 N5 G42 G01 Z0 G95 F0.3 N6 G01 X23.293 N7 G01 X40 Z-30 N8 G01 X58.146 Z-42 N9 G01 X70 N10 G40 G00 X100 Z100 G97 S500
CNC Machine
- Master CNC Programming: Fanuc G71 Rough Turning & G70 Finish Cycle Example
- Beginner-Friendly Lathe CNC Programming Guide
- Fanuc CNC Programming Guide: A Simple, Feature‑Rich Example
- Step‑by‑Step CNC Lathe Programming Guide: Chamfer, Taper, Groove & Arc
- Fanuc G20: Mastering Inch-Based CNC Programming – Practical Example
- Beginner-Friendly Fanuc CNC Lathe Programming Example – Straight, Taper, and Arc Cuts
- Simple CNC Lathe Programming: Inch-Based Example for Beginners
- Mastering C‑Axis Lathe Programming with Live Tooling on Haas CNC
- CNC Lathe Programming: Simple Contour Turning with Radius Example
- CNC Lathe Programming: Using Radius Dimensioning for X‑Axis Cuts