Gcode to STL Converter
Drop a .gcode file here
G-code from Cura, PrusaSlicer, OrcaSlicer, Bambu Studio and more · up to 300 MB
- Nothing uploaded
- No sign-in
- Binary STL
- Pick a layer range
- Rectangle or hexagon beads
Gcode to STL, with the trade-offs in plain sight
Every extrusion move becomes its own little solid, so you always see the triangle count and file size before you build.
- 12Triangles per rectangular bead (20 for hexagon)
- 8 MTriangle ceiling per export, about 400 MB of STL
- 0 uploadsThe G-code and the STL stay on your computer
How to convert G-code to STL
Three steps, about a minute for a typical part.

Open the .gcode file
Drop it on the tool or try the sample cube or vase. The toolpath appears as coloured lines first.
Choose what to rebuild
Set the layer range, tick the line types to keep, and check the line width and layer height (read from the file when the slicer wrote them).
Build and download
Click Build STL. The binary STL downloads, and parts under two million triangles also show as a grey solid you can orbit.
Convert G-code to STL in 15 seconds
A real screen recording of this converter on the calibration-cube sample, at normal speed.
- 1Open the sample cube0:00The toolpath loads as coloured lines, with the export panel under the preview.
- 2Pick the layers0:02Drag the top slider down to layer 51 so the STL shows the infill inside the walls.
- 3Build STL0:05The beads are written straight into a binary STL in a background worker; the file downloads when it is ready.
- 4Check the solid0:08The preview switches to the rebuilt mesh. Orbit around it before you open it in another program.
From extrusion lines to an STL mesh
G-code has no surfaces, only nozzle paths. The converter gives each extrusion line a cross-section and sweeps it along the move.
Width and height come from the file
; line_width = 0.45 ; layer_height = 0.2Slicer settings stored as comments fill in the bead size. Without them the converter uses 0.45 mm and the measured layer height.
Straight runs are merged
Consecutive moves in the same direction become one bead, which keeps the file smaller without changing the shape.
The result is the print, not the model
Layer steps, seams and infill are part of the mesh. To get the original smooth design back, you need the source STL or CAD file.
What a G-code to STL conversion keeps and loses
G-code is a list of nozzle moves, not a surface. The converter rebuilds those moves as geometry, which is useful for inspection, renders and documentation, but it is not the model you sliced.
How the rebuild works
- 1One bead per extrusion moveEach G1, G2 or G3 move that pushes filament becomes a box (line width × layer height) or a flattened hexagon along the move. Travel and retraction moves are dropped.
- 2Corners closed by overlapBeads are stretched by half a line width at both ends so corners meet. They overlap instead of being fused, so the STL is a pile of closed solids, not one watertight shell.
- 3Straight runs mergedWith merging on, connected moves in the same direction become one bead. Arc-heavy and curved toolpaths shrink the most.
- 4Millimetres, Z upCoordinates are kept as they are in the G-code, so the STL lands on the same spot of the build plate. G20 inch files are converted to mm.
From G-code to STL
| Information | In the G-code | In the STL |
|---|---|---|
| Shape of each printed line | Path + extrusion amount | Solid bead of the width and height you set |
| Layers | Z height per move | Kept as stepped geometry |
| Walls, infill, supports | Tagged by slicer comments | Kept or skipped by the line-type filter |
| Travel and retractions | G0 moves and negative E | Dropped |
| Speeds, temperatures, fan | F, M104/M109, M106 | Lost — STL is geometry only |
| Colours / tool changes | T0, T1 … and filament changes | Lost — one grey mesh |
| Original smooth surfaces | Already sliced into lines | Not recoverable |
Need the original part? Re-export it from your CAD program or slicer project. Use this converter when the G-code is all you have, or when you want to see the printed structure itself.
Real exports from this converter
Made from the two sample files on this page, which were generated by our own script.

Whole part as a solid
The spiral vase rebuilt bead by bead: 45,717 moves merged into about 38,000 hexagonal beads, a 36 MB STL.

Cut through the layers
Export layers 1 to 50 of the cube to show the infill pattern inside the walls.

Walls only
Untick infill and supports to get a light shell of the outer and inner walls.
What a printed part looks like up close
Reference photos of FDM prints. A G-code to STL export rebuilds the same layer lines and walls you can see here.

Reference example A finished benchmark boat
Every visible layer line on the hull is one Z step in the G-code, and one row of beads in the STL.

Reference example Test parts from one plate
Several parts sliced together share one G-code file; pick a layer range to export just part of the job.

Reference example Cubes and the spool they came from
Filament length and weight come from the same E values the converter turns into beads.
A G-code to STL converter that tells you the cost first
Settings that matter for file size and for how close the result looks to the print.

Reference example Line width and layer height
Filled in from the slicer settings stored in the file when available; otherwise 0.45 mm × the measured layer height.

Reference example Rectangle or hexagon beads
Rectangles are lighter (12 triangles); hexagons look more like real extruded plastic (20 triangles).

Reference example Layer range
Export one layer, a band of layers or the whole print. Cutting the part in half is the easiest way to show its insides.
Line-type filter
Keep or drop walls, infill, supports and other lines, based on Cura, PrusaSlicer, OrcaSlicer and Bambu Studio tags.

Size estimate and warning
The triangle count and STL size are shown before building, with a warning above 1.5 million triangles and a hard stop at 8 million.
Built in a background worker
The mesh is written straight into a binary STL in a Web Worker, so the page stays responsive while it builds.
Gcode to STL FAQ
What people ask before they try to turn G-code back into a model.
More ways to work with your 3D files
View, convert, or make a model from scratch.
Want a real model instead of a toolpath?
Generate a printable 3D model from a photo with AI, then download it as STL or GLB.
