---
tag: g029
title: Bed Leveling
brief: Probe the bed and enable leveling compensation
author: thinkyhead
pagetype: toc

group: calibration
requires: AUTO_BED_LEVELING_*|MESH_BED_LEVELING
eeprom: true

codes: [ G29 ]

---

When you build Marlin you have the option to include one of 5 different bed leveling systems. Each leveling system comes with its own set of options and makes `G29` behave differently, so documentation for these G-codes is divided up into 5 separate pages.

### Mesh-based Leveling
Mesh leveling measures the height of the bed at several points to generate a 3D mesh representing bed imperfections. With compensation enabled, the nozzle follows the bed contours by dynamically adjusting the Z position (using bilinear interpolation between the measured points). The nozzle follows the contours of the bed more accurately with more mesh points and/or finer segmentation of moves.

- [Mesh Bed Leveling](/docs/gcode/G029-mbl.html) provides an economical interactive manual mesh-based leveling system for small boards or machines without a probe. Marlin provides a UI but an LCD controller is not required.

- [Auto Bed Leveling (Bilinear)](/docs/gcode/G029-abl-bilinear.html) provides mesh-based bilinear leveling, either with or without a probe (but not both).

- [Unified Bed Leveling](/docs/gcode/G029-ubl.html) provides mesh-based bilinear leveling with partial probing and many options to fit a mesh to the whole bed. Planar (matrix) operations can be applied to the mesh data, but active compensation is mesh based.

### Matrix-based Leveling
With matrix-based leveling the height of the bed is measured at three points, or in a grid, to generate a rotation matrix. This matrix is used to rotate points in 3D space relative to the tilt of the bed. So if you print an object on a tilted surface the entire object is tilted. This system assumes the bed is perfectly flat, so it is most suitable for high end machines.

- [Auto Bed Leveling (Linear)](/docs/gcode/G029-abl-linear.html) provides matrix-based Linear (least-squares) leveling, with or without a probe.

- [Auto Bed Leveling (3-Point)](/docs/gcode/G029-abl-3point.html) provides matrix-based 3-point leveling, with or without a probe.
