G74 CNC Code Explained: An Easy Intro for Beginners [Left Hand Tapping]

What does a G74 code do?

A G74 command activates the reverse, or left-handed tapping canned cycle.

Tapping is threading the female portion of a mating pair. Basically, this means you are creating the thing that will be screwed into.

Tapping is done by rotating the spindle, which holds the tap, down through the hole until it reaches the desired depth (bottom of the hole). 

three different taps used for creating internal threads with a CNC machine

When reverse tapping, the spindle should always be set to the counterclockwise direction with the M04 command.

Once at the bottom of the hole, the spindle will change directions and reverse out of the hole.

The G74 code is also used for peck tapping. Peck tapping is similar to peck drilling where the machine will tap in steps.

For instance, if your peck depth was 0.1” then the machine would feed down 0.1” and then back up. Then the machine would feed down to 0.2” and back up. Rinse and repeat going 0.1” lower with each peck.

Learn CNC Programming – It’s Easier Than You Think!

Learning G Code doesn’t have to be difficult…

If you know what to focus on.

Join our simple, easy-to-follow course, “G Code Made Easy: CNC Programming for Beginners“. We walk you through all the important codes – with simple explanations and real-world examples.

Want to become a super-skilled CNC programmer? Join now to take the shortcut to becoming a G Code Master today!

Make Learning G Code Easy

Other codes used with the G74 code

When using a G74 code you need to consider all the aspects that control the tapping process, these are:

The retracting value (R) or clearance level refers to the plane perpendicular to the Z-axis where the tool can move safely from one hole to another. 

The R value should be set so the machine will clear any and all obstacles including clamps, fixtures and the part itself.

G74 code programming format

The format for using a G74 command is shown below:

G98 (or G99) G74 X2.0 Y3.0 R1.0 Z-5.0 F25.0

It would be easy to assume that the Z location is the location of the start of the hole. In reality, it is the Z location for the bottom of the hole tapping movement.

Keep in mind that the X and Y coordinates of the hole are not usually in the same line as the G74 command.

In most programs you will see them in this format:

X2.0 Y3.0

G98 G74 R1.0 Z-5.0 F25.0

The program first identifies the coordinates of the hole and then starts the tapping process.

How to cancel a G74 code?

The G74 code is canceled with the G80 command.  

If the G74 code is not canceled, the machine will try to tap a hole at every new location given in the program.

When to use a G74 code?

The G74 code is used when you want to tap an existing hole in a part.

Never use the G74 command to drill a hole. 

This operation is only meant to remove the material that will form the threads of the holes, not create the hole as well.

What to think when using a G74 code?

Speeds and feeds

You will need to set the spindle speed before using the G74 cycle. When using G74, the spindle should always be moving counterclockwise through the use of an M04 command.

The feed rate of code G74 will be the pitch of your thread.

Various holds or overrides for speeds and feeds will not work when tapping. This is for safety purposes.

Hole size and location

Before using the G74 there must be a previous drilling cycle.

The correct hole diameter for a tapping operation will be the final diameter of the screw minus the pitch. For example, the diameter of the hole for an M10 x 1.5 mm hole will be 8.5 mm.

Keep in mind that the X and Y coordinates of the hole are not usually in the same line as the G74 command. The standard format for selecting your hole location and calling the G74 tapping cycle is shown below:

X50.0 Y50.0

G74 Z-40.0 R5.0 F20

The machine is moved to the location of the hole to be threaded and then the hole cycle is used.

Retract planes

visualization of how a cnc machine moves using g98 and g99 codes shows motion of travel for the machine

The G74 command is usually followed by the G98 code in the same line of code, in which case the machine will use the Z coordinate (height of the first hole) to move between holes.

When tapping it is advisable to set your R plane higher than usual.

CNC machines are capable of switching between modes very quickly, but the change is not instantaneous. 

The higher R plane gives the machine time to stabilize and ensure it is working at the correct feedrate before starting the cut.

G74 Rigid tapping

Rigid tapping means that the tap can remain rigid throughout the cycle. The machine spindle locks in with the feedrate similar to the screw cutting process.

There are tapping heads specially designed for this process.

To perform Rigid Tapping, the machine should be able to synchronize feed motion and spindle speed. This option may not be available on all machines, especially older ones. Check your machine manual to make sure you are capable of rigid tapping.

However, Rigid Tapping mode can cause issues due to chips sticking to the tool or increased cutting resistance. That’s why it is important to consider peck tapping.

G74 Peck Tapping

illustration that shows the difference between peck drilling and standard drilling in a CNC machine
The graphic is for drilling but peck tapping works in the same way

Including the Q parameter in the G74 command line will immediately set the machine to a peck tapping cycle.

This means that the spindle will rotate to a specified depth (Q value) in each tapping peck and then repeat the process, one step or “peck” at a time until reaching the bottom of the hole.

Peck tapping allows chips to exit the hole, making the tapping process easier and safer. 

The downfall of peck tapping is that it increases machining time when compared to standard tapping.  

G84 vs G74

The G74 cycle is the left-hand tapping cycle, sometimes called the reverse tapping cycle.

It performs the same operation as the G84 command but with the difference that the spindle rotates counterclockwise instead of clockwise.

The G74 left hand tapping cycle creates left hand internal threads while the G84 canned cycle creates standard or right-hand internal threads. Left hand threads are the opposite of your standard threads.

If G84 creates threads that are lefty-loosey, righty tighty then G74 creates threads that are righty-loosey, lefty tighty. In other words, G74 creates threads that would be screwed in the opposite way of normal.

The G74 command also has the ability to peck tap.

Both the G74 and G84 commands are modal commands which means they will stay on and in effect until they are either changed or canceled.

The cancel code to use with both cycles is G80.

G74 code example

G00 X50.0 Y50.0

G74 Z-40.0 R5.0 F20



G80 Z10.0


In this example, the tool approaches the coordinates of the first hole (X50 Y50), then starts the tapping process.

The tapping operation is set to reach a depth of 40 mm and has a retraction plane of 5 mm above the workpiece. This procedure is repeated in 2 more holes in the positions (X25, Y50) and (X25, Y25).

The program stops the tapping cycle by using the G80 command.

Finally, the tool moves away from the part in the Z axis and the M30 command ends the program.

Want to learn more about CNC G Code?

Leave a Comment