G-code viewer guide
How to Open and View G-code Files
Substantially updated 2026-10-10. First published 2026-09-18.
A sliced G-code file is the set of instructions your printer will receive. Opening it in a viewer is a useful final check when a file came from another computer, was sliced with an unfamiliar profile or simply needs a quick visual review before printing.
Navigate the file without changing it
Begin with the overall bounding box and layer range, then use the layer slider to move from the first deposited lines through walls, infill, bridges and the final layers. Toggle travel and extrusion views when the viewer supports them. The goal on this page is orientation and navigation; use the deeper G-code checking guide to interpret temperatures, suspicious moves and process risk.
Search plain text only when you understand the command dialect. Comments, metadata and commands differ by slicer and firmware, and the same letter can be interpreted with modal state established earlier in the file. Do not edit an isolated line and assume the rest of the motion remains valid.
Handle large or unfamiliar files safely
Large G-code can take time and memory to parse. Close unrelated heavy tabs, allow the viewer to finish, and use the original slicer preview if the browser cannot load the complete file. A partial preview must not be mistaken for a complete toolpath. Keep the filename, slicer project and machine profile together so the result can be reproduced.
Treat G-code from an untrusted source as machine instructions, not a harmless 3D model. View it locally, identify the intended printer and firmware, and never send it directly to hardware merely because a preview opens. InspectMesh's browser-based viewer does not upload the selected file, but it also cannot certify that every command is safe for a particular machine.
Open for navigation, not a safety verdict
Use the viewer to move through layers and distinguish extrusion from travel. It processes supported files locally and does not execute G-code, but it cannot know the printer's firmware, physical condition or material state. For dimensions, temperatures and suspicious moves before a job, continue to the G-code preflight guide.
Use the
G-code Viewer and Preflight Checker
to open a .gcode, .gco or .gc file
locally in your browser. It reads the file only: it does not upload, execute,
send or modify it.
Open the file and inspect its parsed layers
Choose the sliced file from your device. The viewer reads common linear motion commands, groups recognised paths by layer and presents a 2D preview.
- select a G-code file from your device;
- check that the summary reports readable layers and motion;
- use the layer selector, scrubber or previous and next buttons to move through the preview;
- compare solid extrusion paths with the optional dashed travel paths;
- read the per-layer move count and the parser limitations before making a print decision.
The preview is most useful for catching an obviously unexpected shape, missing looking paths, a surprising Z range or movement that extends beyond the area you expected.
What to inspect in a G-code viewer
A viewer can provide practical file-level context without making assumptions about a particular printer. Review the information the file actually contains:
- parsed layer count and Z range;
- extrusion and travel paths on representative early, middle and final layers;
- parsed X, Y and Z motion extents;
- slicer comments, declared print time and filament details when present;
- hotend and bed targets that the parser recognises;
- coordinate modes, extrusion mode, tool markers and limitation warnings.
For a more detailed final checklist, use the guide to checking G-code before printing.
Why a browser preview differs from slicer simulation
A slicer knows the model, its configured printer profile and feature-specific decisions it made while generating the file. A browser viewer instead reads a conservative subset of the finished text file. It can accurately display the paths it recognises, but it does not run firmware or recreate the complete slicer environment.
Treat the preview as an independent inspection aid, not a replacement for the slicer's native preview. Confirm the selected printer, material, orientation, supports and start sequence in the slicer that produced the file.
Read limitations before relying on the preview
G-code dialects vary between slicers, firmware and printer workflows. Arcs, macros, conditional logic, vendor-specific commands and multi-tool workflows may be incomplete or absent from a general parser's preview. A limitation notice does not necessarily mean the file is wrong; it means the viewer cannot make a reliable claim about that part of it.
When a limitation matters to your workflow, return to the slicer's native preview and confirm the file against the intended printer and firmware.
Use G-code viewing after model preflight
G-code viewing is the final file-level stage. Before slicing, use STL Print Preflight or 3MF Print Preflight to inspect the model itself. Then check dimensions, geometry, wall thickness and overhang risk as relevant, slice with the intended printer profile, and view the resulting G-code before printing.
No browser inspection can guarantee print success. Firmware configuration, machine condition, material, calibration, bed preparation and physical environment remain part of the real print outcome.
Recognise text and failed imports
InspectMesh accepts plain UTF-8 text in .gcode, .gco or .gc files up to 25 MiB. An extension does not establish readable content. Binary G-code and vendor containers are unavailable here; renaming them does not convert them. Prusa's binary G-code documentation describes the native format and conversion workflow, reviewed 10 October 2026.
| Import result | Next action |
|---|---|
| Undecodable or binary input | Use the generating application's supported native viewer/text export |
| Malformed numeric field with a line number | Check the original export and re-export; do not guess a firmware command |
| No readable G0/G1 motion | Check for an empty, comments-only or wrong supplied file |
| Readable paths with incomplete coverage | Use the cause/fallback table before interpreting the picture |
FAQ
Can I open a G-code file without sending it to a printer?
Yes. A browser-based G-code viewer can read a file locally and show the subset of movement and metadata it recognises without uploading, running or changing the file.
Is a parsed G-code preview the same as slicer simulation?
No. A parsed preview shows recognised commands and paths. A slicer simulation can include printer profiles, feature types, custom scripts and firmware-specific behaviour that a general browser viewer cannot reproduce.
Can a G-code viewer guarantee a successful print?
No. Printer firmware, calibration, material, machine condition, start G-code and slicer settings all affect the real print.