G-code to STL Converter
Turn a sliced G-code file back into a closed solid of its printed layers, in your browser. No upload.
Plain text from a 3D-printer slicer. It stays on this device.
A slicer throws away the model and keeps the moves. We rebuild a solid from the moves, so you get the layers, not your original file.
- Curves come out stepped at the layer height
- Skirt, supports and wipe tower are left out unless you ask
- Large prints are slow, and large files don’t fit on a phone
Working…
Drag to turn, scroll or pinch to zoom.
This browser can’t show the 3D view (WebGL is off). The check and the download still work.
Filled closes the inside of the walls and keeps real holes. As printed keeps the infill pattern, and makes a far larger file.
This is not your original model. It is the layers your slicer planned, so curves come out stepped. Keep your original if you have it.
What you get, and what you don’t
G-code is a list of moves. The original model isn’t in it. We draw each layer’s moves onto a grid at the width of the bead, then join the layers into one closed surface. You get the shape of the print: stepped at the layer height, and rounded by the grid.
Filled mode treats the print as solid inside its walls, and keeps holes that only walls touch. It needs a slicer’s comments that label walls and infill. Without them only As printed works, which keeps the infill and every small gap, and is a far larger file.
What can’t be known from a G-code file
Every bead uses the one width the slicer states, or 0.45 mm if it states none, so real squish and over-extrusion aren’t in the solid. Parts that were separate in your design can come out joined. A file cut off partway usually has no end-of-print commands, and one with its start missing begins above the bed, and the page warns you of both. A print sliced shorter than you meant looks complete to any check, so the result always states its layers and height.
Size limits on phones
Rebuilding a solid uses a lot of memory. On a phone this page stops at 20 MB of G-code and a smaller grid, and it refuses a print that won’t fit, without trying. On a computer the limit is 300 MB. These are this page’s own limits. We haven’t run them on a real phone. Very large prints can take several minutes, and you can press Stop.
What was tested, and what wasn’t
We ran this page in a headless Chromium browser on 5 real files sliced by PrusaSlicer, plus our own sample and awkward files such as a file cut in half. Each download was read by three separate programs: a verifier of our own, trimesh and numpy-stl, and all were closed. 3DBenchy, a 3.7 MB file, took about 43 seconds on our laptop, and came out 60 × 31 × 48 mm. We haven’t had files from Cura, OrcaSlicer or Bambu Studio, or tried Safari, Firefox or a real phone.
Nothing here has been opened in a slicer or printed. MakerJig has no printer. Read how we test.
FAQ
Can you convert G-code back to STL?
You can rebuild a solid from it, and that’s what this page does. You can’t recover the original model, because the slicer discarded it. If you have the original STL or CAD file, use that instead.
Is my G-code uploaded?
No. The file is read and converted by this browser tab. Every test run logs the requests made while a file is in use, and none of them holds the file, its name or any part of it. The page still sends a page-view count and one “tool finished” count, which name the tool and not your file.
Why is my model stepped?
G-code only knows its layers, so a smooth curve becomes stairs at the layer height. A thinner layer height in the slicer gives finer stairs.
Which slicers work?
We tested files from PrusaSlicer. The reader also understands the comments Cura, Orca and Bambu Studio write, but we had no files from them to test. Binary G-code and .gcode.3mf files must be exported as plain G-code first.
Will the size be right?
The solid is built from the moves in the file and checked against them. It’s measured to the outside of the beads, so it can differ from your model by a fraction of a bead width.
Does this work for CNC or laser G-code?
No. There’s no plastic to rebuild, so the page says so and makes nothing. Use the G-code Viewer to look at those files.
Should I print this STL?
Treat it as a way to get a shape back, not a perfect copy. Slicing a stepped shape again adds its steps to the new print. We haven’t test-printed one.
More free tools
Updated .