1. Home
  2. Calculators
  3. G-Code Viewer

G-Code Viewer

For checking a sliced file before printing: see each layer, how much filament it uses and how long the print should take.

Free, no sign-up. Runs in your browser: nothing is uploaded.

Free workspace included. Docs, spreadsheets, notes and tasks that save on your device. No sign-up.Take a look

How to use G-Code Viewer

  1. Drop a .gcode file, or press Sample.
  2. Move the layer slider to see each layer.
  3. Read the time, filament and size in the summary.

Features

  • Step through every layer with a slider
  • Print time estimate with optional acceleration
  • Filament length and weight for your material
  • Layer height, print size, retractions and speed
  • Reads Cura, PrusaSlicer, Bambu and OrcaSlicer output

Supported formats

Input

  • G-code from a slicer (.gcode, .gco, .g)

You get

  • Layer preview
  • Time and filament summary

Private by design

Everything you enter is processed by your browser on this device. Nothing is sent to openWorkstand or anyone else, so the G-Code Viewer is safe for private and work data. After you have used it once while online, it also works without an internet connection. How local processing works

Good to know

  • The time is an estimate and is usually lower than the printer’s own figure.
  • It draws a top view of each layer, not a 3D preview, and arcs are drawn as short straight segments.

Guide

Reading a G-code file: layers, print time, filament use and what the estimate leaves out

A slicer turns a 3D model into G-code, the list of moves a printer follows. The file is plain text and tens of thousands of lines long, so nobody reads it directly, but there are good reasons to look inside before printing: to see whether the first layer is where you expect, how much filament it will use, and how long it should take. This viewer opens a G-code file in your browser and draws it layer by layer.

How G-code describes a print

Each line is a command followed by letters and numbers. G1 X10 Y20 E0.5 F1800 moves the head to X = 10 and Y = 20 while pushing 0.5 mm of filament, at a feed rate of 1,800 mm/min, which is 30 mm/s. G0 is a rapid move, G2 and G3 are clockwise and counter-clockwise arcs, G90 and G91 choose absolute or relative positioning, M82 and M83 do the same for the extruder, and G92 E0 sets the extruder position back to zero. Text after a semicolon is a comment, and slicers use it for the layer number and often the estimated time.

Finding the layers

The viewer follows the head through every move, keeping track of the mode and resets. A move counts as printing when the extruder advances while the head moves in X or Y. A new layer begins when the head is already at a higher Z and starts extruding, so travel moves with a Z lift do not make false layers. The layer height is the average gap between layers after the first, because the first layer is often thicker.

The layer preview

The slider moves through the layers. The selected layer is drawn in blue, with the three below it faded if you tick that box, and travel moves can be shown as dashed orange lines. For each layer the page lists the length of extrusion, the time and the number of moves. Arcs are broken into segments of about half a millimetre.

Time and filament

For every move the length divided by the feed rate gives its time. With acceleration set above zero, each move is treated as a trapezoid that speeds up, cruises and slows down, which makes short moves slower. Filament is the sum of the positive E values, converted to weight with the density of the material and the filament diameter you choose. If the slicer wrote its own time estimate in a comment, the page shows it next to the computed one.

A worked example

The sample is a hollow square tower, 20 mm wide, printed in six layers of 0.2 mm with an outer loop and an inner loop on each layer. The part is 20 × 20 × 1.2 mm. Each layer extrudes 80 mm on the outside and 48 mm on the inside, 128 mm in all, so the six layers extrude 768 mm of path. With a 0.4 mm line and a 0.2 mm layer that needs about 25.5 mm of 1.75 mm filament, which is roughly 0.076 g of PLA, and the whole file takes about 27 seconds at the speeds written in it. Each layer has one retraction, so there are six.

Limits

The viewer is a quick inspector, not a simulator. It shows a top view of one layer at a time and no 3D preview, it does not model temperature, fans or firmware features such as pressure advance, and it ignores macros that expand inside the printer. Files for CNC mills and lasers have no extruder values and give an error. Very large files of more than 120 MB are refused.

Checked against the current version of the G-Code Viewer on .

Frequently asked questions

Why is the estimated time shorter than what the printer says?

The viewer adds up distances divided by speeds, with a simple acceleration model if you set one. A real printer also heats the nozzle and bed, runs a levelling routine, slows down for small features and corners, honours minimum layer times and pauses for retraction. Raising the acceleration setting to the printer's real value narrows the gap, but the printer's number stays the better prediction.

Why does my vase-mode print show as one layer?

In spiral vase mode the nozzle rises continuously while it extrudes, so there are no separate steps in Z for the viewer to split on. The whole print appears as a single layer. The totals for time, filament and size are still correct. For a normal print with one Z move per layer you get the usual layer count.

Why is the estimate different from my printer’s time?

This tool adds up move lengths and feed rates. The printer also heats, levels the bed and slows for corners, so its number is normally longer. The acceleration setting gets the estimate closer.

Can it show a 3D view?

It shows a top view of each layer and the three layers below it. For a full 3D preview use your slicer.

Keep working with the result

openWorkstand also includes a free workspace with documents, spreadsheets, tasks, projects and a calendar that save to a folder on your computer.