Kairo3D
NewPixal3D is live
Free G-code tool

Gcode to STL Converter

Turn the toolpath inside a .gcode file back into a 3D mesh. Every extrusion line becomes a solid bead, so the STL shows exactly what the printer would lay down. Runs in your browser; nothing is uploaded.

Drop a .gcode file here

G-code from Cura, PrusaSlicer, OrcaSlicer, Bambu Studio and more · up to 300 MB

No file? Try:Runs in your browser — your files are never uploaded.
  • 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.

Gcode to STL converter showing the rebuilt spiral vase as a grey solid with the export settings panel
  1. Open the .gcode file

    Drop it on the tool or try the sample cube or vase. The toolpath appears as coloured lines first.

  2. 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).

  3. 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.

Watch it work

Convert G-code to STL in 15 seconds

A real screen recording of this converter on the calibration-cube sample, at normal speed.

  1. 1Open the sample cube0:00The toolpath loads as coloured lines, with the export panel under the preview.
  2. 2Pick the layers0:02Drag the top slider down to layer 51 so the STL shows the infill inside the walls.
  3. 3Build STL0:05The beads are written straight into a binary STL in a background worker; the file downloads when it is ready.
  4. 4Check the solid0:08The preview switches to the rebuilt mesh. Orbit around it before you open it in another program.
How it works

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.

A real bead is a squashed oval about one line width wide and one layer high. The STL replaces it with a rectangle (4 corners, 12 triangles per segment) or a hexagon (6 corners, 20 triangles).
Side view: beads stack one layer height apart, so the STL keeps the stepped profile of the print — walls at the edges, infill inside.
  • Width and height come from the file

    ; line_width = 0.45 ; layer_height = 0.2

    Slicer 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 you get

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

InformationIn the G-codeIn the STL
Shape of each printed linePath + extrusion amountSolid bead of the width and height you set
LayersZ height per moveKept as stepped geometry
Walls, infill, supportsTagged by slicer commentsKept or skipped by the line-type filter
Travel and retractionsG0 moves and negative EDropped
Speeds, temperatures, fanF, M104/M109, M106Lost — STL is geometry only
Colours / tool changesT0, T1 … and filament changesLost — one grey mesh
Original smooth surfacesAlready sliced into linesNot 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.

  • Spiral vase G-code converted to STL and shown as a grey solid with visible layer lines

    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.

  • Half of the calibration cube exported as STL, showing the diagonal infill inside two walls

    Cut through the layers

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

  • Calibration cube walls exported as STL without infill, a hollow square tube

    Walls only

    Untick infill and supports to get a light shell of the outer and inner walls.

Compare with the real print

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.

  • Orange 3D-printed benchmark boat on a dark build plate
    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.

  • White FDM test parts laid out: an arch, a cube, pins and letters
    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.

  • Black printed cubes and straps beside a spool of filament
    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.

  • Macro close-up of orange infill walls showing individual layer lines
    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.

  • Hands holding a grey bone-shaped printed bracket with rounded edges
    Reference example

    Rectangle or hexagon beads

    Rectangles are lighter (12 triangles); hexagons look more like real extruded plastic (20 triangles).

  • Tall olive-green printed box on a build plate, layer lines clearly visible
    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.

  • Calibration cube rebuilt as a grey STL solid in the converter preview

    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.

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.

Try image to 3D