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…

By cnccode · Updated
PropertyValue
CodeG04
FunctionDwell
Modal group00
TypeOne-shot (non-modal) — active only in its own block
Used onMills and lathes
SyntaxG04 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

Format
G04 P_  or  G04 X_
AddressMeaning
PDwell in milliseconds on Fanuc (no decimal point), e.g. P500 = 0.5 s. Haas: P in seconds when a decimal is used.
X / UDwell in seconds (decimal allowed)

G04 example program

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

Frequently asked questions

Is G04 modal?
No. G04 is a one-shot (group 00) code and only acts in the block where it appears.
What does G04 mean in CNC?
G04 means 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 speed.
What is the difference between G04 and G82?
G04 is Dwell, while G82 is Drilling Cycle with Dwell (Counterbore / Spot). See the G82 page for its syntax and examples.
Can I use G04 on a lathe?
Yes, G04 is used on both mills and lathes, although some parameters differ between them.