Convert G-code to STL
Free G-code to STL converter that runs in your browser. See real dimensions before you download, and get a watertight, slicer-ready file.
Why convert G-code to STL?
People usually reach for G-code to STL when the original model is gone: a print they like was only saved as a sliced file, or a file arrived from someone who did not share the design. G-code is a list of printer moves, not a shape, so any conversion is a reconstruction. MeshShift reads the toolpaths and rebuilds them into a closed solid, layer by layer, with the preview showing which layers were found. The result approximates the printed object at the resolution you choose; it is not the original model. Fine detail smaller than the extrusion width, hollow interiors from infill and supports can all show up as imperfections. Treat it as a way to recover a usable shape, not to get a perfect copy.
How to convert G-code to STL
- Drop your G-code file onto the converter — it opens in your browser, nothing is uploaded.
- Check the preview and the dimensions in mm; fix units or the up axis in “Units & orientation” if the size or orientation looks wrong.
- Choose STL as the output (binary is smaller; ASCII is human-readable) and click Convert. Several files download as one ZIP.
What carries over from G-code to STL
| G-code | STL | Result | |
|---|---|---|---|
| Colour / materials | No | No | — |
| Textures | No | No | — |
| Units stored in file | Yes | No | Numbers in mm |
| Separate parts | No | No | — |
| Usual up axis | Z | Z | Unchanged |
What changes
- The mesh is rebuilt from toolpaths, so it is an approximation of the printed part.
- Layer lines may show as small steps; you may want to smooth the result afterwards.
- Supports, brims and skirts in the G-code can appear in the model unless removed.
- Slicer settings such as infill, speeds and temperatures are not part of the output.
Tips
- Try a finer resolution if details are lost, and a coarser one if the file is too big.
- Check the layer preview to be sure you are reconstructing the right object when the G-code has several.
- Run the print check and repair to close small gaps before slicing the rebuilt STL again.
- Expect to remove supports and edit the model in a mesh tool before reprinting.
About G-code files
G-code is the long-standing numerical control language for CNC machines, standardised as RS-274, and 3D printers use a dialect of it. A .gcode file is a text list of commands such as G1 X50 Y20 E0.8 F1800, which moves the nozzle while extruding, plus M-codes for temperatures, fans and bed settings. A slicer such as Bambu Studio, PrusaSlicer, OrcaSlicer or UltiMaker Cura produces it from a model by cutting the shape into layers and choosing perimeters, infill, speeds and supports. The result is tied to one printer, one filament profile and one set of settings. Prusa's firmware also accepts a compressed binary variant, .bgcode, and some machines use .gco or plain .g. Because it describes motion and not surfaces, G-code cannot be edited like a mesh, and it is not a way to share a design.
About STL files
STL was created by 3D Systems in the late 1980s for its stereolithography machines, and it became the default exchange format for 3D printing. A file describes a surface as a list of triangles, each with three vertices and a facet normal. That is all it contains. There is no header field for units, no colour, no texture and no notion of separate parts. Two flavours exist: ASCII, which is readable text but large, and binary, which spends exactly 50 bytes per triangle after an 80-byte header and a 4-byte triangle count. Binary is what almost every modern tool writes. Because the format is so small and so old, every slicer, CAD package and mesh editor can read it, which is why hobbyists still download most printable models as STL from sites like Printables and Thingiverse.
3D printing notes
STL is still the safest file to hand to a slicer. Bambu Studio, PrusaSlicer, OrcaSlicer, Cura and the resin tools Chitubox and Lychee all import it, and they all treat the numbers as millimetres. The usual problems are scale (a model exported from a metre-based tool arrives 1000 times too small) and meshes that are not watertight, which makes slicers fill or skip regions. MeshShift shows the real dimensions before you convert and can scale from metres automatically. Its print check lists holes, non-manifold edges and flipped normals, and one click rebuilds a closed solid at the same size. If you need colours or several plates in one file, use 3MF instead.
Frequently asked questions
Can G-code be converted back to the exact original STL?
No. G-code stores printer moves, not the model. The reconstruction is approximate and depends on layer height, extrusion width and the resolution you choose. It is useful for recovery, not for exact reproduction.
Why are supports in my converted STL?
Supports are printed material, so they appear in the toolpaths and are rebuilt like the rest. Remove them in a mesh editor or slicer, or print from a clean source file if you have one.
Is this G-code to STL converter free and private?
Yes. The conversion runs in your browser with JavaScript and WebAssembly, so your G-code file is never uploaded to a server. There is no sign-up, no watermark and no daily limit; very large files are limited only by your device's memory.