G-code Viewer

Open a G-code or NC file and see its toolpath in 3D: layer by layer for a 3D print, cuts and rapids for a CNC job. Scrub or play through the moves, and read the size, filament, weight and time. The file stays on your device.

  1. 1Open a file
  2. 2Pick a layer
  3. 3Play the toolpath

3Toolpath preview

Drop a G-code or NC file here

.gcode .gco .g .nc .ngc .tap .cnc

    Your file is read by this page on your device. It is never uploaded.

    1Open a file

    Or drop a file on the preview. Plain-text G-code from any slicer or CAM program.

    2What to show

    Machine

    Colours and moves
    Filament (for the weight estimate)
    mm
    g/cm³

    Typical densities; check your filament's datasheet for the exact value.

    How to use the G-code viewer

    1. Open your file. Choose a .gcode, .gco, .nc, .ngc, .tap or .cnc file, drop it on the preview, or press Try a sample to see how it works. Large files are read in the background, so the page stays usable.
    2. Turn the model. Drag to turn it, scroll or pinch to zoom, and shift-drag (or right-drag) to pan. With the preview selected, the arrow keys turn it and + and − zoom.
    3. Pick a layer. The Layer slider shows the print up to that layer. The second slider steps through the moves inside it, one at a time.
    4. Play it. Play runs the job as a simple G-code simulator, at 10 to 1000 times real speed, starting from where you are.
    5. Check the numbers under the preview: size, layers, filament, weight and time. For a CNC file you get depth, cutting length and run time instead.

    What the colours mean

    For a 3D print the viewer colours each move by its feature type (outer wall, inner wall, infill, top surface, support, skirt and so on) when the slicer marks them with comments, as PrusaSlicer, OrcaSlicer, Bambu Studio, Cura and most others do. The colour key under the preview lists only the types found in your file. You can also colour by speed, which is handy for spotting slow bridges or a first layer that is faster than you meant.

    Travel moves (the nozzle moving without extruding) are hidden at first and shown in grey when you tick them. For a CNC file, cutting moves (G1, G2, G3) are orange and rapids (G0) are grey; colour by depth to see how deep each pass goes. The dark line is the current layer, or the position of the nozzle or tool while you scrub.

    What the numbers mean, and their limits

    • Size is the box around the printing moves (or the cutting moves for CNC), so travel to a park position doesn't count.
    • Filament is the net amount the extruder pushes, from the E values. Retractions cancel out. The weight is an estimate from that length, the filament diameter and the density you set.
    • Print time comes from the slicer when it wrote one into the file; that is usually the better figure. Our own figure is a rough estimate from the distances and feed rates alone. It ignores acceleration, so a real print usually takes longer, sometimes a lot longer for small, detailed parts.
    • Layers come from the slicer's layer markers when the file has them, otherwise from the Z height of printing moves.
    • Arcs (G2 and G3) are split into short straight lines for drawing. Home moves (G28) are not drawn, since the start point isn't known.

    Supported files and commands

    Any plain-text G-code: Marlin, Klipper, RepRapFirmware, Prusa and Bambu printers, and GRBL or LinuxCNC style CNC programs. The viewer understands G0 to G3 (I/J/K and R arcs, in all three planes), G90/G91, M82/M83, G92, G20/G21 inches, G28, G4 dwells, comments in ; and ( ), line numbers and checksums. Binary G-code (.bgcode) and zipped .gcode.3mf projects need to be exported or unzipped to plain G-code first.

    FAQ

    How do I view a G-code file?

    Open it in a G-code viewer like this one: choose the file or drop it on the preview, and the toolpath appears in 3D. You don't need a slicer or an account. Your slicer can preview its own output too, but a viewer also opens files someone else sliced.

    What is an NC file and how do I open it?

    An NC file is G-code for a CNC machine (NC stands for numerical control). It often ends in .nc, .ngc, .tap or .cnc. Open it here like any G-code file. The viewer sees there's no extrusion and shows it as a CNC program, with cuts and rapids in different colours.

    Can I simulate a 3D print from the G-code?

    Yes. Press Play to watch the nozzle path build up move by move, or drag the sliders to any layer and any point in it. It's a path simulation: it shows where the nozzle goes, not how the plastic will actually look.

    How accurate is the print time?

    If the slicer wrote its estimate into the file, the viewer shows it, and that's usually close. Our own estimate only adds up distance divided by speed and ignores acceleration, so treat it as a lower bound. For CNC files the time depends on your machine's rapid speed, which you can set.

    How can I see how much filament a print uses?

    Open the G-code and read Filament and Weight under the preview. The length comes from the extrusion in the file. The weight is an estimate, so set your filament's diameter and density. Some slicers also store their own figures, and the viewer shows those next to it.

    Why are there lines across my print?

    Those are travel moves, where the nozzle moves without printing. They're hidden until you tick Show travel moves. Lots of long travels over the part can cause stringing; turning on your slicer's avoid-crossing-walls option usually helps.

    Does this upload my G-code?

    No. The file is read by your browser on your device, in a background worker on this page. It is never sent to a server, so it works with private or unreleased designs.

    More free tools