FLXCode G-code Viewer

FLXCode apps

Appearance

G-code Viewer

Open a G-code file, step through its layers, and read the filament, size and print time. The file is not uploaded.

or drop it here, or paste it with Ctrl+V

.gcode, .gco and .g files up to 400 MB or 6 million moves. The file never leaves this device.

No ads. No account. Nothing you type or record is uploaded. We count page events with a daily code. Check it. What this tool keeps and sends.

Problem or idea? Email us

How to use it

  1. Open a .gcode, .gco or .g file, drop it on the page, or press Try a sample G-code.
  2. Drag the layer slider, or press the up and down arrow keys while the picture has focus. Home and End jump to the first and last layer.
  3. Choose Up to this layer to see the part grow, or This layer only to check one layer. Press Play layer to watch the nozzle path.
  4. Untick a feature in the list to hide it, for example infill, to see the walls. Tick Travel moves to see where the nozzle moves without printing.

What it reads

Moves with G0 and G1, arcs with G2 and G3 (centre given with I and J, or the radius with R), absolute and relative positions (G90, G91), absolute and relative extrusion (M82, M83), a reset of the extruder position (G92 E0), inches or millimetres (G20, G21) and the home command (G28). Arcs are cut into short lines that stay within 0.02 mm of the true curve. The commands are described in the RepRap G-code wiki and the Marlin G-code index.

A layer is a run of printing moves at one height. When the slicer marks layers with comments (;LAYER: in Cura, ;LAYER_CHANGE in PrusaSlicer and OrcaSlicer) those are used. Without them a new layer starts when a printing move changes the height by more than 0.005 mm. Lifting the nozzle for a travel move stays in its layer.

How the numbers are worked out

Filament length is the sum of the extruder moves that push filament forward. A pull back for a retraction is remembered, and the push that undoes it is not counted. Weight is the length times the area of the filament cross section times the density: 1.24 g/cm3 for PLA, 1.27 for PETG and 1.04 for ABS.

Example from the sample file, a 20 mm cube printed with 0.2 mm layers: 100 layers, 1,540 mm of filament, which is 4.6 g of PLA on 1.75 mm filament. The time from feed rates is 18m 2s.

The time is length divided by feed rate for each move, plus waits (G4). It has no acceleration, so a real print takes longer, often by a third or more on small detailed parts. If the file holds the slicer's own estimate (;TIME: in Cura, a line with estimated printing time in PrusaSlicer and OrcaSlicer) the page shows both.

Limits

  • Plain text G-code up to 400 MB and 6 million moves. Binary .bgcode is not read.
  • Colours by feature need the slicer comments. Colours by speed and layer work for any file.
  • Arcs are read in the XY plane. Helical Z in an arc is followed.
  • Firmware retraction (G10, G11) is counted but not drawn. Tool changes, several extruders and non-planar printing are not separated.
  • Lines are one pixel wide, so a zoomed-out view of a huge print looks thin. Zoom in to see the paths.
  • This is a viewer. It does not edit, slice or check a file for errors a printer would reject.

How it works and privacy

A background script in this tab reads the file in pieces, turns every move into a line, and sends the lines to your graphics card. Showing a layer range is one draw call, so a file with a million moves stays smooth to turn and scrub. The camera and grid are the same code as the STL viewer.

Nothing you open is uploaded or stored. We count events without cookies, such as "file opened" (details). To estimate a part from its volume use the volume calculator, and to add up several print times use the time duration calculator.

FAQ

How do I open a G-code file online?

Press Open a G-code file, or drop the file on this page. It is read in the background and drawn at once. Use the layer slider to step through the print, or press Play layer to watch the toolpath of one layer.

How big a file can it open?

Up to 400 MB and 6 million moves. The file is read in pieces, so a 100 MB file does not need 100 MB of text in memory, and the page keeps working while it loads.

Why are there no colours for my file?

Colours by feature come from comment lines that the slicer writes, such as ;TYPE:WALL-OUTER. Cura, PrusaSlicer and OrcaSlicer write them. If your slicer does not, or the option is off, colour by speed or by layer instead.

Why is the print time so low?

The page adds up length divided by feed rate for every move. A printer also slows down for corners and speeds up with acceleration, so it takes longer. When the slicer wrote its own estimate into the file, the page shows it next to this number. Use the slicer number for planning.

How is the filament length worked out?

It is the sum of the E values that push filament forward. Pulling filament back for a retraction and pushing it forward again is not counted, because that filament is not used up. The weight is the length times the cross section of the filament times the density of the material.

Does it open .bgcode files?

No. Binary G-code from newer Prusa printers is a different format. Export plain G-code from the slicer to view it here.

More from FLXCode

  • STL ViewerOpen an STL or OBJ file, turn it around, and see its size, volume and filament weight. The file stays on your device.
  • Time Difference CalculatorFind the time between two times or between two dates with times, in days, hours, minutes and seconds, and decimal hours.
  • Volume CalculatorVolume of a cube, box, cylinder, cone, sphere, hemisphere, pyramid, capsule or tube, with liters and gallons.
  • Area CalculatorArea of a rectangle, triangle, circle, trapezoid, parallelogram, ellipse, sector or polygon, with the formula.

Share G-code Viewer