Free · runs in your browser · nothing is uploaded

STL to GCode: Free Online Slicer

Drop an STL, pick your printer and filament, and press Slice. You get a .gcode file with walls, solid top and bottom layers, infill and a skirt, plus a layer-by-layer preview and a rough time and filament estimate. It runs in your browser, so the model is never uploaded. It does not generate supports.

Loading the STL slicer...

How to convert an STL to GCode

  1. 1

    Load your STL

    Drop a binary or ASCII STL, or press the sample button to slice a built-in 20 mm cube with a hole. The model is placed in the middle of the bed and dropped onto it.

  2. 2

    Check size and printer

    Pick a printer preset or enter your own bed size, then check the size in millimetres. Use scale or target height if the part is too big or too small.

  3. 3

    Choose the settings

    Set layer height, walls, infill and the filament. The advanced section holds speeds, retraction, fan, the skirt and the start and end G-code.

  4. 4

    Slice and download

    Press Slice, scrub through the layers to check the paths, then download the .gcode. Open it on your printer only after you have checked the start G-code and temperatures.

Default settings at a glance

These are the values the slicer starts with for a 0.4 mm nozzle and 1.75 mm filament. Every one of them can be changed before you slice.

Layer height0.20 mm, with a 0.20 mm first layer (choose 0.10 to 0.32 mm).
Walls and skin2 walls, 4 solid top layers and 3 solid bottom layers.
Infill15% rectilinear, alternating at +45 and -45 degrees on each layer.
TemperaturesPLA at 200 C nozzle and 60 C bed; PETG at 235 C and 80 C. Both are editable.
Speeds50 mm/s printing, 20 mm/s first layer, 150 mm/s travel.
Retraction5 mm at 40 mm/s for the Marlin presets, 0.8 mm at 35 mm/s for the Klipper preset.
Skirt and fanA two-loop skirt; the part-cooling fan is off on the first layer.
SupportsNone. The slicer warns when a lot of the surface overhangs.

What slicing an STL actually does

An STL is only a skin made of triangles. A printer cannot read it, because it needs a list of moves: go here, extrude this much, go there. Slicing cuts the skin into thin horizontal layers, finds the outline of the part on each layer, and then plans how to fill it: outer walls first, then inner walls, then infill inside and solid skin on the top and bottom.

This page does that with a planar slicer that runs in a background thread of your browser. For every layer it intersects the triangles with a plane, joins the cut lines into closed loops, shrinks the loops to make the walls, and lays down infill lines. Each move gets an extrusion length worked out from the line width, the layer height and your filament diameter. The result is plain G-code that Marlin and Klipper printers understand.

What this slicer does not do

It makes no supports. If your model has a steep overhang or a bridge, the plastic will hang in the air and may sag or fail, so turn the part until the overhangs are small, or pick a model that prints without them. The tool measures how much of the surface leans out past 60 degrees and tells you before you slice. There are also no tree supports, no multi-material or multi-colour prints, no variable layer height and no gap fill: it is a single-nozzle, flat-layer slicer for ordinary parts.

Very thin features, narrower than one extrusion line, are dropped and listed as a warning. Large, dense meshes work but take longer, and the tool stops at 1.5 million triangles; shrink heavy files first with the STL size reducer, and fix holes in the mesh with the STL repair tool if the slicer reports open edges.

First-print checklist

Before you press print on a new file: open the G-code in a viewer or look through the layer slider, and confirm the part sits where you expect on the bed. Read the start G-code in the advanced section; if your printer needs its own macro, home or bed-levelling command, put it there. Check the nozzle and bed temperatures against what your filament maker recommends.

Then print it and stay beside the machine for the first layer. A first layer that is too high lifts at the corners; too low and the nozzle drags. If it is off, adjust the Z offset and print again. Leave the first print small, such as the sample cube, so a mistake costs little filament and time.

No model to print yet?

Make a printable 3D model from a photo or a short text prompt with AI, or turn a picture straight into an STL, then bring it back here and slice it for your printer.

More free G-code and 3D printing tools

STL to GCode questions

Drop the STL on the tool above, choose your printer, layer height, walls and infill, and press Slice. When the layer preview looks right, download the .gcode file and copy it to your printer or its card. The model stays in your browser the whole time.
No. This slicer prints flat layers with walls, infill, solid top and bottom layers and a skirt, but no supports of any kind. If the model has steep overhangs, rotate it, split it, or add supports in a model editor before loading it here.
It uses standard G0 and G1 moves, M104 and M109 for the nozzle, M140 and M190 for the bed, and absolute positioning, which most Marlin and Klipper machines accept. Machines with their own start macro, a probe or a toolchanger may need the start G-code edited, which you can do in the advanced section.
It is a rough estimate. The tool adds up the length of every move at its speed and adds ten percent, but it knows nothing about your printer's acceleration limits, so real prints can run longer. Use it to compare settings, not to schedule your evening.
The model must fit inside the bed size you set, and the file can have up to 1.5 million triangles. STL files up to 100 MB can be opened. If a part is bigger than your bed, use the scale or target height field, or cut it into pieces first.
A feature thinner than one extrusion line, about 0.44 mm for a 0.4 mm nozzle, cannot be printed as a wall, so the slicer leaves it out and lists a warning. Thicken the feature in your model, or switch to a smaller nozzle in the advanced section.
No. The STL is read and sliced on your device in a background thread. The G-code is built in memory and saved straight to your downloads, so nothing is sent to a server or to a printer.
Yes. Open the downloaded file in the G-code editor to change temperatures or insert a pause, and use the G-code viewer to look at it layer by layer.

Check the start G-code and temperatures for your printer before printing, and watch the first layer. This slicer only writes a file: it never sends anything to a printer. Print time is an estimate. Marlin and Klipper are named only to describe the G-code dialects; 3D AI is not affiliated with their projects.