G-code viewer
Drop a G-code file below to see what it will print. When the slicer labelled its moves, the outer walls of every layer are rebuilt into a solid model; otherwise the toolpath itself is drawn. Either way you can save it as STL.
What a G-code file contains
G-code is a list of simple machine commands. For 3D printing almost everything is a G1 move with X, Y and Z coordinates and an E value for how much filament to push. Around those moves the slicer writes temperatures, fan speeds, retractions and — most usefully — comments describing what each move is: ;TYPE:External perimeter, ;TYPE:WALL-OUTER, ; FEATURE: Outer wall.
Those labels are what make it possible to reconstruct the object. The outer wall of each layer is the object's real outline at that height, so filling those loops and stacking them gives back the printed shape.
How this viewer draws G-code
- Labelled G-code — outer-wall loops are collected per layer, filled with holes respected, and extruded by the layer height. Consecutive identical layers are merged, so straight-walled parts become one clean block.
- Unlabelled G-code — every extrusion move becomes a small box the width of a typical line and the height of its layer.
- Arcs — G2 and G3 arc moves are split into short segments.
- Relative and absolute modes — G90/G91 and M82/M83 are followed, and G92 resets of the extruder are respected.
What to expect
The rebuilt model is as detailed as the slice: curved tops show steps the height of one layer, and the outline is the centre of the outer wall, so the result is a fraction of a millimetre smaller than the original. It is ideal for recovering a lost model, checking what a downloaded G-code prints, or measuring it — and for re-slicing at the same size. For a perfect copy, the original STL or 3MF is always better.
Why nothing is uploaded
Every other viewer you will find asks you to upload the file to a server, which renders it and sends back a picture. That means your model sits on someone else's disk, subject to their retention policy, their security and their terms.
This page does not work that way. The file is read by the browser FileReader API, parsed by JavaScript in your tab, and drawn with WebGL on your own graphics card. No request carrying your data is ever made — you can confirm this by opening your browser developer tools, switching to the network tab, and watching nothing happen when you open a file.
That is worth something if you work on anything confidential: client parts, unreleased products, prototypes under NDA. It also means the page keeps working with your network disconnected.
Frequently asked questions
What is a G-code file?
The instructions a 3D printer actually runs: move to this point, extrude this much plastic, heat to this temperature. A slicer such as PrusaSlicer, Bambu Studio, OrcaSlicer or Cura writes it from an STL or 3MF, for one particular printer, filament and set of settings.
Can I get my STL back from G-code?
Approximately, yes. When the slicer marked its outer walls — PrusaSlicer, Bambu Studio, OrcaSlicer, Cura and Simplify3D all do by default — each layer's outer outline is filled and stacked, which rebuilds the printed shape at the layer height you sliced with. Use the Convert button or the <a href="/convert/gcode-to-stl/">G-code to STL converter</a>.
Why do I see lines instead of a solid?
The file has no feature labels (common with older or minimal slicers, or G-code written by hand or by a CAM tool), so the outer walls cannot be told apart from infill. Every extrusion move is then drawn as a thin bead, which shows the toolpath faithfully.
Does it read Bambu .gcode.3mf files?
Not directly — that is a zipped project. Open it in Bambu Studio and export plain G-code, or unzip it and open the .gcode file inside the Metadata folder.
Is my file uploaded?
No. The G-code is read and drawn in your browser. Large files (hundreds of MB) may take a while and need plenty of memory.