GreatLight CNC Machining Factory logo
CNC Machining
Rapid Prototyping
Materials
Industries
News
About GL

Get Instant Quote

CNC axis basics

What Direction Is the Z Axis on the CNC Machine?

Z is the spindle axis: the tool moves toward or away from the work along it, and positive Z always pushes the tool farther from the part. This page explains how that rule is built, where it bends on lathes and 5-axis machines, and how to read Z on a setup sheet without guessing.

Right-hand ruleVertical spindle millsZ offsets5-axis frames
What Direction Is The Z Axis On The CNC Machine?
Short version

Key takeaways

Z follows the spindleZ runs parallel to the main spindle axis, not to the column or the floor.
Positive Z pulls awayMoving +Z increases the distance between the tool and the workpiece.
Negative Z cutsDepth of cut is commanded in minus Z, down to the programmed floor.
Polarity can flipOn a lathe or a head-changer, the same sign may point the other way.
The standard

The right-hand rule sets the direction of the z axis on the cnc machine

Hold your right hand so the middle finger points up from the palm, the index finger points forward, and the thumb points to the right. That is the ISO 841 and EIA-267 convention: thumb is X, index is Y, middle finger is Z. The middle finger is the spindle. Its direction, not the machine's shape, decides where Z points.

So on a vertical machining center with the spindle hanging down, +Z points up, away from the table. The tool retreats when Z grows and cuts when Z shrinks. That holds whether the spindle moves down to the part or the table lifts the part toward a fixed spindle. Motion belongs to the tool relative to the work, and the sign follows that relative motion.

Many operators learn this by jogging. Press Z+ and the head rises, or the table drops. Both feel identical from the part's point of view, which is the whole point of the convention. Read the axis load meter or DRO, not the physical direction of the casting, and you cannot go wrong.

  • 1
    Thumb, index, middleX, Y, Z in that order on the right hand.
  • 2
    Z is the spindleIt follows the spindle axis, not gravity.
  • 3
    Sign follows relative motionTool moving away from the part is always +Z.
Why it is defined this way

Why positive Z points away from the workpiece

The convention comes from the mechanics, not from a committee preference. On a knee mill the quill and its drive train carry real weight, and the ballscrew has to fight gravity every time the head rises. Defining up as positive keeps the position math simple: a positive command always means retract, a negative command always means engage.

It also makes offsets readable. A tool length offset tells the control how far the tool tip sits below the spindle gauge line. A work offset tells it where the part's Z zero sits relative to machine zero. Both numbers are easier to sanity-check when a bigger positive value means the tool hangs lower or the part sits higher.

There is a safety angle too. Any program that opens with a rapid to a positive Z value is moving clear of the stock. If a machine builder flipped that sign, every startup block in every post processor would need rewriting. Fifteen years of running 3-, 4-, and 5-axis work here has never produced a reason to want that.

  • 1
    Retract is always positivePredictable startup and tool-change moves.
  • 2
    Offsets stay readableA larger positive tool length means a longer tool.
  • 3
    Gravity favors itThe screw works against weight on retract, not on cut.
Polarity

When Z polarity flips: lathes, horizontals, and rotary heads

A CNC lathe keeps the same right hand, but the spindle is horizontal, so Z runs along the bed. +Z moves the turret away from the chuck, toward the tailstock. Part zero is usually the finished face, so most turning happens in minus Z. If you bring mill habits to a lathe, the first rapid will tell you quickly.

Horizontal machining centers put the spindle on its side. Z still runs along the spindle, but now it is horizontal and the pallet moves in X and Y. On some cells the column travels in Z and the table stays put. The sign logic does not change: away from the part is plus.

Five-axis machines add rotary axes A, B, and C, which turn about X, Y, and Z. On a trunnion table, the part tilts while the tool stays vertical, so the programmed Z is still the spindle axis in machine coordinates. The post processor handles the transform. What you must watch is the setup, not the sign.

A right-angle head or an adjustable-angle head can send the cutting direction sideways. The control may still call that motion Z if the head is treated as a spindle extension, or it may be handled as a separate tool frame. On the machines we run, those heads come with their own offset definitions, and the operator verifies the direction with a dial indicator before the first cut.

  • 1
    Lathe+Z away from the chuck, along the bed.
  • 2
    Horizontal millZ runs horizontally, following the spindle.
  • 3
    5-axisRotaries change the part, not the Z sign.
Setup

Reading Z on the setup sheet and at the machine

Machine zero is a fixed point the builder chooses, often the top of Z travel or the spindle gauge plane. Work zero is where you decide the part sits. The gap between them lands in a work offset such as G54. A tool change position is normally a safe positive Z value stored in the machine parameters.

Set the work offset by touching the tool to a known surface and reading the machine position. On a mill, Z zero is often the top face of the stock. On a plate job where the top face gets machined away, some shops set zero on the table or on a gauge block instead. Whichever you pick, write it on the setup sheet and keep it consistent across all operations.

Then verify. Run the program in single block with rapid override down, watch the distance-to-go readout, and stop the first approach move one inch above the stock. On a deep pocket, that habit catches a wrong offset before the tool reaches the bottom. Spindle load and axis load on the control give a second check: a sudden jump means the tool is cutting where it should be retracting.

The tolerance we hold on production parts is ±0.005 mm, which is far tighter than any Z setup error, so we check the first article on a CMM rather than trusting the display. At GreatLight, every job gets a raw material check, in-process monitoring, and a final inspection before shipment.

  • 1
    Write down part zeroTop face, table, or gauge block, and never mix them.
  • 2
    Single block the first approachStop one inch above the stock and check distance-to-go.
  • 3
    Watch the load metersA jump in Z load means unexpected engagement.
Depth and clearance

How Z direction drives depth of cut, clearance, and tool length

Every cutting move into a pocket or a slot is a negative Z move, measured from the part's top face. Roughing passes step down in Z, often 0.5 to 2 mm per pass in aluminium and less in titanium. The control adds the tool length offset to every one of those moves, so a wrong tool length number changes depth everywhere at once.

Clearance planes are positive Z values. A typical rapid plane sits 5 to 10 mm above the stock, and a retract plane sits higher, above any clamp or fixture. If the clearance plane is set too low, the tool drags across the part between features; if it is too high, cycle time grows on every hole.

Tool length also limits reach. A long tool in a deep cavity deflects, so the bottom of a deep bore or pocket tends to come out tapered or undersized. That is a mechanical problem, not an axis-direction problem, but it shows up as a Z error in inspection. The fix is a shorter tool, a larger diameter, or a different setup.

Spindle direction in Z also sets how chips clear. In a vertical machine, chips fall away from a downward-pointing tool, which is one reason vertical mills dominate general work. In a horizontal, chips fall onto the part and must be washed off, and Z moves may need to carry the tool clear before a tool change.

  • 1
    Roughing step-down0.5–2 mm per pass in aluminium, less in titanium.
  • 2
    Clearance plane5–10 mm above stock for rapid moves.
  • 3
    Deep pocketsLong tools deflect and read as Z error.
Reference

Z direction across common machine types

Same right hand, different machine layout.

Machine typeZ axis runs+Z meansPart zero often
Vertical 3-axis millAlong vertical spindleSpindle up, tool awayTop face of stock
Horizontal machining centerAlong horizontal spindleSpindle back, awayFace or fixture datum
CNC latheAlong the bedTurret away from chuckFinished face
5-axis trunnion millAlong spindle axisSpindle up in machine framePart center or top face
5-axis head-headAlong spindle axisSpindle away from partFixture datum

The rule in one line

If the tool is moving away from the part, that is +Z, whatever the machine looks like. Trust the direction of relative motion and verify the offset before the first cut.

FAQs

Frequently asked questions

Is Z always vertical?

No. Z is parallel to the main spindle axis. On a vertical mill that happens to be vertical, so most people learn it that way.

On a lathe or a horizontal machining center the spindle points sideways, so Z runs horizontally along the bed or the column.

Why does pressing Z+ raise the spindle?

Because +Z is defined as increasing distance between tool and workpiece. Raising the spindle on a vertical mill does exactly that.

On a machine where the table moves instead, Z+ lowers the table. The spindle-to-part distance still grows, so the sign is correct either way.

How do I set a Z work offset safely?

Pick a datum you can re-find: the top face of the stock, a gauge block on the table, or a fixture surface. Touch the tool to it, read the machine position, and store the number in the work offset.

Then prove it in single block with the rapid override reduced. Stop the first approach move above the stock and compare the distance-to-go readout with what you expect.

What is the difference between machine zero and part zero in Z?

Machine zero is fixed by the builder and never moves. Part zero is where you decide the workpiece sits, and it lives in a work offset such as G54.

Every Z move in the program is measured from part zero, then the control adds the work offset and the tool length offset to reach a machine position.

Does Z direction change on a 5-axis machine?

The sign convention does not change. Z still follows the spindle axis in machine coordinates.

The rotary axes change the orientation of the part relative to the tool, and the post processor handles that transform. What you must verify is the setup and the offsets, not the sign.

Can a wrong Z offset scrap a part?

Yes, quickly. A single wrong digit in a tool length offset shifts every depth move by that amount, so a shallow pass can become a gouge or a through-cut.

That is why first-article inspection matters. We check critical Z dimensions on a CMM and hold ±0.005 mm on production runs, with 100% inspection before shipment.

Send your drawing, get a Z-safe machining plan

Upload a STEP file and our engineers review tool reach, clearance, and Z datums before quoting. Quotation and free DFM analysis come back within 12 hours, and production can start within 24 hours.

12-hour quote100% inspectionNo minimum order quantity

Follow us

More CNC machining notes

We publish setup notes, tooling trials and inspection data from the factory floor.

FacebookTikTokYouTubeLinkedInInstagramThreadsPinterest

Trusted by engineers and manufacturers worldwide

Tesla Ford Motor Company BYD Auto Denso Magna International Boeing Airbus Medtronic KUKA FANUC