Z offset calculator: save a babystep or adjust for a new build plate

Your new Z offset is the old one plus or minus the distance the nozzle has to move. Whether it's plus or minus depends on where the setting lives: in Klipper's probe z_offset a bigger number puts the nozzle closer, while in Marlin's M851 a bigger number lifts it. Enter the change and your current value to get the number to save.

What changed

Pick where the change comes from. Every option ends in the same thing: how far the nozzle has to move.

mm

As Mainsail, Fluidd, Klipper's SET_GCODE_OFFSET and Marlin's M290 count it: minus moved the nozzle down.

Where you save it

The same move is a bigger number in some places and a smaller one in others.

mm

Read it from printer.cfg, M851 or M503, the printer's menu or the slicer.

Move the nozzle

–

New value

–

Type or send this

–

How do you calculate z offset?

Start from your current Z offset and add or subtract the distance the nozzle has to move. Settings where a bigger number lifts the nozzle (Marlin M851, Prusa Live Z, slicer Z offset, Bambu G29.1) take current minus the move toward the bed. Klipper’s probe z_offset and position_endstop take current plus the move.

new = current + move   Klipper z_offset, position_endstop; Marlin M206; Duet G31 Z
new = current − move   Marlin M851; Prusa Live Z; PrusaSlicer, OrcaSlicer, Cura plugin; Bambu G29.1

In the formulas, “move” is how far the nozzle goes toward the bed. It is negative when the nozzle has to go up. A babystep is counted the other way: Klipper, Mainsail, Fluidd and Marlin’s M290 all treat a positive babystep as lifting the nozzle. So a babystep of -0.05 is a move of 0.05 mm toward the bed.

Worked example: a Marlin babystep

Marlin’s docs give this one, and it’s the calculator’s default: “a print that needed M290 Z-0.05 to look right with an offset of −1.40 wants M851 Z-1.45.”

  1. The babystep was −0.05 mm, so the nozzle moved 0.05 mm toward the bed.
  2. M851 is a setting where a bigger number lifts the nozzle, so new = −1.40 − 0.05 = −1.45 mm.
  3. Send M851 Z-1.45, then save it with M500.

The same 0.05 mm move on a Klipper printer with a probe z_offset of 1.500 gives 1.550. One change, written with the opposite sign.

Which way does z offset go?

It depends on the setting. In Klipper’s probe z_offset and position_endstop, a higher number puts the nozzle closer to the bed. In Marlin’s M851, Prusa’s Live Z and the slicer Z offset, a more negative number brings it closer. A babystep is plus for up and minus for down everywhere.

Setting Bigger number moves the nozzle Source
Klipper [probe] / [bltouch] z_offset Closer Klipper Z_OFFSET_APPLY_PROBE subtracts the babystep from it; Voron docs: “A positive change will result in more squish”
Klipper [stepper_z] position_endstop Closer Voron docs: “higher values for the position_endstop means that the nozzle will be closer to the bed”
Klipper SET_GCODE_OFFSET, Mainsail, Fluidd Farther Klipper docs: moves get the offset “added to their Z height”
Marlin M851 Z Farther Marlin docs: “More negative brings the nozzle closer to the bed”
Marlin M290 Z Farther Marlin docs: M290 Z-0.02 lowers the nozzle by 0.02 mm
Marlin M206 Z Closer Marlin docs: M206 Z-0.2 raises Z on the first layer
Prusa Live adjust Z Farther Prusa: to get closer, “further increase the negative value”
PrusaSlicer, OrcaSlicer Z offset Farther Tooltip: a nozzle left 0.3 mm high takes −0.3
Cura Z Offset plugin Farther README: a positive value prints “further away from the build plate”
Bambu G29.1 Z{…} Farther Bambu wiki: first layer too high, decrease the offset
Duet G31 Z Closer Duet docs: to move closer, “increase the G31 Z value”

The reason for the split: Klipper’s z_offset and Duet’s G31 Z are the nozzle’s height when the probe triggers, so a bigger value makes the firmware think it’s higher than it is and drive further down. Marlin’s M851 is the probe’s offset from the nozzle, negative for the usual probe that triggers below the nozzle. The slicer offset is added to every Z in the G-code.

Saving a babystep

A babystep made during a print is lost at power-off on most printers. Write it into the saved setting:

  • Klipper with a probe. Z_OFFSET_APPLY_PROBE, then SAVE_CONFIG. Klipper takes the babystep “and subtract[s] it from the probe’s z_offset”, which is the calculator’s z_offset line.
  • Klipper with an endstop. Z_OFFSET_APPLY_ENDSTOP, then SAVE_CONFIG. It subtracts the babystep from position_endstop in the same way.
  • Marlin with a probe. With BABYSTEP_ZPROBE_OFFSET enabled, “every Z babystep is also added to the probe Z offset, in memory.” You only need to send M500. Without it, set the M851 value the calculator gives, then M500. The option needs a probe and doesn’t work with MESH_BED_LEVELING.
  • Marlin without a probe. Marlin’s docs say the probe offset doesn’t apply on an endstop-only printer: adjust the endstop or use babystepping. M206 sets a home offset instead, with the opposite sign to M851. Store it with M500.
  • Prusa (non-loadcell). Live adjust Z belongs to the active steel sheet profile, one value per sheet. Prusa says it typically sits between −1.500 and −0.200 and can’t go above zero.
  • Prusa MK4, MK3.9 and XL (loadcell). The nozzle probes the sheet itself, and Prusa says Live Z and the sheet profiles “are not necessary with the loadcell”. To fine-tune, Prusa points to PrusaSlicer’s Z offset, “where a negative value means a more squished first layer”.
  • Duet. Duet’s docs: “If you have to move the nozzle closer to the bed, increase the G31 Z value by the amount of baby stepping used.”
  • Bambu. Bambu’s wiki documents one route: change G29.1 Z{-0.02} in the printer’s start G-code in Bambu Studio. It calls this a quick, temporary fix: “First layer too high → decrease the offset.”

Z offset after a plate swap

What changes depends on what the probe senses. Only the part of the plate the probe can’t see moves the offset.

How the printer finds the bed What a new plate changes Enter in the calculator
Z endstop switch Everything: the switch never sees the bed. Klipper: “rerun the paper test to measure each type of surface” Whole plate thickness, old and new
Inductive probe (Prusa PINDA, SuperPINDA) or eddy-current scan (Beacon, Cartographer) Only the non-metal layer on top. Marlin: “The probe senses the metal under the sheet, so a thicker sheet needs a more positive offset by the difference” Coating, PEI film or glass thickness, old and new
BLTouch, CR Touch, Voron Tap, Prusa loadcell, Bambu nozzle contact Nothing in principle: the pin or nozzle touches the new surface Nothing to change

Prusa sheets show the inductive case. Prusa says its textured sheets are thinner than the smooth PEI (polyetherimide) ones, so “you need to move the nozzle bit closer”. Each sheet profile keeps its own Live Z because the printer “cannot sense which steel sheet is installed.” Prusa doesn’t publish the thickness difference in millimeters, so measure both sheets, or tune Live Z on the new sheet with a one-layer test.

Z offset on textured PEI

On a textured PEI plate the nozzle homes on the tops of the texture, so even a touch probe ends up a little high. Bambu’s own start G-code trims for this with G29.1. Its comment reads “for Textured PEI Plate, lower the nozzle as the nozzle was touching topmost of the texture when homing”:

Bambu printer Textured PEI trim
X1 Carbon, P1S G29.1 Z{-0.04}
A1, A1 mini G29.1 Z{-0.02}
H2D G29.1 Z{-0.02} (−0.01 with a 0.2 mm nozzle)

Bambu lists 0.075 mm of PEI coating on its textured plate and a 0.125 mm PEI sheet on its smooth plate, both on spring steel. Those are the calculator’s plate defaults. On an inductive probe, going from that smooth layer to that textured one calls for moving the nozzle 0.05 mm closer.

Z offset vs first layer height

The Z offset sets where Z = 0 sits. The first layer height is how far above that zero the slicer prints the first layer. The layer height has no effect on the offset: Klipper defines z_offset as “the distance between the bed and the nozzle when the probe triggers”, which depends only on the hardware.

The two meet in one place: a negative slicer Z offset as large as the first layer height puts the nozzle on the bed. The Cura plugin blocks this: “the Z Offset can never be lower than the negative of the Initial Layer Height.”

Finding the change: the one-layer test

The calculator needs the size of the move. Marlin, Klipper and Prusa all find it the same way: print a one-layer test and adjust while it prints.

  1. Print a single-layer square or patch.
  2. Read the lines. Ellis’ tuning guide: “You should still clearly be able to see the lines. If it’s completely smooth, your squish is too much. If you see gaps between the lines, you need more squish.” Klipper’s docs add that a bottom layer that bulges out at the sides was printed too close, and one narrower than the layers above was printed too far.
  3. Babystep while it prints. Marlin’s docs say to adjust “in steps of 0.02 mm to 0.05 mm until the lines are flat on top and touch each other.” Klipper’s docs put typical corrections in the tens of microns (0.010 mm).
  4. Put the babystep total into the calculator and save the result.

Don’t use calipers on the printed layer: Prusa’s knowledge base says “measuring the printed layer with calipers is not a recommended method to calibrate the first layer.”

The paper test only gets you close. Klipper puts paper at about 0.100 mm and says to run the test with the nozzle and bed at room temperature, while Marlin’s docs run it at printing temperature.

Published · Figures last checked

Sources

  1. Marlin Firmware documentation, Z offset and babystepping (accessed 2026-10-19)
  2. Marlin Firmware documentation, M851 XYZ Probe Offset (accessed 2026-10-19)
  3. Marlin Firmware documentation, M290 Babystep (accessed 2026-10-19)
  4. Marlin Firmware documentation, M206 Set Home Offsets (accessed 2026-10-19)
  5. Marlin source, src/module/motion.cpp (home offset and probe offset) (accessed 2026-10-19)
  6. Klipper documentation, Configuration reference: probe (accessed 2026-10-19)
  7. Klipper documentation, G-Codes: SET_GCODE_OFFSET (accessed 2026-10-19)
  8. Klipper documentation, G-Codes: Z_OFFSET_APPLY_PROBE (accessed 2026-10-19)
  9. Klipper documentation, G-Codes: Z_OFFSET_APPLY_ENDSTOP (accessed 2026-10-19)
  10. Klipper source, klippy/extras/probe.py (Z_OFFSET_APPLY_PROBE) (accessed 2026-10-19)
  11. Klipper source, klippy/extras/manual_probe.py (Z_OFFSET_APPLY_ENDSTOP) (accessed 2026-10-19)
  12. Klipper documentation, Bed level (paper test, surfaces, fine tuning) (accessed 2026-10-19)
  13. Voron documentation, Initial startup checks (z_offset and position_endstop direction) (accessed 2026-10-19)
  14. Mainsail source, ZoffsetControl.vue (babystep buttons) (accessed 2026-10-19)
  15. Prusa Knowledge Base, Live adjust Z (accessed 2026-10-19)
  16. Prusa Knowledge Base, Steel sheet profiles (accessed 2026-10-19)
  17. Prusa Knowledge Base, First layer calibration (i3) (accessed 2026-10-19)
  18. Prusa Knowledge Base, Flexible steel sheets guidepost (accessed 2026-10-19)
  19. Prusa Knowledge Base, Loadcell (MK4/S, MK3.9/S, XL) (accessed 2026-10-19)
  20. PrusaSlicer source, PrintConfig.cpp (z_offset tooltip) (accessed 2026-10-19)
  21. OrcaSlicer wiki, Printer basic information: Z offset (accessed 2026-10-19)
  22. Cura Z Offset plugin (fieldOfView), README (accessed 2026-10-19)
  23. Bambu Lab Wiki, A1 mini print issues troubleshooting (G29.1 Z offset) (accessed 2026-10-19)
  24. Bambu Studio printer profiles (start G-code, G29.1 plate trims) (accessed 2026-10-19)
  25. Bambu Lab store, Smooth PEI plate (accessed 2026-10-19)
  26. Bambu Lab store, Textured PEI plate (accessed 2026-10-19)
  27. Duet3D documentation, Testing and calibrating a Z probe (G31) (accessed 2026-10-19)
  28. Beacon documentation, FAQ (what the probe senses) (accessed 2026-10-19)
  29. Voron Tap, README (accessed 2026-10-19)
  30. Antclabs, BLTouch (accessed 2026-10-19)
  31. Ellis' Print Tuning Guide, First layer squish (accessed 2026-10-19)