Cost, Tolerances & Reference

G-Code Reference Guide

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.

G-Code Ref — Reference Data

Complete reference tables and engineering data for g-code ref. All values verified against ISO, ANSI, and manufacturer standards.

Why every manufacturer’s starting values differ

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.

Common G-code commands for CNC milling and turning

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.

Frequently asked questions

Are G-codes the same on all CNC machines?

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.

What is the difference between G-code and M-code?

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.

Can I use the same G-code program on a mill and a lathe?

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.

How to use this G-Code Reference Guide

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.

Common mistakes to avoid

Related references

Continue with closely related resources from the machining reference library.

Browse all free CNC machining calculators. Explore our carbide tooling resources for engineers and machinists.

Need carbide tooling for this operation?

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.

What this tooling costs from a Chinese factory

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.

Carbide tooling for this calculation

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.

Send your drawing for a 48-hour quotation → How our China sourcing works →

Global Engineering Directory

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.

Get the Carbide Tooling Reference — free PDF

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 →