Quick Guide to the G02 CNC G Code [Clockwise Circular Interpolation]

a graphic of a cnc machine with text that says learn g code today g02 circular interpolation

G02 sets the CNC movement mode to clockwise circular movement, otherwise known as circular interpolation.

G02 is used to move the CNC around along a specified radius set with the R code in a clockwise direction and at a feed rate set with the F code.

G02 is a modal command which means it will stay on until switched to another code in the same movement group of codes such as G00 – Rapid travel, G01 – Linear interpolation or G03 – Counterclockwise circular interpolation.

G02 vs G2

Some people get confused about whether the 0 is required to be included in a G02 code.

To clear this up, there is no need to include the extra zero in the code. The CNC machine will read the code the same. It really is just a matter of preference.

Often you will see the full G02 code used in textbooks or other reference materials. In practice though, many prefer the shortened G2 code in their programs.

If you are working on your own, then go with whichever format you prefer. If you work in a bigger shop, make sure to stick to the format that the business has been using.

When to use a G02 code?

G02 codes will usually be in the lines of the program that are used to cut the part.

The G02 code allows the programmer to cut a full circle or portion of a circle.

Feed rate (F) and spindle speed (S) codes are used together with a G02 code to control the speeds and feeds.

An R code is used as well to tell the machine what size radius to move along. Some CNC programs will use IJK codes instead of an R code to describe the circular move.

Other codes used with G02

Format for using a G02 code

G02 X7.5 Y1.5 R0.5

Once the G02 code is used the machine will move to any XYZ locations given in a circular movement going clockwise along the given radius size and at the set feed rate. 

Because G02 is a modal code, you don’t need to specify it on every line of code. 

If the next line of code after the one above was X7.0 Y1.0 R0.5 then the machine would still move to the location in a circle at the set feed rate. Because it’s modal it stays on until switched to another mode.

The feed rate will also remain the same until it is changed and isn’t required to be on every line. This means that the feed rate can be set before the G02 code is used as well.

How to turn off the G02 code

There isn’t a specific cancel command for G02 like there is for canned cycles. Instead to turn G02 off you will need to switch it to another code in the same group of movement codes.

The other codes in the movement group are:

Using any of these codes will turn G02 clockwise circular interpolation off and switch to the new movement mode.

What to think about when using a G02 code?


First, make sure you know what units you are working in

Moving 10 inches instead of 10 millimeters is a big difference. A G20 (inches) or G21 (mm) code should identify the units you are working in before your G02 code.

comparison of units of measurement for cnc programming

Absolute vs incremental mode

The second thing to know is how the machine will understand position locations.

This is determined by whether you are working in absolute (G90) or incremental (G91) coordinates. The most recent G90 or G91 code in the program will determine which mode you are in.

Absolute positioning will move from a set zero location such as your machines home location or a specified location on your part.

Incremental positioning will move relative to your current position. 

The images below show the difference between the absolute and incremental positioning modes. The numbers in parentheses are the locations given to the the machine to make the move.

Notice how in absolute mode, all locations are relative to a single location, usually either the workpiece zero or machine home location. 

In incremental mode, all locations are relative to the machine’s current location.

graph paper example of absolute positioning with multiple points as examples
graph paper example of incremental positioning with multiple points as examples

Start and stop locations

Lastly, make sure you understand the path that the tool will take from it’s start location to the new location.

Check  where you are currently position wise (X, Y & Z location), where you will be moving to and if there is anything in between the two locations.

The G02 code will move the machine in a circular arc to your new location. You don’t want anything in the way or to miscalculate your stop point. Clamps or vises can be easy to forget about and run into. 

Crashing your machine is never a good time.

G02 [clockwise circular interpolation] vs G03 [counterclockwise circular interpolation]

Everything that applies to the G02 code applies to the G03 code as well.

The only difference between the two is the direction of movement. 

G02 moves clockwise and G03 moves counterclockwise.

CNC codes that are similar to G02

a comparison of the type of movement created with G00, G01, G02 and G03 cnc g codes

Note that all the movement codes listed below are modal

This means they will stay in the movement mode identified by the code until switched to a different mode.

Want to learn more about G Code for your CNC?

Leave a Comment