Skip to main content
Machinist Free Pro Features Available

CNC G-Code & M-Code Quick Reference — Searchable Mill & Lathe Guide

Look Up Common G-Codes and M-Codes with Syntax Examples

Free searchable G-code and M-code reference with ~45 G-codes and ~15 M-codes. Each includes plain-English description, syntax example, and mill vs lathe applicability. Controller-agnostic content covers ANSI/ISO standard codes.

\n

Includes search, code type filter, machine filter, category filter, expandable code cards with parameter descriptions, and quick-find shortcuts for common operations.

Pro Tip: Memorize 10 codes and you can read 90% of any program: G00 (rapid), G01 (linear feed), G02/G03 (circular), G28 (home), G43 (tool length comp), G54 (work offset), G80 (cancel cycle), G81 (drill), M03/M05 (spindle), M30 (end program).

PREVIEW All Pro features are currently free for a limited time. No license key required.

CNC G-Code Quick Reference

How It Works

  1. Search or Browse

    Type a code number (G81) or keyword (drill, coolant) in the search box, or browse the full categorized list.

  2. Filter by Type or Machine

    Show only G-codes or M-codes. Further filter by Mill, Lathe, or Both.

  3. Expand Code Details

    Click any code card for full syntax format, parameter definitions, and usage notes.

  4. Review Syntax Examples

    Every code includes real-world syntax examples with all required parameters.

  5. Use Quick-Find Shortcuts

    Links to most-needed codes: Drill, Peck Drill, Tool Change, Cutter Comp, etc.

Built For

  • CNC operators looking up unfamiliar codes in existing programs
  • Beginning programmers learning G-code and M-code vocabulary
  • Setup technicians verifying canned cycle syntax
  • Manual programmers writing G-code at the control
  • Instructors teaching CNC programming fundamentals
  • Maintenance technicians reading programs to diagnose machine issues

Features & Capabilities

~45 G-Codes

Motion, coordinate system, canned cycles, cutter compensation, and work coordinate codes.

~15 M-Codes

Program control, spindle, tool change, coolant, subprogram calls.

Controller-Agnostic

ANSI/ISO standard codes common to Fanuc, Haas, Mazak, and other platforms.

Mill vs Lathe Tags

Each code tagged Mill, Lathe, or Both for relevance filtering.

Search and Filter

Full-text search plus category and machine type filters.

PDF Export

Export as branded PDF for machine-side posting or training binders.

Frequently Asked Questions

Core ANSI/ISO codes (G00/G01/G02/G03, G28, G43, G54, G80-89, M03-09, M30) are standardized across platforms. Manufacturers add proprietary codes for advanced features.
G00 moves at maximum machine speed (non-cutting). G01 moves at programmed feed rate (cutting). Never use G00 for cutting moves.
R is the reference plane — the Z height where rapid-to-feed transition occurs. Set slightly above the workpiece surface (0.050-0.100").
G90 is absolute (coordinates from work zero). G91 is incremental (coordinates from current position). Most programs use G90 for clarity.
Disclaimer: Descriptions based on ANSI/ISO standards and common implementations. Specific syntax may vary by control manufacturer and model. Always verify in your machine's programming manual. Test new programs in single-block mode.

Learn More

Machinist

CNC G-Code Basics — What Every Machinist Should Know

Foundational CNC G-code and M-code knowledge for machine shop operators. Code structure, modal groups, program flow, and common codes for mills and lathes.

Related Tools

Machinist Live

Chip Load Calculator

Calculate chip load per tooth for milling, drilling, and turning. Forward and reverse modes with material-specific recommendations, chip thinning factor, and MRR. Metal and wood modes.

Machinist Live

Thread Pitch Identifier

Identify unknown threads from caliper measurements. Cross-references UNC, UNF, Metric ISO, NPT, BSP, and ACME thread standards with tolerance matching and confidence scoring.

Machinist Live

Tolerance & Fit Calculator

ISO 286 tolerance zone calculator for shaft/hole fits. Calculates clearance, transition, and interference fits with visual tolerance zone diagram and common fit presets (H7/g6, H7/h6, H7/p6, etc.).