G-codes for Fanuc, Haas and Siemens controls, grouped by function — motion, cutter compensation, canned cycles, coordinate systems and program control — with the modal behaviour that catches people out.
Complete reference tables and engineering data for g-code ref. All values verified against ISO, ANSI, and manufacturer standards.
Published starting values are not measurements. They are recommendations, and they differ because each manufacturer optimises for something different — tool life, surface finish, chip control, or spindle power. Two suppliers can quote the same ISO grade and give you cutting speeds 30% apart, and each figure can be right for that supplier’s own geometry, edge preparation and coating.
That is why the number this calculator returns is a starting point, not a setting. Treat the catalogue figure as the middle of a band, then correct it on the first part: if the chips come off blue or the spindle load sits above roughly 80%, come down; if the finish is smeared and the chips are thin and stringy, come up. Write down what actually worked — that shop-specific number beats any published value.
G-codes control motion, coordinate systems, tool compensation, and canned cycles on CNC machines. This reference covers the most-used G-codes across Fanuc, Haas, Mazak, and Siemens controls. Most are standardised by ISO 6983 and RS-274; differences are noted.
Most G-codes are standard across Fanuc, Haas, Mitsubishi, and Siemens controls for basic functions (G00, G01, G02, G03, G17-G21, G40-G42, G54-G59, G90-G91). Canned cycles (G81-G89) are largely standard. Differences appear in advanced functions: probing cycles, polar coordinates, thread repair, and high-speed machining modes vary by control brand.
G-codes control motion and geometry (positioning, feed, coordinates, compensation). M-codes control machine functions: M03 (spindle on CW), M04 (spindle on CCW), M05 (spindle stop), M08 (coolant on), M09 (coolant off), M30 (program end and rewind), M06 (tool change). Think of G for geometry, M for machine.
No. Milling G-codes use X, Y, Z coordinates in a Cartesian system. Turning G-codes use X (diameter), Z (length) with a different coordinate system. Lathe-specific codes: G70 (finishing cycle), G71 (OD roughing cycle), G76 (threading cycle). Turning canned cycles are completely different from milling canned cycles.
Use this reference to look up G-code meanings, syntax, and control-specific notes. G00-G03 cover 90% of motion commands. Canned cycles (G81-G89) handle drilling and tapping. G40-G42 and G43 are essential for precise tool compensation. Always verify G-code support on your specific machine control -- some older controls lack newer G-codes.
Continue with closely related resources from the machining reference library.
Use the calculator freely. If the result points to a tooling or process problem, we can source the exact carbide tooling you need from vetted factories in China. Compare factory-direct pricing.
Before you commit to a spec, it helps to know what the market pays for it. These are real, publicly listed factory prices — not a quotation, and not a guess.
We source the tool families below direct from vetted Chinese factories, matched to the material and tolerance you just worked out. Every batch ships with its material certificate and dimensional record.
Explore more precision machining tools and calculators
WORKING THROUGH G-CODES? Control-side problems that look like programming issues trace back to the tool more often than people expect. See how to confirm a tool before it goes into a machine.
We source carbide cutting tools from China for job shops. We do not own a factory, which is why we can quote your drawing against two or three plants that actually run your material.
Cutting formulas with the units worked through · Speed and feed starting points for all six ISO material groups · How to read a carbide grade past its ISO code. 12 pages.
Or send us a quote you already have — we will benchmark it free →