G-code/G-code stats

G-code analyzer with 2D and 3D preview (local)

Inspect a G-code file locally without uploading it. The Worker streams the file, tracks modal units, absolute/relative moves and extrusion, counts layers, separates travel from extrusion path, reads common slicer time and filament comments, and provides 2D and progressively streamed 3D toolpath previews.

ReadyNo uploadWorkerG-code

G-code report

No upload

G-code report

Streaming statistics; feedrate time is a lower bound. Toolpath bounds include travel, and arc bounds use endpoints. Preview layers in your slicer before printing.

Drop a G-code file

G-code (.gcode, .gco, .g). The Worker streams the file and reads motion, layers, filament and slicer comments.

.gcode · .gco · .g

Drop a G-code file

G-code (.gcode, .gco, .g). The Worker streams the file and reads motion, layers, filament and slicer comments.

Choose a file

Max file size: 500 MB · No upload

No upload · File.slice() → Worker → G-code statistics.

How it works

  1. 1

    Drop a .gcode, .gco or .g file.

  2. 2

    The Worker streams the file in 4 MiB chunks and parses G0/G1/G2/G3, G20/G21, G90/G91, G92, M82/M83 and M200.

  3. 3

    It tracks layer changes on Z, travel and extrusion distances, feedrate time, and slicer comments for time and filament.

  4. 4

    Read layer count, toolpath bounds, travel/extrusion lengths, filament use and the best available time report.

  5. 5

    Use the layer slider for a 2D top view, or switch to 3D for an orbitable all-layer extrusion preview. The 3D preview streams extrusion batches while the file is parsed; the quality selector keeps every layer or samples every 2nd, 4th, or 8th layer for large files.

What the numbers mean

Layers

Layers are counted when an extrusion move first appears at a new Z. A slicer's LAYER_COUNT comment is also read and reported as a hint; vase mode or non-planar paths can make the counts differ. The 2D preview shows extrusion segments for the selected layer and travel in gray; the 3D preview draws layers at their Z heights as batches arrive and can sample every 2nd, 4th, or 8th layer.

Path

Travel and extrusion are separated by whether a move has a positive E delta. Arc moves use I/J or R geometry for length, but their bounds use endpoints only; acceleration and firmware limits are not simulated.

Filament

Filament length is summed from positive E deltas. M200 volumetric extrusion is converted using a 1.75 mm filament area and flagged. Slicer Filament used comments are shown separately.

Time

Slicer-reported time is preferred when the file contains a TIME or estimated-time comment. Otherwise the feedrate-only time is a lower bound because acceleration, cooling, retractions and firmware limits are missing.

Limits

The 2D and 3D previews are navigation aids, not slicer validation. They do not verify temperatures, detect support errors, or reproduce the slicer's time; arcs are chords; the 3D preview is capped at 500,000 segments, can sample layers to reduce its segment count, and renders streamed batches before the parse finishes.

streaming

The Worker emits 3D extrusion segments in bounded Float32Array batches while it parses, and each batch is transferred to the main thread. The preview appends the batches without rebuilding the full scene, so large files become visible before the file read completes. The segment cap and layer-step sampling are applied before a batch is emitted.

Printing notes

  • Compare the reported layer count and filament length with the slicer preview before starting a long print.
  • If the file has slicer time comments, trust them over the feedrate-only number; acceleration dominates short segments.
  • A very large travel length can indicate a purge line, poor arrangement, or unnecessary tool changes.
  • Use the bounds to check that the toolpath stays inside the intended build volume before transferring the file.

Questions

References

  • · ISO/ASTM 52900
  • · G-code motion modes and slicer metadata comments