Free keychain set, about an hour to print Get it

Guides

STL files to G-code: slice for your printer, do not rename the file

STL files to G-code means slicing for your printer, not renaming the file. See what the machine runs and why a random download will not.

Illustrative image: a desktop printer on a wood bench, a pale filament spool in front, and a small faceted shape on the bed.

You turn a downloaded STL into a file your printer can run by slicing it. Slic3r reads 3D models (STL, OBJ, AMF, 3MF) and converts them into G-code instructions for 3D printers. Marlin Firmware says a 3D model must be prepared for 3D printing with a slicer that takes parameters such as print temperature, layer height, and infill density, and that the slicer generates a G-code file.

Renaming model.stl to a G-code name does nothing useful. The two files sit at different stages. The honest limit of this page is that it cannot pick temperatures, speeds, or layer height for your filament and machine. Those belong in the printer profile and the material notes, not in a general conversion guide.

Slice the model instead of renaming it

An STL is the shape. G-code is the job. The 3MF Consortium says STL saves no mesh topology, which leads to a larger file and a loss of manifoldness from rounding errors. That is still a description of geometry. It is not a list of moves.

Slic3r is a toolpath generator: it reads the model and writes G-code instructions. PrusaSlicer, from Prusa Research, is originally based on Slic3r. Its project page says it takes 3D models, generates 3D printing instructions, and can send them to a printer. A background on the mesh itself is in what are STL files. How STL sits next to 3MF is in 3D print file formats and what is a 3MF file.

Are STL and G-code the same? No. Are STL files G-code? No. Saving an STL "as G-code" means running that slice, then keeping the instruction file the slicer writes. You do not export a mesh and hope the printer invents the layers.

What the printer runs

Marlin runs G-code commands sent from a host over USB serial, from a serial controller, or directly from a file. So yes, many home printers run on G-code. They run the dialect that firmware expects, after a slicer has filled in the temperatures, the layer height, and the infill.

Slic3r says it supports known G-code dialects, and it names Marlin among them. A file sliced for a different dialect, a different bed, or a different nozzle is a different job.

Machining centers use a related language. A NIST report describes an interpreter which reads numerical control code and can drive machining centers. That report is about RS274 for machine tools. It is not a home-printer profile, and it is not a reason to send a metal-cutting program to a plastic printer.

Can you 3D print a G-code file? You run it. The printer follows the commands. You do not treat that file as a model to slice again. What is a G-code file in 3D printing? It is the instruction file the slicer generates. What is the format? A sequence of those commands, not a mesh of triangles.

A path that matches the machine

Use a slicer that knows the printer, then write the job.

  1. Install a slicer you can keep. UltiMaker says UltiMaker Cura is free and open source software, and that you prepare a 3D model for print with recommended settings by choosing speed and quality. PrusaSlicer generates 3D printing instructions from 3D models and lets you set printing parameters from the whole print down to single-layer adjustments. Slic3r itself converts STL models into G-code and says it wants 3D printing kept open and free.
  2. Open the STL in that slicer. Slic3r's readme names STL as an input it reads.
  3. Select the machine and the material profile before you generate anything. Marlin's description of slicing names print temperature, layer height, and infill density as parameters the slicer takes. If those do not match the printer on your desk, the file is for a different machine.
  4. Look at the preview. PrusaSlicer documents a 3D preview of the generated print instructions. If the preview shows a floating part or a mesh the slicer cannot close, fix the model first. The steps for a broken mesh are in fixing STL files.
  5. Write the G-code and send it the way that printer accepts. PrusaSlicer says you can send prints to the printer. Slic3r documents G-code generation and a USB or serial host, plus OctoPrint integration. Marlin can run the file from the host or from storage on the machine.

How to print with Cura, in the terms UltiMaker actually publishes: download the free app, prepare the model, and choose speed and quality settings. This guide stops at the settings UltiMaker actually names, and it leaves unpublished menu labels alone. How to export a G-code file, and how to make a G-code file for a 3D printer, is that same generate step. How do I create a G-code file? The slicer creates it from the model plus the printer parameters. You do not hand-type a home print.

If you have not printed before, start with how to 3D print and come back when you have a model and a machine profile.

Which free app should generate the G-code? This guide will not crown one app. The documented free choices above are UltiMaker Cura, Slic3r, and PrusaSlicer, which Prusa Research bases on Slic3r. Pick the one that already has a profile for your printer.

Online apps and CNC catalogs

A live result for this search, the CNC Apps STL to G-code page, sits in a catalog of online apps for metal, pipe, glass, and stone CNC machines, and the same catalog lists an STL to G-code app under a 3D printer heading. The captured form is titled "Create G-CODE from a STL file for 3D printers." Its fields include nozzle diameter, print center, Gcode flavor, filament diameter, temperature, bed temperature, layer height, fill density, travel speed, perimeter speed, and support material. Set those fields for your printer, then inspect the file the app writes before you print. Marlin's requirement, already above, is that a slicer take print temperature, layer height, and infill density. This form asks for those kinds of values.

A browser slice can still be real slicing. SimplyPrint's guide says you produce G-code by slicing, and that its service slices in the browser using slicer engines. That is a claim about that service. Read it as a vendor offer, not as proof that every "STL to G-code" website knows your nozzle.

Can I convert an STL file to G-code online for free? Yes. SimplyPrint's guide says you can convert STL to G-code online for free: sign up free, upload an STL or 3MF, pick the engine and printer profile, then slice and download. The same page says signup needs no credit card, and the free plan includes monthly cloud slices. Still choose your printer profile before that slice. A finished job for a different machine is the wrong file, which is the point of the printer-parameter step above.

Where can I download free G-code files? Where can I find G-code files? Where can I get free G-code files? Where can I download G-code files for my 3D printer? Make the file in the slicer with your printer selected. A G-code file published for someone else's machine is a job for that machine. Marlin's point is that the slicer has to take your parameters. Downloading a finished job skips that step.

A named design, separate from the slice

When modelling is the long way, a named design is the shortcut.

Our print-in-place fidgets are $5 each, or $15 with every design in the shop.

Questions on the handoff

How to turn STL files into G-code, how to save an STL file as G-code, and how to export a G-code file are one job: open the model, set the printer, generate the instructions, and keep that file. The first paragraphs above are the full answer. The questions below are the same job asked in pieces.

Is Cura 3D printing free? UltiMaker says UltiMaker Cura is free and open source software.

How to print with Cura? Prepare the model in that app and choose speed and quality settings, then generate the job the way the app offers. Pair it with a profile for your printer. The temperatures still come from that profile, not from this page.

Are STL files G-code? Are STL and G-code the same? No. One is the model Slic3r reads. The other is the instruction file it writes.

Can you 3D print a G-code file? You run the commands. Marlin runs them from a host or from a file.

What is the format of a G-code file? Command lines for the firmware. The machining cousin of that idea is numerical control code, which the NIST interpreter report describes. A printer file is the slicer's command list for your machine, not a triangle mesh and not a metal-shop program.

What is a G-code file in 3D printing? The print job. How do I create one, and how to make a G-code file for a 3D printer? Slice. Where can I download one for my printer? Build it in a free slicer with that printer selected, rather than hunting a finished file from a different machine.

Questions

Is Cura 3D printing free?

UltiMaker says UltiMaker Cura is free and open source software, and that you prepare a 3D model for print with recommended settings.

Are STL files G-code?

No. Slic3r treats STL as a model it reads, and it writes G-code instructions as a separate result.

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

Yes. SimplyPrint says you sign up free, upload an STL or 3MF, pick an engine and printer profile, then slice and download G-code in the browser. The free plan includes monthly cloud slices, and signup needs no credit card.

Do 3D printers run on G-code?

Marlin, a common printer firmware, runs G-code commands from a host or from a file. The dialect still has to match that firmware.

What is the format of a G-code file?

It is a sequence of commands the firmware runs, not a triangle mesh. A NIST report describes the machining form of that language as numerical control code.

Sources

Make something you'll love

Everything

Nine designs from the shop in a row, rendersRenders