G-code reference
G04 G-Code: Dwell
Dwell — Pauses axis motion for a set time while the spindle and coolant keep running. It is used at the bottom of counterbores, for grooves, or to let a spindle reach…
| Property | Value |
|---|---|
| Code | G04 |
| Function | Dwell |
| Modal group | 00 |
| Type | One-shot (non-modal) — active only in its own block |
| Used on | Mills and lathes |
| Syntax | G04 P_ or G04 X_ |
What does G04 do?
Pauses axis motion for a set time while the spindle and coolant keep running. It is used at the bottom of counterbores, for grooves, or to let a spindle reach speed.
G04 is a one-shot code: it only acts in the block where it is written, and the previously active modal codes take over again afterwards.
Syntax and parameters
G04 P_ or G04 X_| Address | Meaning |
|---|---|
P | Dwell in milliseconds on Fanuc (no decimal point), e.g. P500 = 0.5 s. Haas: P in seconds when a decimal is used. |
X / U | Dwell in seconds (decimal allowed) |
G04 example program
G01 Z-5.0 F100.
G04 P500 (dwell 0.5 s)
G00 Z5.0▶ Open this example in the G-code viewer
Tips and common mistakes
- P without a decimal is often milliseconds; P with a decimal can be seconds — check your control.
- Long dwells can rub and work-harden stainless steel.
- On lathes in G99 some controls read dwell in spindle revolutions.
Controller compatibility
G04 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.