Complete List Of CNC G Codes
G code, sometimes called g-code, is a simple programming language for CNC machines.
Listed below are the codes that use the G word. These codes are preparatory commands.
This means that they set modes or prepare the machine for various actions.
We have put together a complete list of G codes for your reference.
Not all codes are used often.
Below is a list of G codes. They have been organized into group types based on how the machine reacts to the individual code.
If you are new to G code, you should review the code groups and compare the codes within a single group.
You will quickly see they handle the same function, such as one code to turn something on and one code to turn something off.
This makes learning the codes twice as easy.
CNC Movement and Travel
G00 - Rapid Travel
Moves the CNC around at the maximum possible speed. Often called rapid traverse.
Learn more about the G00 code
G01 - Linear Interpolation
Move the CNC in a straight line to a specific location. The speed of this movement is determined by the feed rate (F).
Learn more about the G01 code
G02 - Circular Interpolation, Clockwise
Move the CNC to specific location along along a specified arc or radius traveling clockwise. The speed of this movement is determined by the feed rate (F).
Learn more about the G02 code
G03 - Circular Interpolation, Counterclockwise
Move the CNC to a specific location along a specified arc or radius traveling counterclockwise. The speed of this movement is determined by the feed rate (F).
Learn more about the G03 code
G04 - Dwell
Tells the CNC not to move for a certain amount of time.
Learn more about the G04 code
Plane Selection
G17 - XY Plane Selection
The vast majority of movement in CNC programs will be relative to the XY plane. Plane selection affects how G02, G03, cutter compensation and some canned cycles are handled.
G18 - XZ Plane Selection
Plane selection affects how G02, G03, cutter compensation and some canned cycles are handled. G18 tells the machine you are machining radii around the Y axis.
G19 - YZ Plane Selection
Plane selection affects how G02, G03, cutter compensation and some canned cycles are handled. G19 tells the machine you are machining radii around the Z axis.
Unit Modes
G20 - Inch Mode
All size and location commands will be in inches until changed.
Learn more about the G20 code
G21 - Metric Mode
All size and location commands will be in millimeters until changed.
Learn more about the G21 code
Compensation Codes
G40 - Cancel Cutter Compensation
Turns off any cutter compensation modes (G41 or G42).
Learn more about the G40 code
G41- Cutter Compensation Left
Shifts the machine tool path to the left based on the radius of the cutting tool.
Learn more about the G41 code
G42 - Cutter Compensation Right
Shifts the machine tool path to the right based on the radius of the cutting tool.
Learn more about the G42 code
G43 - Tool Length Compensation
Adjusts a tool’s location based on a specified tool height (H) offset.
Learn more about the G43 code
G49 - Tool Length Compensation Cancel
Turns off the tool length compensation set by a G43 or G44 command.
Learn more about the G49 code
Work Offsets
G54 - Work Offset 1
Sets a specific location in the CNC as the zero location for the program.
Learn more about the G54 code
G55 - Work Offset 2
Sets a specific location in the CNC as the zero location for the program.
Learn more about the G55 code
G56 - Work Offset 3
Sets a specific location in the CNC as the zero location for the program.
Learn more about the G56 code
G57 - Work Offset 4
Sets a specific location in the CNC as the zero location for the program.
Learn more about the G57 code
G58 - Work Offset 5
Sets a specific location in the CNC as the zero location for the program.
Learn more about the G58 code
G59 - Work Offset 6
Sets a specific location in the CNC as the zero location for the program.
Learn more about the G59 code
Canned Cycles
G73 - High-Speed Peck Drilling Canned Cycle
Peck drill a hole by repeatedly drilling, then retracting a small amount, then drilling deeper. Often used to break up chips when drilling.
Learn more about the G73 code
G74 - Left-Hand Tapping Canned Cycle
A tapping cycle for left-hand or reverse threads. The spindle must be running in reverse during this cycle. The machine will feed to the bottom of the hole and then reverse the spindle direction and back out of the hole.
Learn more about the G74 code
G76 - Fine Boring Canned Cycle
Bores a hole then stops the spindle, retracts the tool from the surface and rapid retracts the tool out of the hole.
G81 - Standard Drilling Cycle
Drills a hole then rapid retracts out of the hole.
Learn more about the G81 code
G82 - Standard Drill with Dwell
Drills a hole, dwells at the bottom of the hole for a set amount of time and then rapid retracts out of the hole.
Learn more about the G82 code
G83 - Deep Hole Peck Drilling Cycle
The machine will drill in pecks while rapid retracting out of the hole between each peck to help clear chips from the drill.
Learn more about the G83 code
G84 - Right-Hand Tapping Cycle
The standard tapping cycle with the spindle running clockwise. The CNC will feed to the bottom of the hole and then reverse the spindle direction and back out of the hole.
Learn more about the G84 code
G85 - Reaming Cycle
The machine will feed to the bottom of the hole and then rapid retract out.
Learn more about the G85 code
G86 - Boring Cycle
The machine will feed to the bottom of the hole and then rapid retract out. The tool is not pulled away from the surface which can leave a tool mark on the hole.
Learn more about the G86 code
G87 - Back Boring Cycle
Bores a hole from bottom to top. This is the reverse direction of the G86 code.
G88 - Boring Cycle with Dwell
Bores a hole and then dwells at the bottom for a set amount of time.
G89 - Back Boring Cycle with Dwell
The machine will feed to the bottom of the hole, pause for a set amount of time and then rapid retract out. The tool is not pulled away from the surface which can leave a tool mark on the hole.
Cancel Codes
G50 - Cancel Scaling
Turns off scaling mode.
G80 - Canned Cycle Cancel
Cancels any active canned cycles for drilling, boring, tapping, etc.
Learn more about the G80 code
Positioning Modes
G90 - Absolute Mode
All movement locations are relative to a fixed zero such as the work offset (G54, G55, etc.) or machine home location.
Learn more about the G90 code
G91 - Incremental Mode
All movement locations are relative to the machine’s current position.
Learn more about the G91 code
Speeds and Feeds
G94 - Feed per Minute Mode
Sets the feed rate to units (inches/mm) per minute. The tool will move at a set rate.
G95 - Feed per Revolution Mode
Sets the feed rate to units (mm/inches) per revolution. The tool will move a set rate for every spindle rotation.
G96 - Constant Surface Speed
The spindle speed will vary to maintain the same surface speed of the material.
G97 - Constant Spindle Speed
The spindle will operate at a consistent RPM.
Plane Return
G98 - Return to Initial Plane
After a canned cycle the tool will retract to the start of the canned cycle.
Learn more about the G98 code
G99 - Return to Rapid Plane
After a canned cycle the tool will retract to a specified location. Can be useful for avoiding workholding fixtures.
Learn more about the G99 code
Lesser Used G Codes
G09 - Exact Stop Check (Non-modal)
Causes the machine to come to a stop after each command. Useful for making sharp corners. It causes the machine to stop after executing the current line.
G10 - Programmed Offset Input
Adjusts offset values. Can change work offset, tool length offset and/or cutter compensation offsets.
G22 - Stored Stroke Limit
Turns on a set safety zone that will cause the machine to alarm out if it enters.
G23 - Stored Stroke Limit Cancel
Turns off the stored safety zone.
G27 - Zero Return Check
Rarely used. This command checks to see that the machine has moved to the zero return position.
G28 - Zero Return
The machine will move to a specified location and then to the zero return (home) position.
Learn more about the G28 code
G29 - Return From Reference Position
The machine will move to the position referenced in the last G28 command. It will then move to the location referenced with the G29 command.
G30 - Second Position Zero Return
Similar to G28 the machine will move to a specified location and then will move to a secondary reference point in the machine such as a tool changer location.
G31 - Skip Function
Often used with probing, it is used to move the probe until it hits an object.
G44 - Negative Tool Length Compensation
Rarely used. Adjusts a tool’s location based on a specified height (H) offset in the opposite of the normal direction.
G45 - Single Offset Increase
Rarely used.
G46 - Single Offset Decrease
Rarely used.
G47 - Double Offset Increase
Rarely used.
G48 - Double Offset Decrease
Rarely used.
G51 - Scaling
Scales the machined part size by a scaling factor.
Scaling factors >1 make it bigger. Scaling factors <1 make it smaller.
G52 - Temporarily Shift Program Zero
Shifts the program zero location based on a location specified with the command.
G53 - Return to Machine Zero Position
Rapid moves the CNC to the machine reference position.
G60 - Single Direction Move
Forces the machine to approach each XY location from the same direction. Helps eliminate location errors caused by machine backlash.
G61 - Exact Stop Check (Modal)
The machine will come to a stop after each line of code.
G64 - Normal Cutting Mode
Cancels both G60 and G61 modes.
G65 - Custom Macro Call
A macro is similar to a subprogram but it allows you to use variables in the program.
G66 - Custom Macro Modal Call
Makes the machine call a macro, similar to G65, with every new location given until turned off.
G67 - Cancel Custom Macro Modal Call
Cancels any active custom macro modal calls.
G68 - Coordinate Rotation Mode
Rotates the machine coordinates at a given angle around a specified location.
G69 - Cancel Coordinate Rotation Mode
Turns off coordinate rotation mode.
G92 - Program a Work Offset
Sets a work offset based on a specific location in the machine.
Frequently asked questions
How many G codes are there?
We listed 70 G codes in our list alone but in reality there are many more.
Some will have different meanings on lathes vs mills. Also, different CNC controller manufacturers will include their own special codes. For example, some will have codes such as G103 or they will switch the meaning of a code.
You should always know how your individual machine will react to a specific code.
What other types of codes are used in CNC programming?
There are numerous codes other than G codes used in CNC programming.
There are codes for locations, speeds, feeds and machine operations among others. For the most common codes, review our posts on CNC codes and M codes.
Who needs to know G code?
Anyone who works with a CNC machine would benefit from understanding G code.
While it may not be a requirement for their job depending on where they work, these positions would benefit from understanding G codes:
- CNC operator
- CNC setup
- CNC programming
- CNC machinist
Is learning G code hard?
Learning G code can be a daunting task when there are so many codes to understand.
While it is true that there are a lot of codes that can be used, you should know that most shops will only use a small selection of codes which cuts down the number you need to understand before you are up to speed.
Don’t be overwhelmed. Figure out which codes are the most commonly used ones and start your learning there.
Leave a Comment Cancel reply
Comment
Name Email WebsiteMachinist Guides is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com.
PH +1 603 287 8259
21 durham aveclaremont, Nh 03743
© 2025 Machinist Guides
PRIVACY POLICY Manage Consent To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions. Functional Functional Always active The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network. Preferences Preferences The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user. Statistics Statistics The technical storage or access that is used exclusively for statistical purposes. The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you. Marketing Marketing The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.- Manage options
- Manage services
- Manage {vendor_count} vendors
- Read more about these purposes
- {title}
- {title}
- {title}
Privacy Policy
Từ khóa » G66 Cnc
-
How Does G66 Work? - CNC Concepts, Inc.
-
G66 - CNC Machining - Practical Machinist
-
G66 Macro Modal Call Simplify Your Programming CNC ... - YouTube
-
Calling Custom Macros Through Modal Commands
-
G66 Macro Parameters - CNC Zone
-
2 Modal Paramacro Call (g66) | Rockwell Automation 8520-MUM 9 ...
-
Make Your Own G81 Drilling Cycle Through Fanuc Macro And G66 ...
-
G Codes For Machining Centers - Carbide Depot
-
G-Code Lists - MS-Tech Corporation
-
Basic Knowledge Of NC Macro Program
-
MATRIX 5.7" KCG057QV1DB-G66 MODULE TFT LCD KYOCERA
-
CNC Programming Using Fanuc Custom MacroB S K Sinha McGraw ...