Why no converter makes G-code
An STL describes the surface of a model and nothing else: a list of triangles, with no unit and no color. G-code is a list of moves for one machine: where the nozzle goes, how fast, how hot, and how much plastic it pushes out on the way.
Getting from one to the other means cutting the model into layers, working out the walls and the infill of each layer, adding supports where the model overhangs, and planning a path for the nozzle through all of it. That job is called slicing, and the program that does it is a slicer. It needs to know the printer it writes for, which is why the same STL gives different G-code on two printers.
Which free slicer to use
All four are free and open source, and run on Windows, macOS and Linux. Each comes with printer profiles: choose yours when it first starts.
| Slicer | Made by | Best for |
|---|---|---|
| PrusaSlicer | Prusa Research | Prusa printers, and many others through its profiles |
| Bambu Studio | Bambu Lab | Bambu Lab printers |
| OrcaSlicer | Its open-source community, from a fork of Bambu Studio | Bambu Lab, Voron, Creality and many more, with calibration prints built in |
| UltiMaker Cura | UltiMaker | UltiMaker printers, and the longest list of others: Creality, Anycubic, Elegoo |
If your printer’s maker has a slicer of its own, start with it: its profiles are the ones the printer was tuned with.
From STL to G-code
- Choose your printer and filament. On first start the slicer asks for your printer; choose the material on the loaded spool (PLA, PETG) in the filament list.
- Open the STL. Drag it onto the slicer’s window, or use Import. Check its size in the slicer: if it is tiny, it was drawn in inches.
- Lay it flat. Put the largest flat face on the bed: “Place on face” in PrusaSlicer, “Lay on face” in Bambu Studio and OrcaSlicer, and in Cura’s rotate tool “Lay flat”, or “Select face to align to the build plate”.
- Set the three settings below, or keep the profile’s: they are a sound start.
- Slice and save. In PrusaSlicer, “Slice now”, then “Export G-code”. In Bambu Studio and OrcaSlicer, “Slice plate”, then “Export G-code file”. In Cura, “Slice”, then “Save to Disk”.
Bambu Studio and OrcaSlicer can also save a sliced 3MF (.gcode.3mf), which holds the G-code of each plate.
The three settings that matter
Layer height. How thick each layer is. 0.2 mm is the usual choice for a 0.4 mm nozzle; 0.1 mm gives smoother curves and takes about twice as long, 0.28 mm is quicker and rougher. PrusaSlicer, Bambu Studio and OrcaSlicer choose it through a print profile (“0.20mm Standard”, “0.20mm QUALITY”); Cura calls it Layer Height.
Infill. How much of the inside is filled, in percent. 15 to 20 percent holds up most parts; 40 percent and more is for parts that carry a load. It is called Fill density in PrusaSlicer, Sparse infill density in Bambu Studio and OrcaSlicer, and Infill Density in Cura.
Supports. A layer can only stand on the one below it, so a part that overhangs by more than about 45 degrees needs supports under it, which are broken off after printing. Turn them on for such a part: “Support on build plate only” in PrusaSlicer is the gentlest, Bambu Studio and OrcaSlicer have “Enable support”, and Cura has Generate Support. Turning the part so it overhangs less is often better than either.
Everything else, temperatures and speeds among it, comes from the printer and filament profiles. Leave it there until a print tells you otherwise.
Check the G-code before you print
A slicer shows a preview of its own, and it is worth a look. To check a file someone else sliced, or one you sliced a while ago, drop it on the G-code viewer. It shows each layer, plays the print, and gives its size, the filament it uses and the time it takes, from G-code by any of the four slicers above, binary G-code from PrusaSlicer, and a sliced 3MF from Bambu Studio or OrcaSlicer.
Look at the first layer, which has to be whole where the part meets the bed, and at the size: a part that should be 60 mm long and reads 2.4 mm was in inches.
What opens here
- The STL viewer shows an STL’s size, volume and surface area before you slice it, and finds holes and faces that point the wrong way. STL repair mends them.
- The 3MF to STL page turns a 3MF project from a slicer back into STL files, one for each object.
- The G-code viewer shows what a sliced file will print.
- The print cost calculator gives the cost of a print from its G-code or its model.
None of them uploads your file: each runs in your browser.
What this guide says about other programs was checked on their makers' own websites on . tab3d is not affiliated with any of them.
Questions
Can I convert an STL to G-code online?
Not with tab3d, which does not slice. G-code is written for one printer: its bed, its nozzle, its firmware and the filament in it, and a slicer with a profile for your printer knows all of that. Prusa's EasyPrint slices in the browser for Prusa printers and some others, with a Prusa Account: it runs PrusaSlicer on Prusa's servers, so the file is uploaded. The four slicers on this page are free to install and slice on your own computer. Once you have the G-code, the G-code viewer here shows what it will print before you start.
Can I turn G-code back into an STL?
Not faithfully. G-code holds the paths of the nozzle, layer by layer, not the surface of the model, and the infill and supports are mixed in with it. Ask whoever sliced it for the STL or the 3MF project.
Why is my print 25 times too small?
An STL has no unit. Slicers read its numbers as millimeters, so a model drawn in inches comes in 25.4 times too small. Scale it by 2,540 percent in the slicer, or open it in the STL viewer here first: a model under 10 units across is offered in inches, and the size is shown in both.
Which slicer should I choose?
The one made for your printer, if it has one: Bambu Studio for a Bambu Lab printer, PrusaSlicer for a Prusa. For other printers, choose the slicer that lists yours among its printer profiles: Cura and OrcaSlicer list many. A profile sets the bed size, the nozzle, the start code and the speeds, which are the settings that are hardest to get right by hand.
Is a 3MF better than an STL for slicing?
Often, yes. A 3MF keeps the unit, the colors and the parts of a model, and a 3MF project from a slicer keeps its settings too. An STL is the surface alone. Every slicer on this page opens both.