100% client-side — files never leave your device

How to Read G-code: A Practical Guide

G-code is the instruction tape your printer actually executes. The slicer writes it, the firmware runs it, and almost nobody reads it — until a print fails at layer 40 and the question becomes what exactly did I tell it to do?

The commands that carry the print

  • G0 / G1 — linear move. G1 X50 Y30 Z0.2 E1.5 F1800 means move to that point, extruding 1.5 mm of filament, at 1800 mm per minute. G0 is conventionally a non-extruding travel move.
  • G90 / G91 — absolute or relative coordinates. Almost all slicers use absolute for position.
  • M82 / M83 — the same choice for the extruder axis. Relative extrusion is now the common default.
  • G92 — redefine the current position without moving; usually used to zero the extruder counter.
  • M104 / M109 / M140 — set hotend and bed temperature; the M109 and M190 variants wait for it.

How layers appear in the file

There is no “new layer” command. A layer boundary is simply a Z move followed by more extrusion — which is exactly how the G-code viewer reconstructs the layer list. Slicers do write comments like ;LAYER:14, but they are hints for other software, not instructions.

What previewing catches

  • A broken first layer — gaps in the outline mean levelling or adhesion trouble before you have wasted an hour.
  • Missing support — obvious when you scrub to the layer where an overhang starts and find extrusion in mid-air.
  • Excess travel — many long travel moves across printed regions predict stringing.
  • Size surprises — the bounding box in millimetres, straight from the toolpath, catches a model that is quietly 2 mm over your build volume.

Estimates and why they differ

Any time estimate computed from feedrates alone is a lower bound: it ignores acceleration, jerk limits and heating. Your slicer models the firmware's motion planner and gets closer. Treat a viewer's number as “at least this long”.

Before you slice

Most print failures start upstream. Convert CAD properly with STEP to STL, inspect the mesh in the 3D viewer, and shrink oversized scans with the mesh simplifier. Then read the toolpath — it is the last exact description of what the printer will do.

More from the blog