Free online tool

STL to G-code Converter

This STL to G-code converter slices your model in the browser, with presets for Creality, Prusa, Anycubic, Elegoo and Voron printers and a preview of every layer.

A real slicer, not a file swap

Walls, top and bottom layers, lines, grid, triangle or gyroid infill, simple supports, skirt or brim, retraction and cooling, written as G-code with the temperatures, homing and layer comments that Marlin, Klipper and RepRapFirmware printers expect.

Check every layer before you print

Turn and zoom the model on your printer's bed, then step through the toolpaths layer by layer, coloured by feature, with travel moves on demand. You also get the print time, filament length, weight and cost.

Your model stays on your computer

The STL file is opened in your browser and sliced by a background worker, so it is never uploaded. Only your printer, filament and settings are remembered, in this browser's local storage.

How to convert STL to G-code

  1. 1

    Choose your printer and filament, or a generic Marlin, Klipper or RepRapFirmware printer, and check the bed size and start G-code.

  2. 2

    Load your STL file. Check its size, then rotate it, lay it flat on its largest face or scale it until it fits the build volume.

  3. 3

    Set the layer height, walls, infill, supports and speeds; the page slices the model and shows the print time, filament and cost.

  4. 4

    Step through the layers in the toolpath preview, then download the .gcode file and print it.

What people use this tool for

  • Slice a model on a Chromebook, a work computer or a borrowed laptop where you cannot install a slicer.
  • Get a quick print time, filament weight and cost estimate before you quote a print for a customer.
  • Make G-code for an Ender-3, Prusa, Kobra, Neptune or Voron printer from an STL you just downloaded.
  • Check how an overhang, a hole or a thin wall will print by stepping through the layers before you commit filament.

Frequently Asked Questions

How do I convert an STL file to G-code?

An STL file only describes a shape, so it has to be sliced: cut into layers, with walls and infill planned as nozzle paths. Choose your printer and filament here, load the STL, check that it fits the bed, and the page slices it in your browser. Step through the layers in the preview, then download a .gcode file and print it from an SD card, USB stick, OctoPrint or your printer's web interface.

Which printers does this STL to G-code converter work with?

There are presets for the Creality Ender-3, Ender-3 V2 and Ender-3 S1, the Prusa i3 MK3S+ and MK4, the Anycubic Kobra 2, the Elegoo Neptune 4 and the Voron 2.4 in 250, 300 and 350 mm sizes, plus generic Marlin, Klipper and RepRapFirmware printers. Each sets the build volume, nozzle, filament diameter, firmware and start and end G-code, and all of them can be edited. The preset start and end G-code is based on manufacturer documentation and has not been tested on real printers, so compare it with your printer's own profile before the first print. Bambu Lab printers normally print .gcode.3mf files from Bambu Studio, so they are not included.

Does it replace Cura, PrusaSlicer or Bambu Studio?

Not for complex prints. It is a quick slicer for common printers and everyday single-colour models: walls, solid top and bottom layers, four infill patterns, vertical support columns, skirt or brim, retraction, z-hop, cooling and seam placement. It has no multi-material, tree or organic supports, variable layer height, bridge detection, ironing, arc moves (G2/G3) or per-object settings, so use a desktop slicer when a print needs those. Walls between one and two line widths thick print as a single line of matching width; parts thinner than half a line width are left out, and the page says on which layers.

How accurate is the print time estimate?

Each move is timed with a trapezoidal speed profile: the head accelerates to the set speed, cruises and slows down, with corner speeds from the cornering setting and look-ahead across moves, much as Marlin and Klipper plan them. Heating and bed levelling are not included, and your firmware’s own acceleration settings change the real time, so enter them under Printer, Motion limits if you know them.

What size of STL file can it slice?

Binary and ASCII STL files of up to 2,000,000 triangles and 300 MB. In our tests in Chrome on an M1 Max laptop, a 2-million-triangle model (95 MB) loaded and was checked in about 1.5 seconds and sliced into 500 layers in about 4 seconds; phones and older computers take longer. Slicing runs in the background with a progress bar and a Cancel button, so the page stays responsive.

What if my STL file has holes or errors?

The page reports the triangle count, size, volume, open edges and faces that point inwards. It merges duplicate vertices, removes collapsed and duplicate triangles and turns inward-facing triangles the right way. While slicing it closes gaps in an outline up to two line widths wide, and bridges larger holes with a straight edge when the outline still encloses its area, telling you when it did. Badly broken meshes are better repaired in PrusaSlicer, Meshmixer or Blender first.

How do supports work here?

Choose Touching the build plate or Everywhere and an overhang angle measured from vertical (50° by default): any part of a layer that reaches further than that beyond the layer below gets support. Supports are vertical columns of lines or a grid at 15% density by default, one empty layer below the model and 0.7 mm away from it, so they snap off. Touching the build plate skips any support that would stand on the model.

Is my STL file uploaded or stored?

No. The file is opened and sliced on your device by a background worker, and the G-code is made there too; nothing is sent to a server. Your printer, filament and settings, including edited start and end G-code, are kept in this browser's local storage under zutilium:stl-to-gcode. Models and G-code are never stored.