G-code reference
G51 G-Code: Scaling
Scaling — Scales programmed coordinates about a centre point by a factor. It is useful for shrink allowances or for re-using a profile at another size.
| Property | Value |
|---|---|
| Code | G51 |
| Function | Scaling |
| Modal group | 11 |
| Type | Modal — stays active until replaced by another code of the same group |
| Used on | Milling machines |
| Syntax | G51 X_ Y_ Z_ P_ (or I J K per axis) |
What does G51 do?
Scales programmed coordinates about a centre point by a factor. It is useful for shrink allowances or for re-using a profile at another size.
G51 is modal: once programmed it remains in effect for the following blocks until another code from modal group 11 replaces it or the control is reset.
Syntax and parameters
G51 X_ Y_ Z_ P_ (or I J K per axis)| Address | Meaning |
|---|---|
X Y Z | Scaling centre |
P | Scale factor (e.g. P2000 = ×2 with 0.001 increment) |
I J K | Per-axis factors |
G51 example program
G51 X0 Y0 P1500 (×1.5)
M98 P2000
G50▶ Open this example in the G-code viewer
Tips and common mistakes
- Scaling does not scale offsets — cutter radius stays the same.
- Option on many Fanuc controls.
Controller compatibility
G51 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.