From the Maker’s Bench

Insights from our network of 3d print operators and designers.

Intagly team·Updated

How to Convert STL to G-code

Slice an STL into G-code for your printer: the right slicer, the exact export button, .gcode vs .gcode.3mf vs .bgcode, and the first-slice mistakes to avoid.

You don’t really convert an STL to G-code, you slice it. Open the STL in the slicer made for your printer, choose your printer, nozzle and filament, press Slice, then send the result to the printer or export it to a USB stick or SD card. The file you get only works on the printer you sliced it for, so always slice for your own machine. For Bambu Lab printers, many in our network slice in Bambu Studio and send the job over the network. For most other printers, OrcaSlicer is the favorite choice.

File is a STEP, OBJ or 3MF? Most slicers open those directly. If a tool or service insists on STL, convert it free with our STEP to STL, OBJ to STL or 3MF to STL converter.

About to print a G-code file someone else sliced? Read the G-code safety checklist first.

Which slicer to use for your printer

Use the slicer your printer’s maker ships, because it already has the right printer profile: bed size, nozzle, firmware and the start routine that heats, homes and levels. Five of these are built on OrcaSlicer, so the steps below look almost the same in all of them.

Your printerSlicer (October 2026)Button to pressFile you get
Bambu Lab (A1, P1S, P2S, X1, H2D)Bambu Studio 2.8“Print plate” (network) or “Export plate sliced file” (microSD).gcode.3mf
Prusa (MINI, MK4, XL, CORE One)PrusaSlicer 2.9“Export G-code” or “Export to SD card / Flash drive”.bgcode (MINI, MK4, XL) or .gcode
CrealityCreality Print 7 (Orca-based)Slice, then print over the network or export (Orca layout).gcode
ELEGOOElegooSlicer 1.5 (Orca-based)Slice, then print over the network or export (Orca layout).gcode
AnycubicAnycubic Slicer Next (Orca-based)Slice, then print over the network or export (Orca layout).gcode
FlashforgeFlash Studio (formerly Orca-Flashforge)Slice, then print over the network or export (Orca layout).gcode
Klipper, Marlin or anything elseOrcaSlicer 2.4 or UltiMaker Cura 5.13“Export G-code file” (Orca) or “Save to Disk” (Cura).gcode

All of these are free. Download them from the printer maker’s website or the slicer’s official GitHub page, never from a download mirror.

An STL model being sliced into G-code layers

How to convert STL to G-code, step by step

The button names below are from Bambu Studio and OrcaSlicer. PrusaSlicer and Cura use the same steps with slightly different labels (see the next section).

  1. Install the slicer and add your printer. The setup wizard asks for the printer model and the nozzle size. Most printers ship with a 0.4 mm nozzle; if you’ve swapped it, pick the one that’s fitted.
  2. Pick the filament profile for the spool you’ll load (for example Generic PLA). The profile sets the nozzle and bed temperatures, so it has to match the plastic.
  3. Import the STL. Drag the file onto the plate, or use File → Import (Ctrl+I).
  4. Check the size. STL files have no units. If a model imports tiny, it was probably designed in inches: scale it by 2540% (25.4 ×). Our STL scaler fixes it in your browser.
  5. Lay it flat and add supports if needed. Use “Lay on face” to put the biggest flat side down. Turn on supports for anything that starts in mid-air or overhangs steeply.
  6. Slice. Press “Slice plate”. The slicer cuts the model into layers and writes the toolpaths.
  7. Check the preview. Scroll through the layers, and read the estimated time and filament. Look for gaps, parts floating in the air, and a first layer that covers the full footprint.
  8. Send or export. “Print plate” (Bambu Studio) or “Print” (OrcaSlicer, with a networked printer) sends the job over the network — what we do on our Bambu printers. “Export plate sliced file” or “Export G-code file” saves it so you can copy it to a USB stick or microSD card.
Bambu Studio Preview tab after slicing: the Slicing Result panel with filament used and print time, and the Print plate dropdown open

Slicer by slicer

Bambu Studio (what we use on Bambu printers)

Bambu Studio print button dropdown: Print plate, Print all, Send, Send all, Export plate sliced file, Export all sliced file

After “Slice plate”, open the arrow next to “Print plate”. With a Bambu printer selected you get “Print plate” and “Send”, which go over the network, and “Export plate sliced file”, which saves a .gcode.3mf for the microSD card. “Export G-code file” (plain .gcode) only appears when a non-Bambu printer is selected. Bambu printers want the .gcode.3mf: it holds the G-code plus the thumbnail and AMS color data. On our Bambu Lab printers we use the Generic PLA profile with our own pressure-advance values, and press “Print plate”. Bambu Studio also warns you when the printer you picked doesn’t match the one you’re sending to.

OrcaSlicer, Creality Print, ElegooSlicer, Anycubic Slicer Next and Flash Studio

To open an STL in OrcaSlicer, drag it onto the plate or use File → Import (Ctrl+I); OrcaSlicer also opens 3MF, STEP, OBJ and AMF files. Then “Slice plate”, and open the arrow next to the print button: “Print” sends the job to a printer you’ve connected (Klipper/Moonraker, OctoPrint and others) and “Export G-code file” saves it. The vendor versions add their own printers and cloud printing, but the layout is the same. On our Neptune 4 Max we run OrcaSlicer with a heavily customized start G-code and Klipper printer.cfg (adaptive bed mesh, SCREWS_TILT_ADJUST) — which is exactly why G-code from our machine wouldn’t run properly on yours.

OrcaSlicer Preview for an ELEGOO Neptune 4 Max with Generic PLA: sliced model, filament and time estimate, the G-code viewer, and the Print / Export G-code file dropdown

PrusaSlicer

Press “Slice now”, then “Export G-code” (Ctrl+G). With a USB stick or SD card plugged in you also get “Export to SD card / Flash drive” (Ctrl+U), and “Send to printer” once a networked printer is set up. Since PrusaSlicer 2.7, Prusa MINI, MK4 and XL printers get binary G-code (.bgcode) by default: about 70% smaller and read by Prusa firmware 5.1 and newer. If you print through OctoPrint, switch it off or use File → Convert.

UltiMaker Cura

Slicing an STL in UltiMaker Cura

Add your printer under Settings → Printer → Add printer, open the STL, pick the material and a profile, and press “Slice”. Check the Preview tab, then “Save to Disk” or “Save to Removable Drive”. Cura isn’t Orca-based and has its own settings names, but it works for most Marlin and Klipper printers.

Which file does my printer need?

FileWhat it isWho uses it
.gcodePlain-text machine instructions for one printerMost Marlin and Klipper printers (Creality, ELEGOO, Anycubic, Voron and more)
.gcode.3mfG-code packed with a preview image and filament/AMS dataBambu Lab printers (and OrcaSlicer, if you turn it on)
.bgcodeCompressed binary G-codePrusa MINI, MK4 and XL on firmware 5.1 and newer
.3mf (project)The model plus your slicer settings, not sliced yetSharing a print setup; open it in a slicer and slice it for your printer
.stlThe shape only: triangles, no units, no settingsWhat you download and slice

Only print G-code sliced for your printer

G-code is a list of moves and temperatures for one specific machine. Run a file made for a different printer and it can drive the nozzle into the bed, move past the end of an axis or heat to the wrong temperature.

  • Slice it yourself. Don’t print ready-made G-code from model sites or forums. Download the STL or 3MF and slice it for your printer.
  • Match the printer and nozzle. Pick your exact printer model and the nozzle that’s fitted. Prusa firmware refuses G-code for another model, and Bambu Studio warns on a mismatch; most other printers just run it.
  • Re-slice after hardware changes. A new nozzle size, hotend, build plate or start G-code means old files are out of date.
  • Edit start G-code only if you know each line. It homes, levels and heats the printer before the first layer; one wrong value can crash the nozzle.
  • Watch the first layer of every new file, and know how to stop the printer from its screen.
  • Use the right filament profile. The wrong temperatures can clog the nozzle or leave a part that breaks.

Can you convert STL to G-code online, or on your phone?

Yes, but pick a real slicer, not a generic file converter.

  • In the browser: Kiri:Moto (grid.space) is a full slicer that runs in your browser without uploading the file. Prusa EasyPrint (on Printables and in the Prusa app) runs PrusaSlicer on Prusa’s servers and works on a phone or tablet. Some printer apps and cloud services, such as Creality Cloud, slice in the cloud too.
  • On a phone: Prusa EasyPrint and the Creality Cloud app slice your own STL. Bambu Handy reprints models from MakerWorld with their print profiles, but for your own STL you’ll want Bambu Studio on a computer.
  • Generic “STL to G-code converter” sites usually don’t say which slicer they run, use a generic start G-code, can’t make a .gcode.3mf or .bgcode, and keep your upload on their server with no stated retention. Use them only if you know your printer’s start G-code and settings by heart.

Skip slicing: get it printed

No printer, or no time? Upload the STL (or a 3MF, OBJ, STEP or STP) and get an instant quote. A maker in our network prints it and ships it to you; you never touch G-code.

Model won’t slice, or needs changes? Broken meshes, missing walls and parts that need resizing or splitting go to a designer: start a free engineer chat.

Already slicing like a pro? Print orders for others on Intagly.

First-slice mistakes and how to fix them

MistakeWhat you seeFix
Wrong printer or nozzle profileNozzle scrapes or crashes, print in the wrong spot, warning on the printerSelect your exact printer and fitted nozzle, then re-slice
Wrong filament profileStringing, poor layer bonding, clogsPick the profile for the spool you loaded (PLA, PETG, TPU…)
Model designed in inchesModel imports tinyScale by 2540%, or use our STL scaler
No supportsOverhangs droop, parts start in mid-airTurn on supports (tree supports leave fewer marks)
Model not flat on the bedOnly a corner touches the plateUse “Lay on face” and re-slice
First layer too high or too lowPrint won’t stick, or the first layer is see-through or roughRe-run bed leveling; clean the plate; adjust Z offset
Wrong file type for the printerPrinter doesn’t list the fileBambu: .gcode.3mf. Prusa MINI/MK4/XL: .bgcode. Others: .gcode

Filament for your first slice

Start with PLA: it prints at low temperatures, needs no enclosure, and every slicer’s Generic PLA profile works with it out of the box. These are the spools we buy again and again. Move to PETG when a part has to take heat or a knock (see our PETG filament guide). Skip carbon-fiber and other specialty filaments for a first print: they need a hardened nozzle and tuned settings. For most prints, filament is the biggest cost per part, so our makers stock up on these spools when they’re discounted. Check the current price before you buy.

UseSpoolSlicer profile
First prints (what we use most)ELEGOO PLAGeneric PLACheck price
First prints, fast printersOVERTURE PLAGeneric PLACheck price
Tougher, heat-resistant partsOVERTURE PETGGeneric PETGCheck price

Still choosing a printer? Our best 3D printers under $300 guide compares the ones we’d buy.

What is G-code? (STL vs G-code)

An STL describes a shape as thousands of triangles. It has no units, no colors and no print settings. G-code is the opposite: a plain-text list of instructions for one printer — heat to this temperature, move here, push out this much plastic. A short print has thousands of lines. Here are a few, explained:

G-code lineWhat it tells the printer
M140 S60Heat the bed to 60 °C (and keep going)
M104 S210Heat the nozzle to 210 °C
G28Home all axes
G1 X50 Y50 Z0.2 F3000Move to X50 Y50, 0.2 mm above the bed, at 3,000 mm per minute
G1 X100 Y50 E5 F1500Move 50 mm along X while pushing out 5 mm of filament

OrcaSlicer shows the real file next to the preview: in the screenshot above, the panel on the right lists the last lines of a Neptune 4 Max job, including the Klipper-only EXCLUDE_OBJECT_END line — another reason G-code doesn’t move between printers.

A 3MF sits in between: it can hold the shape plus your slicer settings, but it still has to be sliced. For the full comparison of STL, OBJ, 3MF, STEP and G-code, see our 3D printing file types guide.

FAQ

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

Open the STL in a slicer (Bambu Studio, OrcaSlicer, PrusaSlicer or Cura), select your printer, nozzle and filament, press Slice, then send or export the file. See the step-by-step above.

Can I convert STL to G-code online for free?

Yes. Kiri:Moto slices in your browser and Prusa EasyPrint slices on Prusa’s servers, both free. A desktop slicer is still the safer choice, because it carries your printer’s exact profile.

Can I convert STL to G-code on Android or iPhone?

Yes, with a cloud slicer app such as Prusa EasyPrint (Prusa app) or Creality Cloud. Bambu Handy reprints MakerWorld models but isn’t made for slicing your own STL.

How do I open an STL file in OrcaSlicer?

Drag it onto the build plate, or use File → Import (Ctrl+I). Then press “Slice plate”, and “Print” or “Export G-code file”.

How do I convert STL to G-code in Cura?

Open the STL, choose your printer and material, press “Slice”, then “Save to Disk” or “Save to Removable Drive”.

Do Bambu Lab printers use G-code?

Yes, packed inside a .gcode.3mf file. Bambu Studio sends it over the network with “Print plate”, or saves it for the microSD card with “Export plate sliced file”.

What is the difference between STL and G-code?

An STL is the shape of the object. G-code is the set of instructions that tells one particular printer how to build that shape, layer by layer.

Can I convert G-code back to an STL?

Only roughly. Tools can turn the toolpaths back into a mesh, but infill, supports and seams are baked in and the original surfaces are gone. Ask the designer for the STL or 3MF instead.

Why won’t my printer read my G-code?

Usually the file type is wrong (Bambu wants .gcode.3mf, recent Prusas default to .bgcode), the file was sliced for another printer, or the file name or card format isn’t one the printer accepts. Re-slice for your printer and export again.

*Some links in this guide are Amazon affiliate links. As an Amazon Associate, Intagly earns from qualifying purchases, at no extra cost to you.