Printable

Printable CNC Cheat Sheet — G-Codes, M-Codes, Tap Drills

A free printable one-page CNC cheat sheet with every common G-code and M-code, metric tap drills and the key machining formulas. Print or save as PDF.

Pin it next to your machine. Free to share with your team.

G-codes

G00Rapid Positioning
G01Linear Interpolation (Feed Move)
G02Circular Interpolation Clockwise
G03Circular Interpolation Counter-Clockwise
G04Dwell
G05.1AI Contour Control / High-Speed Look-Ahead
G07.1Cylindrical Interpolation
G08Advanced Preview Control (Look-Ahead)
G09Exact Stop (one block)
G10Programmable Data Input (Set Offsets)
G11Programmable Data Input Cancel
G12Circular Pocket Milling CW (Haas) / Polar Interpolation (Lathe G12.1)
G13Circular Pocket Milling CCW (Haas) / Cancel Polar Interpolation (G13.1)
G15Polar Coordinate Command Cancel
G16Polar Coordinate Command
G17XY Plane Selection
G18XZ Plane Selection
G19YZ Plane Selection
G20Inch Input
G21Metric Input
G22Stored Stroke Check On
G23Stored Stroke Check Off
G25Spindle Speed Fluctuation Detection Off
G26Spindle Speed Fluctuation Detection On
G27Reference Position Return Check
G28Return to Reference Point (Machine Home)
G28.1Set Predefined Position (GRBL / LinuxCNC)
G30Return to 2nd/3rd/4th Reference Point
G30.1Set Second Predefined Position (GRBL / LinuxCNC)
G31Skip Function (Probing Move)
G32Thread Cutting (Single Pass, Lathe)
G33Thread Cutting (Spindle-Synchronised Motion)
G34Variable Lead Thread Cutting
G36Automatic Tool Compensation X (Lathe)
G37Automatic Tool Length Measurement
G38.2Straight Probe Toward Workpiece (Stop on Contact, Error if Not)
G38.3Straight Probe Toward Workpiece (No Error)
G39Corner Offset Circular Interpolation
G40Cutter Radius Compensation Cancel
G41Cutter Radius Compensation Left
G41.1Normal Direction Control (Left / Right)
G42Cutter Radius Compensation Right
G43Tool Length Compensation (+)
G43.1Dynamic Tool Length Offset (GRBL / LinuxCNC)
G43.4Tool Centre Point Control (TCPC)
G44Tool Length Compensation (−)
G45Tool Position Offset (Increase)
G49Tool Length Compensation Cancel
G50Max Spindle Speed Clamp (Lathe) / Scaling Cancel (Mill)
G50.1Programmable Mirror Image Cancel
G51Scaling
G51.1Programmable Mirror Image
G51.2Polygon Turning
G52Local Coordinate System
G53Machine Coordinate System (One Block)
G53.1Tool Axis Direction Control
G54Work Coordinate System 1
G54.1Additional Work Coordinate Systems
G55Work Coordinate System 2
G56Work Coordinate System 3
G57Work Coordinate System 4
G58Work Coordinate System 5
G59Work Coordinate System 6
G60Single Direction Positioning
G61Exact Stop Mode
G62Automatic Corner Override
G63Tapping Mode
G64Cutting Mode (Continuous Path)
G65Macro Call (Non-Modal)
G66Modal Macro Call
G67Modal Macro Call Cancel
G68Coordinate System Rotation
G68.2Tilted Working Plane (3+2)
G69Coordinate Rotation Cancel
G70Finishing Cycle (Lathe)
G71Stock Removal in Turning (Roughing Cycle)
G72Stock Removal in Facing
G73Pattern Repeating (Lathe) / High-Speed Peck Drilling (Mill)
G74Left-Hand Tapping (Mill) / Face Peck Drilling (Lathe)
G75Grooving Cycle (Lathe X)
G76Threading Cycle (Lathe) / Fine Boring (Mill)
G80Cancel Canned Cycle
G81Drilling Cycle (Spot Drill)
G82Drilling Cycle with Dwell (Counterbore / Spot)
G83Peck Drilling Cycle (Deep Hole)
G84Tapping Cycle (Right-Hand)
G85Boring Cycle (Feed In, Feed Out)
G86Boring Cycle (Spindle Stop, Rapid Out)
G87Back Boring Cycle
G88Boring Cycle (Dwell, Manual Retract)
G89Boring Cycle (Dwell, Feed Out)
G90Absolute Programming (Mill) / OD Turning Cycle (Lathe)
G90.1Absolute Arc Centre Mode (IJK)
G91Incremental Programming
G92Coordinate System Setting (Mill) / Threading Cycle (Lathe)
G92.1Cancel G92 Offset / Coordinate Preset
G93Inverse Time Feed
G94Feed per Minute (Mill) / Facing Cycle (Lathe)
G95Feed per Revolution (Mill)
G96Constant Surface Speed (CSS)
G97Constant RPM (CSS Cancel)
G98Initial Plane Return (Mill) / Feed per Minute (Lathe)
G99R-Plane Return (Mill) / Feed per Revolution (Lathe)
G101Mirror Image On (Haas)
G103Limit Block Look-Ahead (Haas)
G107Cylindrical Mapping / Interpolation
G112Polar Coordinate Interpolation On (Lathe)
G1413D Cutter Compensation (Haas)
G1435-Axis Tool Length Compensation (Haas)
G150General Purpose Pocket Milling (Haas)
G154Additional Work Offsets (Haas)
G187Smoothness / Accuracy Control (Haas)
G234Tool Centre Point Control (Haas TCPC)
G254Dynamic Work Offset (Haas DWO)
G268Feature Coordinate System (Haas Tilted Plane)

M-codes

M00Program Stop
M01Optional Stop
M02End of Program
M03Spindle On Clockwise
M04Spindle On Counter-Clockwise
M05Spindle Stop
M06Tool Change
M07Mist Coolant On
M08Flood Coolant On
M09Coolant Off
M10Clamp / Brake On (builder specific)
M11Clamp / Brake Off (builder specific)
M13Spindle CW + Coolant On (builder specific)
M14Spindle CCW + Coolant On (builder specific)
M19Spindle Orientation
M23Thread Chamfer (Pull-Out) On — Lathe
M24Thread Chamfer (Pull-Out) Off — Lathe
M29Rigid Tapping Mode (Fanuc)
M30Program End and Rewind
M31Chip Conveyor Forward (Haas)
M33Chip Conveyor Stop (Haas)
M41Low Gear
M42High Gear
M48Feed/Speed Override Enable
M49Feed/Speed Override Disable
M50Pallet Change Sequence (Haas)
M60Pallet Change / Automatic Work Change
M62Digital Output On, Synchronised (LinuxCNC)
M66Wait for Input (LinuxCNC)
M83Auto Air Jet On (Haas)
M84Auto Air Jet Off (Haas)
M88Through-Spindle Coolant On (Haas)
M89Through-Spindle Coolant Off (Haas)
M95Sleep Mode (Haas)
M96Jump if Input Is Zero (Haas)
M97Local Subprogram Call (Haas)
M98Subprogram Call
M99Subprogram Return / Loop
M109Interactive User Input (Haas)
M198Subprogram Call from External Memory

Metric tap drills

M2×0.41.6 mm
M2.5×0.452.05 mm
M3×0.52.5 mm
M3.5×0.62.9 mm
M4×0.73.3 mm
M5×0.84.2 mm
M6×15 mm
M8×1.256.8 mm
M10×1.58.5 mm
M12×1.7510.2 mm
M14×212 mm
M16×214 mm
M18×2.515.5 mm
M20×2.517.5 mm
M22×2.519.5 mm
M24×321 mm

Formulas

RPMVc × 1000 / (π × D)
FeedRPM × z × fz
Tap feedRPM × pitch
Turning Raf² / (32 × r)
Tap drillD − P
Chamfer Z(D/2) / tan(angle/2)