G-code reference

G04: Dwell

G04 is dwell. Pauses motion for a set time; the spindle keeps running. It is non-modal, so it acts only on the line it is written on.

What G04 does

G04 holds the axes still for a set time, for example to clean up the bottom of a hole or let a groove finish round. It is non-modal: it acts only on its own line. How the time is written varies. On Fanuc, X or U is read in seconds and P in milliseconds without a decimal point, so G04 P500 is half a second. Other controls read P differently, so check the manual before relying on it.

TypeG-code
MachineMill and lathe
GroupNon-modal
ModalNo: acts only on its own line

G04 example

G04 X1.5

Wait 1.5 seconds (Fanuc style).

WordWhat it means here
G04Dwell
X1.5X axis target (on a lathe, the diameter)

Codes people confuse with G04

CodeWhat it does instead
M00 Program stop. Stops the program until the operator presses cycle start.
G09 Exact stop (one block). Makes the machine stop fully at the end of this one block before moving on.

Memory hook: Dwell is timed and automatic; M00 waits for a person.

Where controls differ

  • Fanuc: X/U in seconds; P in milliseconds, no decimal point.
  • Haas: P is the dwell; check the manual for how your software version reads a decimal point.

Other codes in the non-modal group

These also act only on their own line.

  • G09 Exact stop (one block)
  • G10 Programmable data input
  • G28 Return to reference position
  • G30 Return to second reference position
  • G50 Maximum spindle speed (lathe)
  • G52 Local coordinate system
  • G53 Machine coordinate move
  • G65 Macro call
  • G92 Set coordinate system (shift)

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: G04

  1. What does G04 do? (Mill and lathe)

  2. Which code: Pauses motion for a set time; the spindle keeps running.(Mill and lathe)

  3. What does M00 do? (Mill and lathe)

Show the answers
  1. Pauses motion for a set time; the spindle keeps running.
  2. G04
  3. Stops the program until the operator presses cycle start.

Drill this code with the rest of the core set

More practice hubs

Frequently asked questions

What does G04 mean in CNC programming?
Dwell. Pauses motion for a set time; the spindle keeps running.
Is G04 modal?
No. G04 acts only on the line where it is written; the next line goes back to whatever modal codes were already active.
What is the difference between G04 and M00?
G04 (dwell): pauses motion for a set time; the spindle keeps running. M00 (program stop): stops the program until the operator presses cycle start. A way to remember it: dwell is timed and automatic; M00 waits for a person.
What is the difference between G04 and G09?
G04 (dwell): pauses motion for a set time; the spindle keeps running. G09 (exact stop (one block)): makes the machine stop fully at the end of this one block before moving on. A way to remember it: dwell is timed and automatic; M00 waits for a person.

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.

Free preview · no card Try G-Code Sprint