G-code to STL Converter
Rebuild a mesh from a sliced G-code file when the original model is gone.
Built and maintained by Matúš Koleják, Co-Founder, TechDraw AI
Updated
Drop a file here. It never leaves your browser.
No sign-up · no upload · no watermark · no file size limit · STL first, 3MF and OBJ one click away
Have a different file? 3MF to STL Converter · OBJ to STL Converter · ZIP to STL Converter · PLY to STL Converter
How to convert a G-code to STL
Add your G-code
Drop a G-code onto the tool, or click to choose one. It is read in your browser and never uploaded.
Check the preview
Drag the model to turn it and confirm it rebuilt the way you expected. The triangle count, the size in millimetres and how many layers were read are all shown.
Download STL
Click Download STL. No account, no watermark, no waiting. 3MF and OBJ come off the same file with one more click.
What happens to your file
There is no model inside a G-code file, so this is a reconstruction and not a conversion. The extruding moves are read, and each one becomes a box as tall as the layer and as wide as the bead, with the width worked out per move from how much filament went in over how far the nozzle travelled rather than from a single guessed number, which is what makes a thin bead come back thin. Relative extrusion, G92 resets and z-hop are all handled. What comes back is a record of what the printer was told to lay down: layer lines are real geometry, curved walls return faceted at the slicer's resolution, and infill, supports and wall count are baked in permanently.
Starting from a photo or a drawing instead of a mesh? That is the image to STL converter, and a 2D outline becomes a solid on the DXF to STL converter.
About formats
G-code is the machine control language standardised as RS-274 in the 1960s for numerically controlled machine tools, and adapted by RepRap and Marlin for 3D printers. A file is a sequence of instructions to a machine, not a description of a shape: G1 X10 Y20 E0.5 means move there while pushing that much filament, and the object only exists as the accumulated consequence of tens of thousands of such moves. That distinction is the whole story when converting. There is no model in a G-code file to recover, so anything read back out is a reconstruction of the toolpath: the shape comes back at the slicer's layer height with visible layer lines as real geometry, curved walls return faceted at whatever resolution the slicer chose, and every decision the slicer made about infill, supports and wall count is baked in permanently. G-code is also dialect-ridden, since Marlin, Klipper, RepRap, Duet and every vendor's fork differ over what the non-motion commands mean, though the motion words that matter here are common to all of them.
- Developer:
- EIA / RepRap
- Initial release:
- 1960s
Frequently asked questions
How do I convert a G-code file to STL?
Drop the G-code onto the tool on this page and click Download STL. It is read and converted by JavaScript running in your browser, so there is nothing to install, no account to make and no queue to wait in. 3MF and OBJ come off the same file with one more click.
Is this G-code to STL converter free?
Yes. Free, no watermark, no file size limit, and no account needed to convert or to download. There is no paid tier of this tool to upsell you to.
Is my file uploaded anywhere?
No. The file is opened by code running in your browser tab and never sent to a server, which also means nothing is stored, logged or scanned. You can disconnect from the internet once the page has loaded and the converter keeps working. For a client's part under NDA that is the difference between usable and not.
Can you really get an STL back from G-code?
Not the original one, and any tool that says otherwise is overselling. G-code holds the path the nozzle took, not the shape somebody modelled. What this rebuilds is that path as a solid, which is genuinely useful when the model is lost and you need to measure it, remix it or reprint it somewhere else. What you cannot expect is a clean editable model: layer lines are real geometry in the result, curves come back faceted at the slicer's layer height, and the infill, supports and wall count the slicer chose are baked in for good.
How is the bead width decided?
Per move, from the file itself. The filament consumed over a move gives a volume, the distance covered gives a length, and the two with the layer height give the width of the bead that was laid down. That is why a thin perimeter comes back thin and a fat first layer comes back fat, instead of everything coming back at one guessed width. Set the filament diameter to 2.85 mm if you print on a Ultimaker or similar, since it changes the volume for the same E value.
Which slicers and dialects work?
The motion commands this depends on (G0, G1, G90, G91, G92, M82, M83) are common to Marlin, Klipper, RepRap and Duet, so G-code from PrusaSlicer, Cura, OrcaSlicer, Bambu Studio and Simplify3D all read. Both absolute and relative extrusion are handled, and z-hop is recognised as a travel lift rather than mistaken for a new layer.
The model stops part way up. What happened?
A large print can be millions of extrusion moves, and every one of them becomes geometry, so there is a ceiling on how much this will build in one go before the browser tab would stop responding. When that ceiling is hit the page says so under the preview rather than quietly handing you a partial file. Slicing the part at a coarser layer height, or slicing a smaller piece of it, keeps the result whole.
Is there a file size limit?
None imposed by the tool. The practical limit is your own machine's memory, since the file is held in the browser tab; a few hundred megabytes is fine on a desktop and less so on a phone. Nothing is queued or throttled because there is no server involved to queue it.