A G02 or G03 arc needs more than an endpoint: the control has to know where the circle’s center sits. G-code gives you two ways to say it. I, J, and K state the center directly; R states the radius and makes the control work the center out. They are not interchangeable in every case, and picking the wrong one causes some classic failures.
What do I, J, and K mean in G02?
I, J, and K are center offsets measured from the arc’s start point. I is the distance from the start point to the center along X, J along Y, K along Z. Which two apply depends on the active plane, the same pairing covered in G17, G18, G19 plane selection: G17 uses I and J, G18 uses I and K, G19 uses J and K. The format is defined in the LinuxCNC arc reference.
A concrete example: the tool sits at X10. Y0. and you want a quarter arc around a center at X10. Y5.. The center is 0 away in X and 5 up in Y from the start point, so the block is:
G02 X15. Y5. I0 J5. F150
The single most common arc bug lives right here: beginners read I and J as coordinates from part zero. They are offsets from the start point on most controls. Get that one fact solid and most arc errors disappear. The full subtraction method, with worked examples, is in how to calculate I and J for a G02 arc.
What does R do instead?
R skips the center entirely: you give the radius, the control finds a center that fits the start point, end point, and radius. The same quarter arc becomes:
G02 X15. Y5. R5. F150
Shorter to write, easier to read off a drawing that dimensions radii. The catch is ambiguity: two arcs of the same radius can join the same two points, one minor (under 180 degrees) and one major (over 180). Controls resolve this with the sign convention noted in the standard G-code references: a positive R cuts the arc of 180 degrees or less, a negative R cuts the one over 180.
When should you use R, and when I, J, K?
The practical split:
| Situation | Use | Why |
|---|---|---|
| Simple arc under 180 degrees | R | Quick, matches the drawing dimension |
| Arc over 180 degrees | I, J, K | Avoids the negative-R sign trap |
| Full circle | I, J, K only | R cannot define it |
| Precision or CAM output | I, J, K | Exact center, no rounding ambiguity |
| Hand-writing a quick chamfer arc | R | Least typing, least math |
Most CAM systems post arcs with I, J, K for exactly the reason in row four: a stated center leaves no room for the control to resolve geometry differently than the programmer intended. The widely used code cheat sheets list both forms because hand programmers still reach for R daily.
Why do full circles need I and J?
A full circle starts and ends at the same point. Given only a radius, infinitely many circles pass through that single point, so the control has no way to choose a center and will reject or mangle the move. With I and J the center is stated outright, so the move is unambiguous:
G02 X10. Y0. I5. J0 F150 (full circle around a center 5 to the right)
If your control alarms on a full-circle R block, this is why.
What goes wrong when the words are mixed up?
A wrong or missing center word does not always alarm; sometimes it cuts the wrong shape. An I or J that was meant as an absolute coordinate produces an arc with a wildly misplaced center, and a zeroed-out pair can degenerate into no arc at all, one of the causes traced in why G02 cuts a straight line. The direction half of the story, clockwise versus counterclockwise, belongs to G02 vs G03, and both halves have to be right for the arc to land.
Bottom line
I, J, and K point from the arc’s start point to its center; R states the radius and leaves the center to the control. Use R for quick simple arcs under 180 degrees, and I, J, K for big arcs, precision work, and every full circle. Remember the one trap: center offsets are measured from the start point, not from part zero. Drilling the arc words until that is reflex is what a routine on the G-code practice hub is for.
Sources
- LinuxCNC G-code reference (G2, G3, arc center format)
- Wikipedia: G-code
- CNCCookbook: G-code and M-code cheat sheet
Frequently asked questions
What is the difference between I, J, K and R in G02?
I, J, and K locate the arc center as an offset from the arc’s start point: I along X, J along Y, K along Z. R states the radius and lets the control calculate the center. I, J, K is exact and handles any arc including full circles; R is shorter but cannot define a full circle.
Are I and J measured from the part zero?
No. On most controls they are offsets from the arc’s start point to the center, not coordinates from part zero. Some controls can be parameter-set to absolute centers, so confirm yours.
Why can R not cut a full circle?
A full circle starts and ends at the same point, and infinitely many circles of one radius pass through a single point, so the control cannot pick a center from R alone. Full circles need I, J, or K.
What is the best way to learn arc codes like G02 and the I, J, K words?
Drill them with active recall. A free app like G-Code Sprint quizzes G02, G03, and the arc words as quick timed questions and repeats whichever ones you miss.
G-Code Sprint is a study and practice tool only. Always follow your instructor, employer, machine manual, and shop safety procedures.