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.
\nIncludes search, code type filter, machine filter, category filter, expandable code cards with parameter descriptions, and quick-find shortcuts for common operations.
Look up GD&T symbols for drawing interpretation
GD&T Quick Reference →Calculate speeds and feeds
Speeds & Feeds Calculator →Generate a CNC job setup sheet
Job Setup Sheet Generator →Calculate surface finish from feed rate
Surface Finish Calculator →How It Works
-
Search or Browse
Type a code number (G81) or keyword (drill, coolant) in the search box, or browse the full categorized list.
-
Filter by Type or Machine
Show only G-codes or M-codes. Further filter by Mill, Lathe, or Both.
-
Expand Code Details
Click any code card for full syntax format, parameter definitions, and usage notes.
-
Review Syntax Examples
Every code includes real-world syntax examples with all required parameters.
-
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
Learn More
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
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.
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.
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.).