G-code reference
G20 G-Code: Inch Input
Inch Input — Interprets all following dimensions in inches (feeds in inches per minute or per revolution). On Siemens controls the equivalent is G70.
| Property | Value |
|---|---|
| Code | G20 |
| Function | Inch Input |
| Modal group | 06 |
| Type | Modal — stays active until replaced by another code of the same group |
| Used on | Mills and lathes |
| Syntax | G20 |
What does G20 do?
Interprets all following dimensions in inches (feeds in inches per minute or per revolution). On Siemens controls the equivalent is G70.
G20 is modal: once programmed it remains in effect for the following blocks until another code from modal group 06 replaces it or the control is reset.
Syntax and parameters
G20G20 example program
G20 (inch)
G90 G54 G00 X1.25 Y0.5▶ Open this example in the G-code viewer
Tips and common mistakes
- Put G20/G21 on its own line at the very start of the program.
- Switching units in mid-program converts offsets on some controls — avoid it.
- Siemens: G70 = inch, G71 = metric (different from Fanuc lathe G70/G71 cycles).
Controller compatibility
G20 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.