G-code reference
G18 G-Code: XZ Plane Selection
XZ Plane Selection — Selects the ZX plane. It is the default plane on lathes and is used on mills for arcs in the XZ plane, e.g. ball-end profiling.
| Property | Value |
|---|---|
| Code | G18 |
| Function | XZ Plane Selection |
| Modal group | 02 |
| Type | Modal — stays active until replaced by another code of the same group |
| Used on | Mills and lathes |
| Syntax | G18 |
What does G18 do?
Selects the ZX plane. It is the default plane on lathes and is used on mills for arcs in the XZ plane, e.g. ball-end profiling.
G18 is modal: once programmed it remains in effect for the following blocks until another code from modal group 02 replaces it or the control is reset.
Syntax and parameters
G18G18 example program
G18 G02 X20.0 Z-10.0 R10.0▶ Open this example in the G-code viewer
Tips and common mistakes
- On mills, I and K define the arc centre in G18.
Controller compatibility
G18 follows the ISO/Fanuc dialect used by Fanuc, Haas, Brother, Doosan, Hurco (ISO mode), Mazak (EIA/ISO mode), Okuma (G-code mode) and Siemens in ISO dialect mode. Parameters, option packages and builder-specific behaviour can differ, so confirm the details in your machine's programming manual before running a new program.