---
title: "How to Program a Helix in G-Code (G02/G03 With Z)"
description: "A helix is just a circular arc with a simultaneous Z move. Add a Z value to a G02 or G03 and the tool spirals instead of staying flat. Here is how it works."
url: https://gcodepractice.com/journal/how-to-program-a-helix-in-g-code-g02-z/
canonical: https://gcodepractice.com/journal/how-to-program-a-helix-in-g-code-g02-z/
author: "Lawrence Arya"
authorUrl: https://www.linkedin.com/in/vibecoding/
published: 2026-06-02
updated: 2026-06-02
category: "Code reference"
tags: ["helix", "helical interpolation", "g02", "advanced"]
lang: en
---

# How to Program a Helix in G-Code (G02/G03 With Z)

> **TL;DR** To program a helix, take a circular move (G02 clockwise or G03 counterclockwise, with an I/J or R arc definition) and add a Z endpoint, so the tool turns in the plane while descending or rising at the same time. A full circle back to the same XY with a Z change is one helical revolution. Helixes are used for helical ramping into pockets, big bores, and thread milling.

A helix looks intimidating in a program, but it is a tiny addition to something you already know. A `G02` or `G03` normally traces a flat arc in the plane. Add a `Z` value to the same line and the tool keeps turning while it also changes height, which is a spiral. That is helical interpolation.

## The one idea

Circular motion in the plane plus a simultaneous Z move equals a helix. Everything else is the arc you already program:

- **`G02` / `G03`** set the turn direction (clockwise or counterclockwise). See [G02 vs G03](/journal/g02-vs-g03/).
- **`I`, `J` (or `R`)** define the arc, the same as a flat arc.
- **`Z`** on the same line is what turns the flat circle into a spiral.

## A simple example

```
G17                      (XY plane)
G0 X10 Y0 Z0             (start at the edge of the circle, top)
G3 X10 Y0 Z-5 I-10 J0    (one CCW turn while descending 5 mm)
```

The move starts and ends at the same X and Y, makes a full circle, and drops Z by 5 mm along the way: one helical revolution. Repeat or chain moves to go deeper.

## Where helixes are used

| Use | Why a helix helps |
| --- | --- |
| Helical ramp into a pocket | Gentle entry instead of a straight plunge |
| Boring a large hole | Spiral down to size with one tool |
| Thread milling | The helix follows the thread pitch |

The thread-milling use is exactly why [thread milling vs tapping](/journal/g-code-for-thread-milling-vs-tapping/) comes down to a programmed helix versus a canned cycle.

## Where this fits

Helical interpolation is an advanced move built on the arc codes, so make the [common G-codes](/journal/common-g-codes-for-cnc-beginners/) and the arc directions automatic first with [beginner CNC code practice](/journal/beginner-cnc-code-practice/). A free tool like [G-Code Sprint](/g-code-practice/) drills those foundations; confirm exact helical syntax against your machine manual, since this is an educational overview.

## Bottom line

Program a helix by adding a `Z` endpoint to a `G02` or `G03` arc, so the tool turns and changes height at once. One full circle with a Z change is one revolution. It powers helical ramping, boring, and thread milling.

## Sources

- [LinuxCNC G-code reference (helical motion, G2/G3)](https://linuxcnc.org/docs/html/gcode/g-code.html)
- [Wikipedia: G-code](https://en.wikipedia.org/wiki/G-code)
- [CNCCookbook: G-code and M-code cheat sheet](https://www.cnccookbook.com/g-code-m-code-cnc-list-cheat-sheet/)

## Frequently asked questions

### How do you program a helix in G-code?
Use a `G02` or `G03` circular move with its `I`/`J` or `R` arc definition, and add a `Z` endpoint so the tool changes height while turning. A full revolution back to the same XY with a Z change produces one turn of the helix.

### What is helical interpolation?
A move that combines circular motion in the working plane with simultaneous linear motion along the axis perpendicular to it, usually Z. The result is a spiral. It is just `G02`/`G03` with a `Z` value added.

### What is a helix used for in machining?
Helical ramping to plunge gently into a pocket, boring large holes by spiraling down, and thread milling, where the helix follows the thread pitch. It spreads the cut over a gradual descent instead of a straight plunge.

*G-Code Sprint is a study and practice tool only. It is not a CNC simulator, machine controller, or safety authority. Always follow your instructor, employer, machine manual, and shop safety procedures.*

---

Source: https://gcodepractice.com/journal/how-to-program-a-helix-in-g-code-g02-z/
Author: Lawrence Arya — https://www.linkedin.com/in/vibecoding/
