FEATURE
Letter Codes List for CNC Machine Programming
CNC programs combine address letters with numerical values to define movement, speeds, offsets, cycles and machine functions. Letter meanings can vary by controller, machine type and programming context, so always confirm them in the machine and control manuals.
Common CNC Letter Codes
| Letter | Common meaning |
|---|---|
| A | Rotary or indexing axis around the X-axis, usually expressed in degrees |
| B | Rotary or indexing axis around the Y-axis, usually expressed in degrees |
| D | Cutter-radius compensation offset number |
| F | Feed-rate command |
| G | Preparatory command, commonly called a G-code |
| H | Tool-length offset number |
| I | Arc-center displacement or modifier along the X-axis |
| J | Arc-center displacement or modifier along the Y-axis |
| K | Arc-center displacement or modifier along the Z-axis |
| L | Repetition count for a subprogram or fixed cycle |
| M | Miscellaneous machine function, commonly called an M-code |
| N | Block or sequence number |
| O | Program number |
| P | Context-dependent value such as a subprogram number, work-offset selection with G10, dwell time or target block number with M99 |
| Q | Peck depth in cycles such as G73 and G83, or a shift amount in cycles such as G76 and G87 |
| R | Retract or reference plane used by fixed cycles |
| S | Spindle-speed command, commonly expressed in revolutions per minute |
| T | Tool-selection function |
| X | X-axis coordinate |
| Y | Y-axis coordinate |
| Z | Z-axis coordinate |
Letters With Multiple Meanings
The meaning of an address depends on the command and controller configuration. For example, P may identify a subprogram, specify a dwell duration or select another program parameter. R often defines a canned-cycle retract plane, but it may have another meaning in an arc command. Interpret every address within the complete program block rather than in isolation.
Machine and Controller Differences
Not every CNC machine uses the same address conventions. Rotary-axis letters such as A and B are generally relevant only when the machine has corresponding rotary or indexing axes. Units, decimal handling and cycle parameters can also differ between controls.
Before running or editing a program, verify each code against the documentation for the specific machine and controller. Use simulation, graphics or a cautious single-block prove-out where available.