G02 cuts a clockwise arc and G03 cuts a counter-clockwise arc, at the feed rate you set. Each arc block gives the end point and either the radius (R) or the centre offsets (I, J, K), measured from the start point to the centre. Direction is judged looking down on the active plane (G17, G18 or G19) from the positive side of the third axis. Use R for quick hand-coded arcs under 360°, and I, J, K for full circles and for anything the CAM system writes. The sections below cover planes, both methods with checked examples, helical moves, arc feed rates and the alarms you will meet.

1. What Are They?

G02 and G03 command the machine to move two axes together along a circular path at the programmed feed rate. Both are modal: they stay active until another motion code (G00, G01 or the other arc code) replaces them.

G02

Clockwise (CW) circular interpolation. The tool moves clockwise from its start point to its end point.

G03

Counter-clockwise (CCW) circular interpolation. The tool moves counter-clockwise from its start point to its end point.

2. The Anatomy of an Arc Command

To cut an arc, the control needs three pieces of information:

  1. Start point: where the tool already is, from the previous G00, G01 or arc move.
  2. End point: where the arc finishes, given by the X, Y or Z words in the G02/G03 block (in G90 absolute or G91 incremental, as usual).
  3. Arc centre: given either by the R (radius) method or by the I, J, K method.

Plus a feed rate. An arc with no F active stops with an alarm, just like G01.

3. Planes and the I, J, K Axis Mapping

An arc lies in a plane. On a mill you will mostly use G17, which is the power-on default on most machines. The plane also decides which way is "clockwise": you look at the plane from the positive end of the third axis, towards negative.

Axis Reference Guide
Plane Arc Axes Centre Words Viewed From
G17X and YI and J+Z (looking down)
G18Z and XK and I+Y
G19Y and ZJ and K+X

I is always the centre offset along X, J along Y and K along Z. In G17 you use X, Y with I, J; a K word there is either ignored or alarms, depending on the control.

Lathes work in G18 (the XZ plane). On a lathe, check the arc direction in the control's graphics before you cut, because whether the tool is in front of or behind the centreline changes how G02 and G03 look from where you stand.

4. Method 1: The R (Radius) Method

This is the easiest method for hand programming. You give the end point and the radius of the arc, and the control works out where the centre must be.

(Start point is X0.0 Y0.0)
G01 X0.0 Y0.0 F15.0
(Clockwise quarter arc to X2.0 Y2.0, 2-inch radius, centre at X2.0 Y0.0)
G02 X2.0 Y2.0 R2.0 F10.0

The straight-line distance (chord) between the start and end here is √(2² + 2²) = 2.828". An arc can only join two points if its diameter is at least the chord, so the radius must be at least 1.414". Ask for R1.0 between these points and the control alarms, because no 1" radius arc can reach.

The R Method Limitations

You cannot cut a full 360° circle with R. When the start and end points are the same, there are endless circles of that radius through the point, so the control cannot tell which one you mean. Also, for any two points there are two arcs of the same radius: a short one (under 180°) and a long one (over 180°). A positive R gives the short arc; to get the arc greater than 180°, use a negative R (for example R-1.0). Arcs very close to 180° are badly conditioned with R, so use I and J for those.

5. Method 2: The I, J, K Method

This is the standard output of CAM software, because it defines the centre exactly and can cut a full 360° circle in a single block.

How it works: I, J and K are the incremental distance and direction from the start point to the centre of the arc, along X, Y and Z. This is true even when you are programming in G90 absolute. A zero value can be left out.

(Milling a full 2-inch circle, starting at X1.0 Y0.0)
(Centre of the circle is at X0.0 Y0.0)
G01 X1.0 Y0.0 F15.0
(Full CCW circle. End point omitted because it is the same as the start point)
G03 I-1.0 J0.0 F10.0
Breaking down the I, J, K math:

In the example above, the tool starts at X1.0. The centre of the circle is at X0.0. To get from the start point to the centre, you move 1 inch in the negative X direction. Therefore I = -1.0.

The Y start position is Y0.0, and the Y centre is Y0.0. There is no change along Y, so J = 0.0.

Worked example: a corner radius

A profile runs along Y0 in the +X direction and turns up the right-hand side at X2.0, with a 0.25" radius in the corner. The arc starts where the straight line meets the radius, at X1.75 Y0, and ends at X2.0 Y0.25. The centre is at X1.75 Y0.25.

G01 X1.75 Y0.0 F15.0
G03 X2.0 Y0.25 I0.0 J0.25 (Turning left = CCW)
G01 Y3.0

Check it: from the start (1.75, 0) to the centre is 0 in X and +0.25 in Y, so I0 J0.25. From the end (2.0, 0.25) to the centre is 0.25 in X and 0 in Y, so the radius is 0.25 at both ends. Travelling +X and then turning towards +Y is a left turn, so it is G03. A quick rule: on an outside profile cut clockwise round the part, corners are G02; cut counter-clockwise, they are G03.

A few controls can be set to read I, J and K as absolute centre coordinates instead (for example with G90.1 or a setting). If arcs from a CAM post come out wildly wrong, check that the post and the control agree on this.

Visualize Your G-Code

Want to see G02 and G03 in action? Copy the code snippets above and paste them into our G-Code Viewer to see the toolpath drawn on your screen.

Open G-Code Viewer

6. Helical Interpolation: Adding a Third Axis

If you add the third axis to an arc block, the control moves it in step with the arc and the tool follows a helix. In G17, adding Z does this:

(At X1.0 Y0.0 Z0.0: one full CCW turn while dropping 0.1 in Z)
G03 X1.0 Y0.0 Z-0.1 I-1.0 J0.0 F10.0

Helical moves are used to ramp into pockets, interpolate large holes and mill threads. The helical ramp calculator works out the Z drop per turn for a safe ramp angle, and the thread milling generator writes the full helical thread code.

7. Feed Rate on Arcs

The control moves the centre of the tool at the programmed feed. On an inside arc, the cutting edge runs on a bigger radius than the tool centre, so it travels further in the same time: it moves faster than the feed you programmed and takes a bigger chip. On an outside arc the opposite happens and the edge moves slower. For small inside radii the difference is large.

To keep the edge at the feed you want on an inside arc: centre feed = edge feed × (R − r) ÷ R, where R is the arc radius and r the tool radius. Example: a 2.0" bore (R = 1.0") with a 0.5" end mill (r = 0.25") and a wanted edge feed of 20 IPM: 20 × (1.0 − 0.25) ÷ 1.0 = 15 IPM. See Circular Feed Compensation and the circular feed calculator.

8. Common Arc Alarms and Errors

Alarm numbers and wording vary between controls, but the causes are the same.

Alarm or symptomUsual causeFix
Radius tolerance / end point not on arc (Fanuc alarm 020)The distance from the start to the centre (I, J) does not match the distance from the end to the centreRecalculate I, J, K from the start point; check for rounding and sign errors
Arc radius too small / illegal RR is less than half the chord between start and endCheck the end point and the radius; use I, J if the arc is near 180°
Arc cut the wrong way round, or a huge circleG02 and G03 swapped, wrong sign on R, or wrong plane activeCheck direction from the positive end of the third axis, and add G17/G18/G19 at the start of the program
Interference in cutter compensation (Fanuc alarm 041)An inside arc radius smaller than the tool radius with G41/G42 onUse a smaller tool, or make the arc radius larger than the tool radius
No feed rate commandedNo F word active before the first arcPut an F on the first feed move

Controls accept a small radius mismatch (the tolerance is set by a parameter), which is why rounded CAM output still runs. The R method never gets a mismatch, because the control calculates the centre for you, but it will still alarm if the radius is too small for the chord. More on cutter compensation with arcs is in the cutter compensation guide.

9. Common Mistakes

  • Measuring I and J from the end point, or from part zero. They go from the start point to the centre.
  • Wrong plane after a lathe or 4th-axis program. Put G17 (or the plane you need) in the safe start line of every program.
  • Using R for full circles, which either alarms or does nothing.
  • Forgetting the inside-arc feed. Small bores cut with full linear feed overload the tool.
  • Not checking with graphics. An arc in the wrong direction often looks fine in the code. Run graphics or the G-code viewer first.

For the straight moves that join arcs together, see G00 and G01.

Frequently Asked Questions

G02 is clockwise and G03 is counter-clockwise. The direction is judged looking at the active plane from the positive end of the third axis, so in G17 you look down from +Z onto the XY plane, the way you normally view a mill table.

On most controls, I, J and K are incremental distances from the start point of the arc to its centre, even when you program in G90 absolute. A few controls can be set to treat them as absolute centre coordinates, so check that your CAM post and your control agree.

No. When the start and end points are the same, there are endless circles of that radius through the point, so the control cannot work out the centre. Use I and J for full circles, for example G03 I-1.0 J0 from X1.0 Y0 cuts a full 2 inch circle around X0 Y0.

Use a negative R when the arc is more than 180 degrees. For two given points there are two arcs of the same radius, a short one and a long one. Positive R gives the arc under 180 degrees and negative R gives the arc over 180 degrees.

The distance from the start point to the centre given by I, J, K does not match the distance from the end point to the centre by more than the control allows. Usually I and J were measured from the end point or part zero instead of the start point, a sign is wrong, or the numbers were rounded too much.

Conclusion

G02 and G03 come down to three things: the right plane, the right direction viewed from the positive third axis, and a centre that is defined correctly, either by R or by I, J, K measured from the start point. CAM writes most arcs today, but being able to read and check an arc block at the control is essential for troubleshooting toolpaths, editing lead-ins and understanding alarms.