Skip to content
3DToolBench

G-code viewer

Open a G-code file and see exactly what your printer is going to do: every layer, in the order it prints, with walls, infill and supports in their own colours. Print time, filament and size are worked out from the moves themselves. The file is read by your browser and never leaves your computer.

The G-code is read by your own browser, in a background thread. It is never uploaded, and nothing is fetched once the page has loaded.

What to look for before you print

Drag the layer slider from the bottom to the top and watch the print build. It takes a minute and it catches most of the failures that would otherwise show up hours into a print.

Start with the first layer. Switch on "This layer only" and check that it covers the whole footprint of the part, with a skirt or brim around it if you asked for one. A first layer with gaps in it is the commonest reason a print comes loose.

Then look for anything printed in mid-air: a layer that starts with nothing under it. That is an overhang with no support, and it will droop or fail. Supports are drawn in green, so you can see whether the slicer put them where you expected — and nowhere you did not want them.

Finally switch on travel moves, drawn as thin blue lines. Travel that crosses a large gap in the part leaves strings; a lot of it on a single layer is worth fixing in the slicer with a different seam position or combing setting.

Reading the colours

Every current slicer labels what each line is part of, and the viewer uses those labels. The outer wall is orange, because it is the surface you will see. Inner walls are amber, infill is red, and top, bottom and other solid layers are violet. Supports are green, the skirt and brim are teal, and a prime tower is grey.

Each colour has a box beside it. Untick infill and the walls stand alone; untick supports and you see the part as it will be once they are removed.

Layers below the one you are on are drawn darker, and the current layer is drawn brighter, so the print reads as a solid object and the layer you are looking at stands out. A file with no labels — some older slicers and most hand-written G-code — is drawn in one colour.

How the print time is worked out

Adding up each move’s length divided by its speed gives a time that is far too short, because a printer spends most of a short move speeding up and slowing down. So every move is run through the same kind of planner a printer’s firmware uses, with the acceleration and speed limits the file itself sets, and timed as the move really runs.

Where the slicer wrote its own estimate into the file, it is shown beside ours. Trust the slicer’s number first: it simulated the firmware it was set up for. Ours is there for the files that state no estimate, and as a check — the two normally agree within about ten per cent.

Neither figure includes heating the bed and the nozzle, which adds a few minutes at the start, or any pause for a filament change.

Filament and weight

The filament figure is the length that actually went through the nozzle: every retraction is taken back off when the filament is pushed forward again. The weight uses the filament density the slicer wrote into the file, and assumes PLA when it wrote none.

To turn that into money — plastic, electricity, printer wear and failed prints — press "Work out what this print costs" and the same file opens in the cost calculator.

Files it opens

G-code from Cura, PrusaSlicer, OrcaSlicer, SuperSlicer, Bambu Studio, ideaMaker, Simplify3D and Creality Print, with the extensions .gcode, .gco and .g. It follows every setting that changes what a number means: absolute and relative extrusion, relative moves, a shifted origin, inches, and arcs, which PrusaSlicer, OrcaSlicer and Bambu Studio all write.

Bambu Studio and OrcaSlicer save a sliced plate as .gcode.3mf, which is a ZIP with the G-code inside. Drop that file in directly and the G-code is read out of it.

Binary G-code (.bgcode), which PrusaSlicer writes for the MK4, the MINI and the XL, cannot be opened yet. PrusaSlicer writes plain G-code for the same printers if you untick "Supports binary G-code" in Printer Settings.

Large files

The file is read in a background thread, so the page stays responsive while a fifty-megabyte print loads. Once it is open, every line is on the graphics card and the layer slider only changes how much of it is drawn, which is why dragging it is as smooth on a large print as on a small one.

The next question

Questions

Is my G-code file uploaded?
No. It is read by your own browser, on your own computer. Nothing is sent to a server, and the page works without an internet connection once it has loaded.
Can this viewer turn my STL into G-code?
No. G-code has to be made for your specific printer, and that needs a slicer on your computer. The STL to G-code guide explains which slicer to use and how to set it up.
Why is the print time different from my slicer’s?
The slicer simulates the exact firmware it was set up for, and we work it out from the moves in the file. When the file includes the slicer’s estimate, both are shown, and the slicer’s is the one to plan around.
Can I get an STL out of the G-code?
Yes. Press "Turn it into an STL" and the same file opens in the G-code to STL converter, which rebuilds the print as a solid. It is an approximation of the print, not the model it was sliced from.
Does it work with CNC G-code?
It draws the moves, arcs included, but it is built for 3D printers. Without extrusion in the file, every move is treated as travel, so a milling program shows only thin blue lines.

Convert it while you are here

Where to go next