Comprehensive CNC & 3D Printing Command Reference
Moves the machine to a specified position at maximum speed. Not intended for cutting operations. Example: G0 X100 Y50 Z10 moves to position X100, Y50, Z10 at rapid speed.
Moves the machine in a straight line at a controlled feed rate. Used for cutting and printing operations. Example: G1 X50 Y30 F1500 moves to X50, Y30 at 1500 mm/min feed rate.
Creates a clockwise arc or circle. Requires endpoint and center point or radius. Example: G2 X20 Y20 I10 J10 F500 creates a clockwise arc.
Creates a counter-clockwise arc or circle. Similar to G2 but in opposite direction. Example: G3 X30 Y10 I5 J-5 F500 creates a counter-clockwise arc.
Pauses all machine motion for a specified duration. Example: G4 P500 pauses for 500 milliseconds or G4 S2 pauses for 2 seconds.
Selects the XY plane for arc movements. This is the default plane for most operations and is standard for 2D machining and 3D printing.
Selects the XZ plane for arc movements. Commonly used for lathe operations or vertical milling.
Selects the YZ plane for arc movements. Used for specialized machining operations on the YZ face.
Sets the measurement units to inches. All subsequent coordinates are interpreted as inches. Example: G20 then G1 X1.5 moves 1.5 inches.
Sets the measurement units to millimeters. This is the standard for most 3D printers and modern CNC machines. Example: G21 then G1 X50 moves 50mm.
Moves all axes to their home/reference position. Example: G28 homes all axes, or G28 X Y homes only X and Y axes.
All coordinates are relative to the origin (0,0,0). This is the default mode. Example: G90 G1 X10 moves to position X=10 from origin.
All coordinates are relative to the current position. Example: G91 G1 X10 moves 10 units from the current X position.
Sets the current position to specified values without moving. Example: G92 X0 Y0 Z0 defines the current position as origin.
Retracts the filament to prevent oozing during travel moves. Used in firmware retraction. Example: G10 retracts filament by preset amount.
Reverses the retraction, pushing filament back for printing. Example: G11 unretracts filament to resume printing.
Initiates automatic bed leveling/probing sequence. Creates a mesh of the bed surface for compensation. Example: G29 starts auto bed leveling.
Applies tool length compensation. Example: G43 H1 applies the offset stored in H1 to the Z-axis for the current tool.
Temporarily uses machine coordinates instead of work coordinates for one command. Example: G53 G0 Z0 moves to machine Z zero.
Selects one of six different work coordinate systems. G54 is the default. Example: G55 switches to work coordinate system 2.
Feed rate is specified as the inverse of time required to complete the move. Rarely used in standard operations.
Feed rate is in units per minute (default mode). Example: G94 then F500 means 500 mm/min or inches/min.
Feed rate is in units per spindle revolution. Used in lathe operations. Example: G95 F0.1 feeds 0.1mm per revolution.