G04 tells your CNC machine to pause in place for a set amount of time. The tool stops moving, but the spindle and coolant keep running. Once the time is up, the machine reads the next line of code and picks up where it left off.
Key Takeaways
- G04 is the dwell command — it pauses machine motion for a specified amount of time
- The spindle and coolant stay on during a dwell; only the axis motion stops
- Dwell time is set with a letter (P, F, U, or X) that varies by machine and controller
- G04 resumes automatically — unlike M00 or M01, no button press is required
- Always check your machine manual: some controllers use seconds, others use milliseconds
| G04 – At A Glance | |
|---|---|
| Function | Dwell (timed pause) |
| Format | G04 P___ or G04 F___ (letter varies by controller) |
| Type | Non-modal (one-shot — active only for the block it’s programmed on) |
| Spindle during dwell | Stays on |
| Coolant during dwell | Stays on |
| Resumes | Automatically after dwell time expires |
What Does G04 Do?
G04 is the dwell command. It tells the machine to sit still for a specified amount of time before moving on to the next line in the program.
Think of it as a pause button — but one the machine releases on its own. You set the time, the machine waits, then it moves on without any input from you.

When Should You Use G04?
There are three main reasons machinists reach for G04.
Breaking chips on a lathe
When you’re turning long, stringy materials like stainless steel or aluminum, the chip can grow into one continuous ribbon that wraps around the part or the tool.

A short dwell breaks the chip so it falls free. It’s a simple fix that saves a lot of cleanup — and prevents those razor-sharp stringers from becoming a safety hazard.
Improving surface finish
Dwelling at the bottom of a hole or at the end of a facing pass gives the tool time to clean up the surface before retracting. On milling operations, it can smooth out the bottom of a pocket. On turning, it can improve finish on a shoulder or face.
Giving the machine time to catch up
CNC machines are fast, but not every function happens instantly. Coolant takes a moment to flow. A pallet changer needs time to complete. If you’re programming a move right after one of these events, a G04 can give the machine the margin it needs before the next operation begins.
G04 Syntax and Format
Here’s where G04 gets a little inconsistent. The dwell time format varies by machine brand and controller. Three things can change depending on what you’re running:
1. The letter used to call out the time
Common options are P, F, U, and X. Fanuc controls typically use P. Check your machine manual to confirm which letter your controller expects.
2. Seconds vs. milliseconds
Some controllers treat the number as seconds. Others treat it as milliseconds. This matters a lot — a dwell of P3 could mean 3 seconds or 3 milliseconds depending on the machine.
1 second = 1000 milliseconds
3. Decimal or no decimal
Some controllers require a decimal point. Some don’t allow one. And some accept either but interpret the number differently based on whether you include the decimal.
Here’s an example of how the same 3-second dwell might look on three different controllers:
G04 P3 (3 seconds on some controls — e.g., Fanuc with integer = seconds)
G04 P3000 (3 seconds on controls that use milliseconds with no decimal)
G04 U3.0 (3 seconds on some lathe controls — decimal = seconds)
COMMON MISTAKE – Assuming your controller uses seconds when it actually uses milliseconds (or vice versa)
Why it matters: G04 P3 on a milliseconds-based controller gives you a 3-millisecond dwell — essentially nothing. G04 P3000 on a seconds-based controller pauses the machine for 50 minutes. Always confirm the format in your machine manual before running a new dwell in a program.
The bottom line: Always verify how your specific machine handles G04 before using it in a real program. Consult the machine manual or contact the manufacturer if you’re not sure.
G04 Program Example
Here’s how G04 looks in a real drilling program. In this case, we’re dwelling at the bottom of each hole to improve the finish on the hole floor.
G90 G54 G00 X1.0 Y1.0 (Rapid to first hole position)
G43 H01 Z0.1 M03 S1500 (Tool length comp on, spindle on)
G01 Z-0.5 F5.0 (Feed to bottom of hole)
G04 P1.0 (Dwell 1 second at bottom — improves finish)
G00 Z0.1 (Retract)
X2.5 Y1.0 (Move to second hole)
G01 Z-0.5 F5.0 (Feed to bottom)
G04 P1.0 (Dwell again)
G00 Z0.1 (Retract)
M05 (Spindle off)
M30 (Program end)
The G04 P1.0 line tells the machine to wait 1 second at the bottom of the hole before retracting. The spindle keeps spinning the whole time — only the Z-axis stops moving.
G04 vs G4: Is the Zero Required?
No. G04 and G4 are identical. The CNC controller reads them the same way.
You’ll typically see G04 written with the leading zero in textbooks and reference materials. In practice, many programmers drop the zero and just write G4. Either format is fine.
If you work in a shop with a style standard, follow whatever format the team uses. If you’re on your own, pick one and be consistent.
How G04 Differs from M00 and M01
G04, M00, and M01 all pause the machine — but they work very differently.
With G04:
- The machine pauses for the programmed time, then resumes on its own
- The spindle stays on
- Coolant stays on
- No operator input required
With M00 (program stop):
- The machine stops completely — spindle off, coolant off
- The program won’t resume until the operator hits cycle start
- Useful when you need to measure a part mid-cycle or swap a clamp

With M01 (optional stop):
- Same as M00, but only activates if the optional stop switch is turned on at the control
- Useful for stopping during setup and skipping the stop in production
Use G04 when you just need a timed pause and want the machine to keep running. Use M00 or M01 when you need a human to intervene before continuing.
Canned Cycles with Built-In Dwell
If you’re drilling or boring, you may not need a standalone G04 at all. Several canned cycles have dwell built right into the code:
- G82 — Standard drilling cycle with dwell at the bottom of the hole
- G88 — Boring cycle with dwell
- G89 — Back boring cycle with dwell
These are worth knowing about. If you’re already using a canned cycle, the built-in dwell is often the cleaner solution.
FAQs
What is G04 used for in CNC programming?
G04 is the dwell command. It pauses machine motion for a set amount of time while keeping the spindle and coolant running. Common uses include breaking chips on a lathe, improving surface finish at the bottom of a hole, and giving machine functions like coolant or pallet changers time to complete.
Does G04 turn off the spindle?
No. During a G04 dwell, the spindle keeps running. Only the axis motion stops. If you need to stop the spindle, use M05.
What is the difference between G04 and M00?
G04 pauses for a timed amount of time and resumes automatically. M00 is a full program stop — it turns off the spindle and coolant and waits for the operator to press cycle start before continuing.
Why does my G04 not seem to be dwelling long enough?
Your controller may be interpreting the dwell value as milliseconds instead of seconds. G04 P1 on a milliseconds-based controller dwells for only 1 millisecond — effectively nothing. Check your machine manual to confirm whether your controller uses seconds or milliseconds, and adjust your value accordingly.
















