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.

By cnccode · Updated
PropertyValue
CodeG20
FunctionInch Input
Modal group06
TypeModal — stays active until replaced by another code of the same group
Used onMills and lathes
SyntaxG20

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

Format
G20

G20 example program

Example
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.

Frequently asked questions

Is G20 modal?
Yes. G20 belongs to modal group 06 and stays active until another code of that group is programmed.
What does G20 mean in CNC?
G20 means Inch Input. Interprets all following dimensions in inches (feeds in inches per minute or per revolution). On Siemens controls the equivalent is G70.
What is the difference between G20 and G21?
G20 is Inch Input, while G21 is Metric Input. See the G21 page for its syntax and examples.
Can I use G20 on a lathe?
Yes, G20 is used on both mills and lathes, although some parameters differ between them.