Free online STL to G-code converter

Free STL to G-code Converter

Convert STL to G-code free, right in your browser. Load a mesh, dial in the print profile, and export toolpaths as G-code — nothing is uploaded, and there is no account to create.

  • STL input
  • Layer-based slicing
  • G-code export
3D viewportno model
100%

Drop an STL to begin

The file is parsed, previewed and sliced in this tab. Nothing is uploaded anywhere.

  • .stl
  • binary + ascii
  • up to 250 MB
  • assumed mm
triangles
—
bounding box
—
layers
—
toolpaths
—
contours
—
units
mm
Print settingsno model

Print settings are available once a model is loaded.

Quality

The settings that decide how the model is cut.

Sets the Z resolution, and with it the number of layers.

0—100

How much of each layer's interior is filled.

1—10

Perimeters around every cross-section.

The shape of the infill lines inside the walls.

Filament & nozzle

What the toolpath is measured against, and what lays it down.

Recorded in the program header.

0.1—1.2

The width of one extruded line.

0.1—2

Matches the hardware the program is cut for.

0.5—5

Turns a path length into a filament length.

Structure

How the walls and solid layers are arranged.

1—20

Solid layers on top.

1—20

Solid layers underneath.

Temperature

Written into the program's start and end sequences.

0—300
0—120
Speed

Feedrates, and the acceleration between them.

10—400
100—20000
Filament handling

Retraction, priming, and the spool.

0—20
100—5000

Total, not remaining. Recorded in the header.

load a model to slice it

Model informationgeometry
File
—
Format
—
Size on disk
—
Triangles
—
Unique vertices
—
Size (W × D × H)
—
Min corner
—
Max corner
—
Centre
—
Units
—
Surface area
—
Volume
—
Mesh integrity
—
G-code resultno model

No G-code generated yet

Load a model to slice it, and the program it produces appears here.

How it works

A free STL to G-code converter that runs in your browser

An STL file is geometry: a list of triangles with no instructions, no temperatures and no layer order. A printer needs the opposite — a stream of moves, an extruder to feed and a bed to stick to. Something has to stand between the two, and that something is a slicer. This is a free STL to G-code converter that does the whole job: it measures the mesh, cuts it into layers, plans perimeters and infill, and writes a complete G-code program your printer can run.

Because it is an online STL to G-code converter, all of that happens in the tab you are reading this in: no account, no queue, no watermark, no limit on how many files you convert. The viewport above is the tool — the sections below explain what it does with your file once you drop it in.

How to use the converter

  1. step 01

    Load your STL

    Drag the file onto the viewport or click it to browse. Binary and ASCII STL are both read automatically, up to 250 MB, and the extension is checked before anything is parsed so a mis-named file is refused rather than half-read.

  2. step 02

    Check the geometry

    The model panel reports what was measured from your file: triangles, unique vertices, bounding box, surface area, and whether the mesh is closed and consistently wound. Volume appears only on a watertight solid.

  3. step 03

    Set the print profile

    Layer height, infill, walls, temperatures, speeds and retraction all change the toolpaths, and every edit re-slices the model at once, so the panel always describes the program you actually have.

  4. step 04

    Download the G-code

    The result panel shows the first lines of the real file beside the measured figures: layers, toolpaths, extruding and travel moves, filament length and mass, print time and peak flow.

Why this is the best STL to G-code converter to keep open

Most online converters trade one of these away: a free tier that puts a watermark on the file, a queue that means uploading a design to somebody else's computer, or a slicer that reports numbers it estimated rather than measured. This one is built as STL to G-code converter software that happens to run in a page, which is how it keeps all three.

Nothing is uploaded

Parsing, slicing and G-code generation all run in this tab. Your model never reaches a server, and it is not kept after you close the page — the only thing saved between visits is your theme choice.

Live re-slicing

Change a setting and the toolpaths are recalculated immediately, so a profile can be compared against the geometry instead of guessed at.

Your printer, not a preset guess

Nozzle, filament and extrusion widths are inputs rather than assumptions, and out-of-range values are clamped to what the hardware can do.

Numbers measured from the file

Filament used, print time and peak flow are computed from the moves that were written, so the figures describe the G-code you are about to print.

Mesh integrity checks

Open edges, non-manifold edges and reversed winding are reported on load, so a mesh that cannot print is caught before it is 400 layers deep.

No install, no account

It runs in any modern browser on desktop, tablet or phone. There is nothing to download, activate, or pay for.

Print settings you can control

The print profile is the part of a slicer that decides what the numbers on a spool mean for your machine. Everything below changes the toolpaths and re-slices the model as soon as you edit it.

Layer height
The Z resolution, and with it the layer count. 0.20 mm is the general-purpose default; 0.08 mm buys detail, 0.28 mm is for fast prototypes.
Infill density and pattern
How much of each layer's interior is filled, and in what shape — lines, grid, gyroid, cubic or triangles. Density sets material use.
Wall loops
Perimeters wrapped around every cross-section. They carry most of a part's strength, so more walls mean less infill needed.
Top and bottom layers
The solid layers that give a part its skin, and the difference between a print that looks closed and one that leaks.
Extrusion width
The width of one extruded line, and the unit everything else is measured against: a wall is one line of this width, and infill spacing follows it.
Nozzle and filament diameter
The hardware the program is cut for. The nozzle decides what fits; filament diameter turns path length into plastic.
Temperature, speed, acceleration
Temperatures go into the start and end sequences. Print speed and acceleration become feedrates, written in millimetres per minute.
Retraction
How far filament is pulled back before a long travel and pushed out after it, which is what keeps stringing out of corners.

What is inside the G-code file

The program opens with a header describing the print it is about to run — source model, triangle and layer counts, filament, temperatures and peak flow. The body is plain millimetre G-code: G21 for units, G28 to home, absolute positioning with relative extrusion so a retraction is unambiguous, a ;LAYER: comment at every layer change, and travel moves interleaved with extruding ones.

It ends the way a print should: heaters off, motors disabled. Every figure in the header is read back out of the slice that produced the paths below it, so the file cannot describe a print different from the one it contains.

FAQ

STL to G-code conversion: common questions

G-code and STL basics

How to turn STL to G-code?

Drop your .stl file onto the viewport above. The mesh is parsed, sliced into layers, and written out as a G-code program in the same tab, so the file is ready as soon as the model appears. Check the model panel first: a closed mesh with consistent winding slices cleanly, while open or non-manifold edges leave holes in the print. Then set the layer height, infill and wall count, and take the .gcode file from the result panel.

Are STL files G-code?

No. An STL file is a 3D model — a list of triangles describing a surface, with no toolpaths, no temperatures and no layer order. G-code is the opposite: a list of machine moves such as G1 X20 Y10 E1.2, which tells the printer where to go and how much filament to push while it goes. The STL has to be sliced into layers before it can become G-code; neither file can be used in place of the other.

How do I create a G-code file?

Slice the model. A slicer intersects the mesh with a series of horizontal planes, works out the perimeters, infill and travel moves for every layer, and writes them out as G-code. On this page the whole process runs client-side: load the STL, choose a profile, and the G-code regenerates each time you change a setting. You can also write G-code by hand, but a slicer produces a finished part in seconds where hand-written code has to be paced, walled and infilled first.

Is there a free online G-code converter?

Yes — this page is one. Load an STL and it produces the .gcode file with no account, no trial, no watermark and no limit on how many files you convert, and because the slicing happens in your own browser there is no server cost to pass on. PrusaSlicer, Cura, OrcaSlicer and SuperSlicer are also free to install, and are worth having locally if you print often or work with files too large to hold in a tab.

Where can I find G-code files for my 3D printer?

Either convert your own or download someone else's. To convert, load the STL into a slicer and export the G-code — this converter does it in the browser, and names the file after the model, so cube-20mm.stl becomes cube-20mm.gcode. To download, the printer makers' own sites are the best source (Bambu Lab, Prusa, Creality and Elegoo all publish a print server), alongside Thingiverse, Printables, MakerWorld and Cults3D. Check that a downloaded file matches your firmware and build volume before printing it.

What is a G-code in 3D printing?

G-code is the language a printer speaks. Each line is one command letter followed by numbers: G28 homes the axes, G1 X20 Y10 E1.2 moves to a position while extruding 1.2 mm, M104 sets the hotend temperature. A slicer generates thousands of those lines ahead of the print, and the firmware reads them one at a time — the file is the whole instruction set for the job, and nothing else has to be decided at the machine.

Is G-code hard to learn?

To use it, no — almost nobody writes G-code by hand any more, because a slicer generates it from a model in seconds. To read it, moderately: G0 and G1 for travel and extrusion, the E axis for how much material to push, and the M-codes for heaters, fans and part ends cover nearly everything you will meet. A couple of hours with a reference sheet is enough to edit a temperature, insert a pause, or delete one troublesome section, and the header of a well-written file explains its own settings.

How to write a G-code?

Begin with the setup block: G21 for millimetres, G90 for absolute positioning, G28 to home, M140 and M104 to heat the bed and hotend, then a first layer to stick down. After that every line is a move — G1 X10 Y20 F1800 E0.4 travels in a straight line at 30 mm/s while extruding 0.4 mm — and the file ends by switching the heaters and motors off. Past a first cube, let a slicer write it: hand-written G-code still has to be sliced, walled and paced, and those are the parts that decide whether it prints.

Where can I learn G-code for free?

Start with a command reference for your firmware: Marlin and Klipper both publish full command lists that double as documentation, and Prusa's knowledge base has a G-code section written for beginners. Reprap.org and Adafruit cover the fundamentals with worked examples, and reading the first 200 lines of any file this converter writes — which are commented — makes a good real example to annotate. To watch a file execute rather than read it, OrcaSlicer's G-code preview, NoteG or NC Viewer step through it in a browser.

What is G-code filament?

Filament and G-code are two different things, which is usually what this question is about after a slicer reports both. Filament is the plastic spool — 1.75 mm is the standard, and PLA, PETG, ABS and TPU each need their own nozzle and bed temperatures, which is where the M104 and M140 lines in the G-code come from. G-code does not contain filament. It contains the E values that describe how much to push, and the total of those path lengths is the filament estimate a slicer prints.

Can a G-code be used for 3D printing?

Yes — that is exactly what it is for. A G-code file is the instruction set your printer's firmware executes, so any valid one will print: a model you sliced, a calibration cube, or a part somebody uploaded. Two things have to line up. The file must suit your printer's firmware and build volume, and one sliced for a 0.4 mm nozzle needs a 0.4 mm nozzle. The files this converter writes are standard millimetre G-code for Marlin and RepRap-style firmware, and suit Klipper too.

About this converter

Is this STL to G-code converter really free?

Yes — no account, no trial, no watermark and no limit on how many files you convert. The engine runs in your browser, which is also why it can stay free: there is no server-side slicing to pay for.

Are my STL files uploaded anywhere?

No. The file is read with the browser's own File API, parsed, sliced and written to a program in the same tab, then discarded. Nothing about your file crosses the network, and no server exists that could receive it. The one thing this site saves between visits is your light or dark theme choice, in your browser's local storage.

What file formats can it convert?

STL, in both binary and ASCII form, up to 250 MB. Extension and minimum size are checked before parsing, and anything that is not a readable mesh is reported with a specific reason.

Which printers is the G-code compatible with?

The output is standard millimetre G-code for Marlin/RepRap-style firmware: G21 units, G28 homing, absolute positioning with relative extrusion (G90 and M83), heater control at both ends, and M84 to finish. It also suits Klipper and the printers built on it.

Which file do I put on the printer?

The .gcode file, named after the STL it was cut from — cube-20mm.stl becomes cube-20mm.gcode. Download it, copy it to the clipboard, or write it to the microSD card your firmware reads at boot.

How accurate are the print time and filament estimates?

Both are summed from the moves in the finished program, so they describe the file rather than the geometry alone. Real time still depends on your machine's acceleration, and real filament use on wall adhesion.

Ready to try it? Open the converter and drop in an STL — it takes about as long as the file does to read.