---
tag: m0851
title: XYZ Probe Offset
brief: Set the Z probe XYZ offset from nozzle
author: thinkyhead

requires: HAS_BED_PROBE
eeprom: true

codes: [ M851 ]

notes: |
  The default (factory) values are set by
  - (version 1.x)
    - `X_PROBE_OFFSET_FROM_EXTRUDER`
    - `Y_PROBE_OFFSET_FROM_EXTRUDER`
    - `Z_PROBE_OFFSET_FROM_EXTRUDER`

    Where the X and Y offsets must be integers.

  - (version 2.x)
    - `NOZZLE_TO_PROBE_OFFSET`

  X and Y offset:
    Use a caliper or ruler to measure the distance from the tip of
    the Nozzle to the center-point of the Probe in the X and Y axes.

  Z offset:
  - For the Z offset use your best known value and adjust at runtime.
  - Common probes trigger below the nozzle and have negative values for Z offset.
  - Probes triggering above the nozzle height are uncommon but do exist. When using probes such as this, carefully set `Z_CLEARANCE_DEPLOY_PROBE` and `Z_CLEARANCE_BETWEEN_PROBES` to avoid collisions during probing.

  Assuming the typical work area orientation:
  - Probe to RIGHT of the Nozzle has a Positive X offset
  - Probe to LEFT  of the Nozzle has a Negative X offset
  - Probe in BACK  of the Nozzle has a Positive Y offset
  - Probe in FRONT of the Nozzle has a Negative Y offset

  Some examples:
  - `#define NOZZLE_TO_PROBE_OFFSET { 10, 10, -1 }   // Example "1"`
  - `#define NOZZLE_TO_PROBE_OFFSET {-10,  5, -1 }   // Example "2"`
  - `#define NOZZLE_TO_PROBE_OFFSET {  5, -5, -1 }   // Example "3"`
  - `#define NOZZLE_TO_PROBE_OFFSET {-15,-10, -1 }   // Example "4"`

  ```
     +-- BACK ---+
     |    [+]    |
   L |        1  | R <-- Example "1" (right+,  back+)
   E |  2        | I <-- Example "2" ( left-,  back+)
   F |[-]  N  [+]| G <-- Nozzle
   T |       3   | H <-- Example "3" (right+, front-)
     | 4         | T <-- Example "4" ( left-, front-)
     |    [-]    |
     O-- FRONT --+
   (0,0)
  ```

parameters:

- tag: X
  optional: true
  description: Z probe X offset
  values:
  - unit: linear
    type: float

- tag: Y
  optional: true
  description: Z probe Y offset
  values:
  - unit: linear
    type: float

- tag: Z
  optional: true
  description: Z probe Z offset
  values:
  - unit: linear
    type: float

examples:
- pre: Set a reasonable offset for an inductive probe
  code: M851 Z-2.0

- pre: A probe that is triggered by the nozzle itself
  code: M851 Z1.2

- pre: Set the XY distance (probe left front of nozzle)
  code: M851 X-1.70 Y-1.30

- pre: Set the XY distance (probe right back of nozzle)
  code: M851 X0.20 Y.40

---

Set the XYZ distance from the nozzle to the probe trigger-point. These offsets are required for the firmware to know how to probe the bed and where probed points are in relation to the nozzle, and _vice-versa_.

For LCDs that support MarlinUI you can enable `PROBE_OFFSET_WIZARD` and follow a guided process to set the probe Z offset.

If the Probe Wizard is unavailable, the easiest way to get the Z offset value (assuming your homed Z = 0.0) is to:
  - Home the Z axis.
  - Raise Z and deploy the probe.
  - Move Z down slowly and check when the probe triggers ([`M119`](/docs/gcode/M119.html)).
  - Take the current Z position (as reported by [`M114`](/docs/gcode/M114.html)) and negate it. (`5.2` => `-5.2`)
  - Set with `M851 Z-5.2` and save it with [`M500`](/docs/gcode/M500.html).
  - Configure with `#define NOZZLE_TO_PROBE_OFFSET {0, 0, -5.2}`.

For the X and Y offsets you have to measure the distance with a ruler or caliper.

The probe offsets don't modify the current coordinate system or existing leveling data, but do apply to subsequent uses of the probe.
