Z-offset is the vertical correction between the point where your probe or Z endstop triggers and the real surface of the bed, so the nozzle sits at the right height for the first layer. In Klipper’s words, the probe z_offset is “the distance between the nozzle and bed when the probe triggers”; in Marlin, M851 sets the distance from the nozzle to the probe trigger point. You set it once with a paper test or a calibration print, fine-tune it live while the first layer prints, then save it so it survives a reboot.
The commands differ by firmware. Marlin uses M851 (probe offset), M290 (babystepping) and M500 (save). Klipper uses PROBE_CALIBRATE, TESTZ and ACCEPT, then SAVE_CONFIG, with SET_GCODE_OFFSET plus Z_OFFSET_APPLY_PROBE for live changes. Prusa printers have First Layer Calibration and Live Adjust Z, or an automatic load cell. All syntax below is taken from the Marlin, Klipper and Prusa documentation linked at the end; step sizes are marked as starting points when no document gives one.
The consumer toolchanger 3D printer: the SnapSwap 4-toolhead system swaps heads in 5 seconds for true multi-color and multi-material printing, with smart calibration and auto filament loading.
- 4 toolheads · 5 s swap
- Up to 500 mm/s · 20,000 mm/s²
- 270 mm cube build volume
- Multi-color & multi-material

Set the Z-offset in five steps
- Level the bed or build a mesh first. A Z-offset cannot fix a tilted bed (see how to level the bed).
- Clean the nozzle and the print surface of plastic and grease.
- Set a rough value: the paper test, a probe wizard or your printer’s first-layer calibration.
- Print a single-layer test at your normal temperatures and adjust live in small steps until the lines just touch with no gaps and no ridges.
- Save it: M500 on Marlin, SAVE_CONFIG on Klipper, the calibration menu on Prusa. Unsaved values vanish at the next reboot.
Z-offset, bed leveling and probe offset
Bed leveling (or a mesh) tells the printer how flat and tilted the bed is. The Z-offset tells it how high above the bed the nozzle should sit once it knows. They interact: with an automatic probe, the probe offset is the number that lets mesh points translate into nozzle height, so re-run your mesh after changing it. Marlin’s documentation says probe offsets apply to later probing and do not change existing leveling data, which is why a fresh mesh is needed. For probe wiring and X/Y offsets see BLTouch and CR Touch setup.
The two firmwares define the number differently, so never copy a value from one to the other. Marlin’s page notes that common probes trigger below the nozzle and have negative M851 Z values (its examples include M851 Z-2.0 for an inductive probe). Klipper defines z_offset as a distance between nozzle and bed at trigger.
Marlin: M851, babystepping and M500
Marlin’s M851 sets the probe offsets: M851 Z-2.0 is the documented example for an inductive probe, and the value is saved with M500. If the firmware was built with PROBE_OFFSET_WIZARD, the LCD can walk you through the offset instead. After changing it, home and re-run your bed leveling (for example G29), because the existing mesh is not rewritten.
For live adjustment during the first layer use babystepping. M290 Z0.25 moves the nozzle up 0.25 mm; Marlin says these babysteps are not added to the current coordinates and are meant for small corrections at the start of a print. If BABYSTEP_ZPROBE_OFFSET is enabled, M290 also changes the probe Z offset, and the new value can be saved with M500. Use M290 P0 if you want to leave the probe offset alone. The LCD relabels the menu “Babystep Z Probe Offset” when that option is on.
Without a probe, the Z endstop sets the height. Marlin’s M206 applies a persistent home offset (its documentation example is M206 Z-0.2 to raise Z slightly for the first layer) and it is saved with M500 when EEPROM_SETTINGS is enabled. Check the result with a test print, because the sign depends on your printer’s setup.
Klipper: PROBE_CALIBRATE, TESTZ and SAVE_CONFIG
Klipper’s paper test is the documented route. Cut a piece of copy paper about 5 × 3 cm (roughly 0.1 mm thick, the exact thickness is not important), clear any plastic off the nozzle and bed, and do it with both at room temperature. Then:
- Home the printer and move the toolhead near the centre of the bed.
- Run
PROBE_CALIBRATE. Klipper probes, moves the nozzle over the probe point and starts the manual probe tool. For printers with only a Z endstop,Z_ENDSTOP_CALIBRATEis the matching helper for position_endstop; it uses the same manual probe tool. - Slide the paper under the nozzle while you lower it with
TESTZ Z=-.1(0.1 mm closer;Z=.1raises it). Stop when the paper drags with a small amount of friction.TESTZ Z=-andZ=+move halfway between the last two positions, andZ=++/Z=--jump back to earlier ones. - Run
ACCEPT, thenSAVE_CONFIG, which overwrites printer.cfg and restarts the host.
Klipper’s docs add three cautions. Calibrate X/Y probe offsets first. Probes have a temperature bias, so run the tools at a consistent temperature and compare PROBE_ACCURACY at room and print temperature. And a changed hotend position, probe location or bed tilt invalidates the result: repeat PROBE_CALIBRATE and then your bed mesh.
For the live fine-tune, send SET_GCODE_OFFSET Z_ADJUST=-0.02 MOVE=1 (Mainsail, Fluidd and KlipperScreen do this for you with their babystep buttons). Z_ADJUST adds to the existing offset, and MOVE=1 makes the toolhead move now instead of at the next absolute move. The offset is added to Z height, so a negative value lowers the nozzle; check on the printed lines and reverse if it gets worse. When the first layer looks right, run Z_OFFSET_APPLY_PROBE (or Z_OFFSET_APPLY_ENDSTOP without a probe), which subtracts the current gcode offset from the probe z_offset, then SAVE_CONFIG. Without that last step the value is lost.
Prusa printers: First Layer Calibration and Live Adjust Z
| Printer family | How Z-offset is set | Notes from Prusa |
|---|---|---|
| MK3/MK3S/MK3.5, MMU printers | First Layer Calibration prints a zig-zag with a square; turn the knob during the print | Counter-clockwise brings the nozzle closer and moves the value away from zero. A common range is -0.400 to -1.500, but check visually, not by a fixed number |
| MINI/MINI+ | Control, Live Adjust Z, or First Layer Calibration | Common range -0.400 to -1.900 on the smooth sheet. If you reach -2.000 without enough squish, Prusa says to raise the probe 0.5–1 mm and start from zero |
| MK4/S, MK3.9/S, CORE One, XL | Load cell calibrates the first layer automatically | Long-press the knob during the first layer for a fine-tune; it is not saved for the next print. A PrusaSlicer Z offset (Printers, General) can be set instead, where negative squishes more |
| Live Adjust Z on MK3-style menus | LCD Menu, Live adjust Z, while the first layers print | Changes made while printing persist after power off. Typical values -1.500 to -0.200; positive values are not possible |
Prusa says PETG and other high-temperature materials usually need a slightly more squished first layer than PLA, that each sheet type needs its own calibration, and that you should rerun First Layer Calibration after a nozzle change, extruder upgrade, axis change or moving the printer. Do not compensate for poor adhesion by lowering the value far: Prusa warns that too low gives ridges and curling edges and can damage the sheet.
Bambu Lab printers
Bambu Lab publishes a separate first-layer guide on its wiki for each printer family. We could not open those pages while researching this article, so we are not giving menu paths, step sizes or limits for Bambu machines here. The principles above still hold: fix the bed and surface first, adjust in small steps while the first layer prints, and only treat a manual offset as a fine-tune on top of the printer’s own calibration. Use your model’s wiki page for the exact procedure.
When the Z-offset needs redoing
| Change | Why | What to do |
|---|---|---|
| New nozzle, hotend or extruder | Nozzle tip height changes | Redo the paper test or First Layer Calibration (Prusa lists this explicitly) |
| Different build sheet | Surfaces differ; Prusa says live Z must be readjusted when you switch sheets on PINDA printers | Calibrate per sheet; Prusa has sheet profiles for this |
| Probe moved or bed tilt changed | Klipper says this invalidates PROBE_CALIBRATE | Rerun PROBE_CALIBRATE, then the bed mesh |
| Different temperatures | Klipper notes many probes have a temperature bias | Calibrate at the temperature you print at, or compare PROBE_ACCURACY cold and hot |
| New material | Prusa: PETG usually needs slightly more squish than PLA | Fine-tune live; save a per-material offset only if your setup supports it |
Z-offset problems and fixes
| Symptom | Likely cause | Fix |
|---|---|---|
| Value is back to the old one after a reboot | Not saved | Marlin: M500. Klipper: SAVE_CONFIG after Z_OFFSET_APPLY_PROBE. Prusa MK4/CORE One: live adjust is per print only |
| Good in the centre, bad at the corners | Bed tilt or no mesh, not Z-offset | Level or mesh again, then fine-tune (bed leveling) |
| Gaps between lines, lines peel | Nozzle too high | Move 0.02–0.05 mm closer, a starting point of ours, and wait a few lines. Read the pattern in first layer calibration |
| Ridges, see-through lines, scratched sheet | Nozzle too close | Raise the nozzle and check the sheet for damage. For bulging edges see elephant’s foot |
| First layer fine but parts still lift | Not a Z-offset problem | Check surface cleanliness and temperature: prints not sticking to the bed |
Frequently asked questions
What is a good Z-offset value?
There is no universal number because it depends on your probe, nozzle and surface. Prusa quotes a common range of -0.400 to -1.500 for MK3-family printers but stresses that you must check visually, and Marlin’s examples show negative probe offsets such as -2.0 for an inductive probe. Do not copy a value from another printer.
Why does my Z-offset reset after a reboot?
Because it was only a live adjustment. Save it: M500 on Marlin, Z_OFFSET_APPLY_PROBE followed by SAVE_CONFIG on Klipper. On Prusa MK4, CORE One and XL a long-press adjustment during the first layer is not saved for the next print.
Can I set the Z-offset in the slicer?
On Prusa printers yes: PrusaSlicer has a Z offset under Printers, General, where a negative value means a more squished first layer, and it applies only to the G-code where it is set. In Klipper you can also put a SET_GCODE_OFFSET line in your start G-code, but keep the saved printer offset as the base.
Do I need to change the Z-offset between PLA and PETG?
Prusa says PETG and other high-temperature materials usually need a slightly more squished first layer than PLA. Start with the same offset, print a first-layer test with the new material and adjust by a small step if the lines are not even.
Sources
- Marlin docs: M851 Z probe offset
- Marlin docs: M290 babystepping
- Marlin docs: M206 set home offsets
- Klipper docs: G-Codes (SET_GCODE_OFFSET, Z_OFFSET_APPLY_PROBE, TESTZ)
- Klipper docs: Bed Leveling (paper test)
- Klipper docs: Probe calibration
- Prusa Knowledge Base: Live adjust Z
- Prusa Knowledge Base: First Layer Calibration (MK3 family)



