CNC G codes are the numerical command language that tells a CNC machine tool exactly how to move, cut, and stop. Each code—G00, G01, G02, G03, G43, and others—maps to a specific machine action such as rapid positioning, linear cutting, arc interpolation, or tool offset. These codes sit at the heart of every CNC 가공 프로그램.
Get them right, and your toolpath, feed rate, and part geometry all follow the intended plan. Get them wrong, and you risk a crash, a scrapped part, or a dimension that misses tolerance.
Operators, process engineers, and buyers evaluating CNC mechanical parts read G code daily. Confusion around modal states, tool offsets, or coordinate systems remains one of the top sources of setup errors on the shop floor. YPMFG supports teams that need clarity on how these codes drive the cutting process and how they affect part quality.
What Are CNC G Codes?
G codes are the motion and function commands embedded in a CNC 프로그램. They work alongside M codes (machine functions like spindle on/off) and S codes (spindle speed). Together, they form the complete instruction set the controller executes line by line.
Each G code falls into two categories:
Non-modal: The command only applies to the line where it appears.
Modal: The command stays active until the next G code in the same group replaces it.
This distinction matters because a missing modal G code silently defaults to the last active value, which can send the tool along an unexpected path. In CNC 가공, the most frequently used codes control linear motion, arc paths, and tool changes. Understanding which group each code belongs to prevents collisions and keeps the program running as intended.

Key G Codes in CNC 가공
The table below covers the codes you will see most often on a three- or five-axis CNC 가공기.
| G 코드 | 함수 | 일반적인 용도 |
|---|---|---|
| G00 | Rapid move | Positioning the tool between cuts |
| G01 | 선형 이송 | Straight-line cutting at a programmed feed |
| G02 / G03 | Clockwise / counter-clockwise arc | Circular features, fillets, pockets |
| G28 | 참조로 돌아가기 | Safe home position between parts |
| G43 | Tool length offset | Compensate for each tool’s actual length |
| G54–G59 | Work coordinate system | Set the part origin for the fixture |
After reading a program, the single most useful habit is to verify that every G43 call matches the tool table entry. A mismatch here shifts the entire Z-axis and can push the part out of spec by the full offset error.
Common G Code Mistakes That Affect Part Quality
Three errors account for most scrap and machine alarms on the floor:
Wrong modal state: A G01 from a previous block carries into a new operation, so the tool feeds instead of rapids into the cut.
Missing tool offset (G43): The controller uses a zero length, and the tool plunges too deep.
Incorrect work coordinate (G54 vs. G55): The part origin shifts, and every X and Y dimension is off by the fixture offset.

Each of these is avoidable with a pre-run simulation or a dry-cut pass at reduced feed. YPMFG recommends a program audit before any new job goes to production. Send your G code and part drawing, and our engineering team will cross-check the toolpath, offsets, and coordinate calls against your tolerance stack-up.
How G Codes Influence Cycle Time and Tolerance
Feed rate, controlled by the F value on a G01 line, sets how fast the tool advances through material. Arc codes (G02/G03) determine how the controller interpolates a curve. The tighter the chord error you allow in your controller settings, the more segments the controller generates, and the longer the cycle becomes.
In many cases, a CNC mechanical part that holds tight tolerances requires smaller arc segments and a lower feed on finishing passes. The trade-off is more machine time in exchange for a better surface finish.
When you specify a part for outsourcing, noting which G code strategies you expect—high-speed roughing with G01, finish with a smaller step-over—helps the shop match your quality bar without over-machining.
Common Questions About CNC G Codes
What is the difference between G00 and G01?
G00 moves the tool to the target position at maximum rapid speed. G01 moves at a programmed feed rate, which is the actual cutting speed. Use G00 for non-cutting moves and G01 for material removal.
Are G codes the same on every CNC machine?
The ISO standard defines the core set, but each controller (Fanuc, Siemens, Haas,Mazak) adds proprietary extensions. Always check the specific machine’s G code reference before writing or porting a program.
How do I read a line like “G01 X10.5 Z-3.2 F120”?
The tool feeds linearly to X10.5 and Z-3.2 at 120 mm/min. X and Z are the axis targets, and F is the feed rate. The modal G01 stays active for subsequent lines until a different G code in the same group replaces it.
Can I just call a CNC shop and skip reading G codes?
For simple single-operation parts, yes. For multi-operation programs with tight tolerances, reviewing the G code yourself—or having an engineer on your team check it—catches errors before metal is cut. A short G code program review is the lowest-cost insurance you can add before a production run.
Making a Better Decision on Your Next CNC Job
G codes are not just lines of numbers. They encode your toolpath, your tolerance strategy, and your cycle-time expectations. The shop that writes clean, well-commented G code and catches modal traps before the first cut delivers a part that lands in spec the first time.
If you have a part drawing or an existing G code program you want checked, send the files to YPMFG for an 엔지니어링 검토. Our team will flag offset mismatches, verify coordinate systems, and confirm that the toolpath matches your drawing before you commit to a production run.




