FileKiln

STL to G-code Converter (Slicer)

Slice an STL into printable G-code with the real CuraEngine compiled to WebAssembly, running in your browser. Pick your printer, get layers, time, and filament estimates.

Ready when you arestl → gcode

Runs on your computer. Nothing gets uploaded.

Your stuff stays yours. Your file is opened with JavaScript inside this page. It is never transmitted, and the tool keeps working with the network unplugged.

This is not a G-code "estimator" - it is CuraEngine, the slicing engine inside Ultimaker Cura, compiled to WebAssembly and running in your browser tab. Pick your printer model and a layer height, drop a binary STL, and it produces real, complete G-code with layer count, estimated print time, and filament usage, using that printer's stock Cura profile. Your model never leaves your machine. One serious caution: G-code drives physical hardware. These are stock profiles, not your tuned settings - review the preview, check the first layers, and confirm temperatures and bed size match your machine before you print. If you have a calibrated profile in desktop Cura, prefer it for production prints; this tool is for quick slicing, estimates, and machines that match stock configs.

How to slice a model

  1. Pick your machine in the printer menu. It starts on Ultimaker 2, so change it first if you own something else.
  2. Pick a layer height: 0.1 mm (fine), 0.2 mm (standard), or 0.3 mm (draft).
  3. Click Choose a .stl file (binary STL) or drag the file onto that box. Both menus are read at this moment, so set them before you choose the file.
  4. Read the summary line and review the first 120 lines of G-code in the text box.
  5. Press Download G-code to save the complete file, named after your STL.

What slicing does and what G-code contains

An STL file is only a surface made of triangles, with no units and no instructions. A slicer cuts it into horizontal layers, traces each layer's outline into walls, fills top and bottom surfaces, adds sparse infill, and writes the resulting paths as G-code, a plain-text list of machine commands.

A few commands make up most of any file:

  • G28 homes the axes. G0 is a travel move and G1 a printing move, with X, Y, and Z positions in millimeters, F for speed in mm per minute, and E for how much filament to push.
  • M140 and M104 set bed and nozzle temperatures, and M190 and M109 set them and wait until they are reached.
  • Lines starting with ; are comments, such as ;LAYER:0.

The printer choice also sets the G-code flavor. Creality, Prusa i3, and Anycubic profiles write Marlin-style files with temperature commands in them. Ultimaker 2 uses UltiGCode, where the printer supplies temperatures from its own material settings, so those commands are left out. The layer height menu changes only the regular layers. The first layer keeps the profile's own initial layer height, which was 0.3 mm in our tests.

A worked example

We sliced a plain 20 mm cube (a 12-triangle binary STL) for Creality Ender 3 at 0.2 mm (standard). The summary read:

99 layers · est. 0h 25m print · ~4.80 m filament · review the preview before printing.

That is one 0.3 mm first layer plus 98 layers of 0.2 mm. The start of the file shows the Marlin flavor, heating, and the Ender 3 purge line:

;FLAVOR:Marlin
...
M140 S60
M105
M190 S60
M104 S215
M105
M109 S215
M82 ;absolute extrusion mode
; Ender 3 Custom Start G-code
G92 E0 ; Reset Extruder
G28 ; Home all axes

The model is not re-centered. The engine adds the bed center (117.5, 117.5 on this 235 mm bed) to the STL's own coordinates, so this cube, modeled from 0 to 20 mm, prints from X 117.5 to 137.5. The same cube for Ultimaker 2 at 0.1 mm (fine) gave 198 layers · est. 0h 44m print · ~4.55 m filament. There were twice as many layers but less filament length, because that profile uses 2.85 mm filament, which holds about 2.65 times as much plastic per meter as 1.75 mm.

Common problems and fixes

The printer never heats up

You probably sliced with the default Ultimaker 2 profile for a Marlin printer. UltiGCode contains no M104 or M109, and Marlin firmware refuses to extrude with a cold nozzle. Select your printer, then choose or drop the file again.

Changing a menu did not change the output

The settings are read when a file arrives, and choosing the same file again in the file dialog does not trigger a new slice. Drag the STL onto the box again, or reload the page.

The model prints off the bed, or far too small

Because the STL's coordinates are only shifted by the bed center, a part modeled far from the origin in your CAD tool lands far from the middle of the bed. In our test, a cube placed at X 300 mm produced moves near X 440 on the 235 mm Ender 3 profile, with no warning. STL also has no units, so a model exported in inches comes out 25.4 times too small. Export in millimeters with the part centered on the origin, and check its size against the profile's bed (Ender 3: 235 × 235 × 250 mm; CR-10: 300 × 300 × 400; Prusa i3: 200 × 200 × 200; Ultimaker 2: 223 × 223 × 205).

Overhangs sag or print in mid-air

No supports are generated. Reorient the part to reduce overhangs, or slice it in desktop Cura with supports turned on.

The file header shows odd numbers

Header comments such as ;TIME:6666, ;Filament used: 0m, and ;MINX:2.14748e+06 are placeholders the engine never fills in, so printers that read the header show wrong values. Trust the summary line on this page instead.

An error appears before any slicing progress

If every STL fails the same way with one printer choice, the profile failed to load, not your model. In our tests Anet A8 failed with Unsupported data type (the ASCII STL hint after it does not apply) and Generic FDM printer with FS error, even with a valid binary STL.

Questions this tool gets asked

Is this a real slicer or an approximation?

Real. The WebAssembly build wraps the actual CuraEngine C++ code, so paths, supports-free perimeters, infill, and estimates come from the same algorithms desktop Cura uses with the selected printer's stock definition.

How is this different from other online STL to G-code converters?

Most online converters are cloud slicers: your model goes to their server, gets sliced there, and the G-code comes back. Here the slicer itself comes to you, compiled to WebAssembly, so nothing travels the other way.

Is it safe to print the output directly?

Treat it like G-code from any slicer with default settings: review before printing. The profile sets temperatures, speeds, and bed size for the stock printer model - if your machine is modified, has a different nozzle, or runs custom firmware, check those values in the preview first. You are responsible for what your printer executes.

Why does my STL fail with an unsupported-format error?

The loader wants binary STL, which is what nearly every CAD tool exports by default. If you have an ASCII STL (it starts with the word 'solid' and is human-readable), re-export it as binary.

Which settings can I change?

Printer model and layer height here; everything else follows the printer's stock Cura profile. This is deliberate - a wall of half-understood sliders is how bad prints happen. For deep tuning, desktop Cura remains the right tool.

Is my model uploaded to a server?

No. The engine, the printer definitions, and your STL all live in this browser tab. After the ~5 MB engine loads once, slicing works offline.

Related tools