Free online G-code viewer

Drop a .gcode file to see the path the nozzle will take, one layer at a time. It is parsed in your browser; the file is not uploaded.

How to preview a G-code file

  1. Drop the .gcode (or .gco, .g) your slicer wrote. Plain-text G-code from PrusaSlicer, OrcaSlicer, Bambu Studio, Cura and others is read; absolute and relative extrusion are both handled.
  2. Drag the layer slider to build the print up from the bed and stop at any layer. The route button adds travel moves — the nozzle moving without extruding — which are hidden to begin with.
  3. Read the panel: layer count, the length of the extruded path and of travel, and the size of the printed part, measured from extruding moves only so the trip from the home corner does not inflate it.

G-code is instructions, not a model

A G-code file is the list of commands a slicer wrote for one printer: move here, extrude this much, set that temperature. The shape of the part exists in it only as the route of the nozzle. That is why a G-code file cannot be turned back into an STL — the surface is gone, and what is left depends on a nozzle width and layer height the mesh never had.

The viewer draws each straight move as a line at the centre of the nozzle’s path. Moves that push filament are drawn bright, moves that do not are travel. A layer, here as in the loader this is built on, starts when extrusion begins at a new height.

For avatars this format is unrelated: it holds no mesh at all, let alone a skeleton. It is on this site because people who make 3D things also print them.

What this viewer does not do

Lines are centre lines: they have no width, so this is not the solid, colour-by-feature preview a slicer shows, and walls, infill and supports are not told apart. Arc moves (G2 and G3, written when arc fitting is on) are not drawn; the panel counts them so that gaps in a curved wall are explained. Print time, filament weight, temperatures and speeds are not calculated.

Commands must be written the way slicers write them, with spaces between the words (G1 X10 Y5 E0.4). Hand-written CNC code without spaces is not parsed. Binary G-code (.bgcode) is recognised and refused with the setting that turns it off. A file with no extrusion at all — CNC or laser work — is drawn as one path with every move visible, since there is no print to separate from travel.

Frequently asked questions

Can I convert G-code back to STL?

No, and not only here. Slicing throws the surface away and keeps a toolpath for one nozzle, one layer height and one printer. Tools that claim to reverse it produce a rough shell traced around the paths, not the model. If you need the mesh, find the original STL or 3MF.

Why are some walls shown as travel, or missing?

Two usual causes. If the slicer had arc fitting on, curved sections are written as G2/G3 arcs, which are not drawn — the panel shows how many. And a few firmware dialects mark extrusion in ways a general parser does not see. Relative extrusion (M83), the default in PrusaSlicer, OrcaSlicer and Bambu Studio, is handled.

What units is the file in?

The file says: G21 sets millimetres, G20 inches, and the panel reports which it found. Slicer output is millimetres in practice. If neither command appears, millimetres are assumed and the panel says it is an assumption.

The layer count differs from my slicer's. Which is right?

Both, by different rules. This page counts a layer each time extrusion starts at a new height. Slicers count the layers they planned; with variable layer height, vase mode or Z-hop while printing, the two can differ by a few. The printed height in the panel is measured from the moves and does not depend on the count.

Does it open .bgcode from PrusaSlicer?

No. Binary G-code is a compressed container, not text. The page recognises it and tells you; in PrusaSlicer, turn off “Supports binary G-code” in the printer settings and export again to get a plain .gcode.

Is my file uploaded?

No. The text is parsed and drawn in your browser. Slicer comments in the file — which can include printer names and settings — stay on your machine.

How large a file can it handle?

A typical print of tens of megabytes opens in a few seconds. Very long prints with millions of moves take longer and need memory in proportion, because every move becomes a line segment.

Looking for the model, not the toolpath?

The mesh a print was sliced from is an STL or a 3MF. The STL viewer and the 3MF viewer open those and report their size, so you can compare it with the printed size shown here.

Open the STL viewer