G20: Inch units
What G20 does
G20 makes the control read dimensions in inches and feeds in inches per minute or per revolution. It belongs at the top of the program, before any motion. Running a metric program in G20 (or the reverse) multiplies or divides every move by 25.4, which is a classic crash.
| Type | G-code |
|---|---|
| Machine | Mill and lathe |
| Group | Units |
| Modal | Yes: stays active until replaced by another code from the same group |
G20 example
G20 Everything after this is in inches.
| Word | What it means here |
|---|---|
G20 | Inch units |
Codes people confuse with G20
| Code | What it does instead |
|---|---|
G21 | Metric units. Programs positions and feeds in millimetres. |
Memory hook: G20 = inch, G21 = mm. The bigger number is the smaller unit.
Other codes in the units group
Only one code from a modal group is active at a time. Programming any of these replaces G20.
G21Metric units
Meanings follow the common Fanuc-style standard that Haas, Okuma (EIA mode), Mitsubishi, LinuxCNC and most other controls share for this code. Options and parameters change details from machine to machine, so check the manual for your control.
Quick check: G20
-
What does
G20do? (Mill and lathe) -
Which code: Programs positions and feeds in inches.(Mill and lathe)
-
What does
G21do? (Mill and lathe)
Show the answers
- Programs positions and feeds in inches.
- G20
- Programs positions and feeds in millimetres.
Frequently asked questions
- What does G20 mean in CNC programming?
- Inch units. Programs positions and feeds in inches.
- Is G20 modal?
- Yes. G20 belongs to the units group and stays active until another code from that group is programmed.
- What is the difference between G20 and G21?
- G20 (inch units): programs positions and feeds in inches. G21 (metric units): programs positions and feeds in millimetres. A way to remember it: g20 = inch, G21 = mm. The bigger number is the smaller unit.
G-Code Sprint is an educational practice tool only. It is not a CNC simulator, machine controller, safety manual, or replacement for instruction. Always follow your instructor, employer, machine manual, and shop procedures.