# G-code Viewer

Drop or paste a G-code file to see the toolpath layer by layer from above, and check the size, filament use and an estimated print time on the spot. It reads 3D printer output and CNC NC files, and the file never leaves your device.

- URL: https://tools.itlibra.com/en/gcode-viewer
- On-device・No upload
- Last updated: 2026-10-31

## How to use

1. Drop a G-code file here or click “Choose files”. You can also paste the text and click “Analyze”.
2. After the analysis, the toolpath appears as seen from above. Pick a layer with the “Layer to show” slider: the current layer is drawn in a strong colour and the layers below in a light one.
3. Drag to pan, and scroll or pinch to zoom. You can show only the current layer, and switch the travel moves (no extrusion) on and off.
4. Check the X Y Z range, the number and height of layers, the distances, the filament length and weight estimate, the time estimate and the commands used in the summary below.
5. Use “Copy summary” or “Save summary” for the numbers, and “Save the view as PNG” for the current picture.

## Use cases

- Check the toolpath and the size of a G-code file before you start a print
- Get a print time estimate and the filament use of G-code you received, without a slicer
- Look at the path layer by layer to find supports and gaps
- Check the cutting path of a CNC NC file from above

## What it does

### Toolpath by layer, from above

Draw up to any layer with the slider, with extrusion and travel in different colours. Zoom and pan are supported, and arcs (G2, G3) are drawn as curves.

### Size, layers and extrusion

Get the X Y Z range of the extruded path, the number and height of layers, the distances and the filament length. A volume and a weight estimate come from a 1.75 mm or 2.85 mm diameter and the density of PLA, PETG, ABS or TPU.

### Time estimate

The distance of each move is divided by its feed rate F and summed. Acceleration is ignored, so a real print usually takes longer.

### Commands used

Lists each command with its count, and separates the commands used for the path and time from those that are skipped. Slicer comments such as ;TIME: are shown as they are.


## Supported formats

### Input

- .gcode, .gco, .g
- .nc, .ngc, .tap, .cnc
- .txt (G-code text)
- Pasted text

### Output

- Summary text (copy or .txt)
- Toolpath picture (PNG)


## Capability matrix

| Feature | Support | Notes |
| --- | --- | --- |
| G0 and G1 linear moves, G90 and G91, G20 and G21, G92, G28 | Supported | — |
| Arcs (G2, G3) with I J and with R | Supported | XY plane (G17) only. Arcs in G18 or G19, and arcs with an invalid centre or radius, are drawn as straight lines |
| Absolute and relative extrusion (M82, M83) | Supported | — |
| Layer-by-layer view, zoom and pan | Supported | — |
| Distances, extrusion and filament length | Supported | — |
| Volume and weight estimate | Partial | An estimate from the chosen diameter and material density. It treats the filament as solid and does not reflect the real density or fill |
| Print time estimate | Partial | A rough distance-over-feed-rate figure. Acceleration, jerk, speed limits and heating waits are not included, so a real print usually takes longer |
| 3D view (from the side or at an angle) | Not supported | Top view only. Use the 3D Model Viewer to look at a model in 3D |
| Commands for temperature, fans, retraction settings and so on | Partial | They are counted but not used for the path, distance or time |
| Tool radius compensation, canned cycles and subprograms (G41, G81, O words and other CNC functions) | Not supported | They are skipped and only counted |
| Binary G-code (.bgcode) | Not supported | Export it again as ASCII G-code |
| Editing, saving or converting G-code | Not supported | View and measure only |
| Machine differences (firmware-specific commands and unit handling) | Partial | It follows the common reading of RepRap and Marlin G-code. E values are not converted to inches under G20 |

## Limits & notes

- Up to 100 MB and 2 million lines per file. Pasting is limited to 5 million characters.
- Up to 3 million points are drawn. Later points are not drawn, but the numbers cover the whole file.
- Up to 10,000 layers. Later ones are merged into the last layer (for example a spiral toolpath).
- The start position is taken as (0, 0, 0). G28 returns the named axes (all axes when none are named) to 0.
- Analysis runs in a Worker and can be canceled. It works on smartphones, but a PC is recommended for large files.

## Privacy & safety

Loading, analysis and drawing all run in your browser. The G-code and its file name are never sent to a server.

## FAQ

### Can I check G-code without installing anything?

Yes. Drop or paste the file and the toolpath appears layer by layer from above. The file never leaves your device.

### How accurate is the print time estimate?

It is the distance of each move divided by its feed rate F, without acceleration, speed limits or heating waits, so a real print usually takes longer. If the slicer wrote a comment such as ;TIME:, it is shown in the summary as it is.

### How is the filament weight calculated?

The length is the sum of E over the moves that extrude. It is turned into the volume of a cylinder of the chosen diameter (1.75 or 2.85 mm) and multiplied by a density (PLA 1.24, PETG 1.27, ABS 1.04, TPU 1.21 g/cm³). Retractions are not counted.

### Can it open CNC NC files?

For a file with no extrusion (E), G1 feed moves are drawn as the cutting path, and G0 rapid moves can be shown if you need them. Tool radius compensation and canned cycles are skipped.

### Which tool do I use to look at a 3D model such as STL or GLB?

Open STL, GLB and OBJ models in the 3D Model Viewer. This tool is for the path in G-code that a slicer has already written.

### Can it open .bgcode?

No. Binary G-code cannot be opened. Turn binary G-code off in the slicer settings and export ASCII G-code instead.
