G-code to STL converter

Turn a G-code file back into an STL. It runs in your browser, so the file never leaves your computer.

What it does

A slicer turns a model into G-code. This goes the other way. It reads the moves that print the part and rebuilds the solid they lay down.

Each bead of plastic becomes a rounded strand as wide as the filament the move pushes out. The strands are joined into one closed surface, then simplified where the surface is flat.

How to use it

  1. Drop a .gcode file on the page, or pick one of the sample files.
  2. Choose the mesh, the resolution, how much to simplify, and whether you want the part as printed (the default) or filled. The other defaults suit most parts.
  3. Look through it layer by layer, then download the STL.

What you get

  • A closed (watertight) mesh. Every edge joins exactly two triangles, so the volume is real and CAD, meshing and simulation tools can use it.
  • As printed (the default): walls, solid layers and infill exactly as the printer lays them down, infill gaps included. Filled: the part's outer boundary only, for volume and simulation.
  • A viewer coloured the way a slicer preview is: outer wall, inner wall, solid top and bottom layers and sparse infill each in their own colour, and the selected layer's toolpaths drawn on the cut.
  • Simplified so the surface moves at most 0.02 mm, which makes files about 4 to 7 times smaller.
  • The size, volume, layer count and height, bead width, filament used, and what was left out.
  • The original hackathon box mesh as an option, for comparison.

G-code it reads

FDM G-code from Bambu Studio, OrcaSlicer, PrusaSlicer, SuperSlicer, Cura, ideaMaker and Simplify3D. It uses the comments these slicers write to keep only the part: start and end code, purge lines, skirts, brims, rafts, supports and wipe towers are left out. Files without those comments keep every extrusion.

Arcs (G2 and G3), relative and absolute moves, extruder resets (G92), inches (G20) and volumetric extrusion (M200) are handled.

How accurate it is

Checked against the CAD models Kinetic Vision gave out with their MakeUC 2024 challenge, with Inside set to Filled (as printed, the volume is the plastic actually laid down, so it is lower):

PartFrom the G-codeCAD model
Square prism, volume62.25 cm³62.50 cm³
Square prism, size24.99 × 99.99 × 24.98 mm25 × 100 × 25 mm
3DBenchy, volume15.44 cm³15.55 cm³
3DBenchy, size59.98 × 31.01 × 47.99 mm60 × 31 × 48 mm

Limits

  • Tops and bottoms can sit up to half a sample from their true height: 0.1 mm at the default resolution.
  • Detail smaller than a grid cell (0.3 mm by default) is smoothed. Fine resolution keeps more, but takes longer and makes bigger files.
  • The solid comes from the toolpath, so settings that change the toolpath, such as XY compensation, show up in the result.
  • Only FDM extrusion is read. Resin, laser and CNC G-code are not supported.

Where it came from

Arya Garg built the first version alone at MakeUC 2024 for the Kinetic Vision challenge, and it won the challenge. In 2026 it was rebuilt to run in the browser and to make a closed solid you can simulate with.

Questions

Can I convert G-code back to STL?
Yes. Load the .gcode file here and download the STL. The mesh is rebuilt from the extrusion moves, so it is the part as the printer would lay it down.
Is the STL watertight?
Yes, with the Solid mesh. Every edge joins exactly two triangles, and the page says so after each conversion. The hackathon box mesh is not watertight.
Is my file uploaded anywhere?
No. The file is read and meshed in your browser. Nothing is sent to a server.
Does it work with Cura, PrusaSlicer or OrcaSlicer files?
Yes. It reads G-code from Bambu Studio, OrcaSlicer, PrusaSlicer, SuperSlicer, Cura, ideaMaker and Simplify3D, and keeps only the part.
Why is the volume a little different from my CAD model?
The solid is built from the printed beads. Tops and bottoms can be up to half a sample off, small details are smoothed, and as printed (the default) the infill gaps count as empty. Set Inside to Filled to compare against a CAD model.
Is it free?
Yes. There is no account and no limit. The source code is on GitHub.