Guide to using OpenCAD · Sean Kim

Free NC/G-code Viewer: Inspect Toolpaths and Units

After opening an NC file, check its dialect, units and parser warnings alongside the displayed toolpath. Play the synthetic sample first to learn how code lines correspond to tool motion.

Open free NC/G-code viewerPreview using an example
A screen showing the contour, pocket, drill path, code lines, and playback bar of the composite G-code in the OpenCAD NC viewer.
The public synthetic G-code opened in the viewer.

Supported formats and sample checks

Supported formats at a glance
G-code.nc / .gcode / .ngc
HeidenhainPlain text / DIN–ISO
Panel machiningwoodWOP MPR / WangShi PGI / KDT XML
What to check in the sample
UnitG21 · mm
CoordinatesG90 · XYZ
Troubleshooting sequence
Sample walkthroughOpen the sample toolpath, compare code lines with motion, then inspect playback, units and parser warnings.
Before machiningA displayed toolpath does not validate collisions, tool compensation or machine behavior. Check against the actual machine separately.

All features and supported formats

Check the file format and its specific variant (dialect)

The viewer reads G-code, Heidenhain Klartext (.h) and DIN/ISO (.i), woodWOP MPR (.mpr), WangShi PGI (.pgi) and KDT XML (.xml) and draws their paths. G-code support targets the ISO, Fanuc, Haas, Siemens, LinuxCNC, GRBL and Mach3 families, but not every machine-specific command or macro is interpreted with the same meaning.

PGI and XML are programs for panel machining equipment such as KDT. As with MPR, the viewer draws the panel size and variables, holes on every face, saw grooves, pockets and routing paths on the panel. A .xml file opens only when it is in the KDT panel machining format. Any other XML is reported instead of opened, and for woodWOP MPRX the viewer asks you to save it as MPR and open that.

The file extension alone is not sufficient to determine the original equipment or dialect. After opening the file, compare the dialect, units, and interpretation warnings in the Information panel with the settings in the original program. When the viewer decides a file is in a dialect such as Haas or Siemens, or is a lathe program, it says so in a bar above the view; if that guess is wrong, you can change it right away in the bar or the Information panel and read the file again.

Learn about playback and connecting code lines using an example

"View an example" opens a sample G-code generated within this browser. This allows you to explore the interface controls without needing to select your own NC file.

  1. In the example, select "View All" or press 'F' to fit the path to the screen.
  2. Select code lines or 3D paths to view their connected movements.
  3. Use the playback bar to play/pause, adjust speed, and examine tool-specific paths.
  4. Open the file and check the units, tolerances, warnings, and the lengths for feed and rapid movements in the information panel.

When the path size or shape differs from expectations

First, verify that the units and dialect settings match the original configuration. Check the overall view and the display status for each tool, then select the problematic line of code to pinpoint the corresponding movement.

Radius compensation paths, lathe mode, and rotary axis wrapping are optional features. Ensure they are configured according to the specific requirements of your program; do not assume that applying these settings globally to all movements will yield the same result as the original.

If an operation is missing from a panel machining file, check in the information and machining panels whether it is disabled or an unsupported macro or element. Unsupported macros and elements may be shown only as a point at their position. In PGI and XML, an operation whose values could not be read stays in the machining list marked “not interpreted”.

Distinguish between analysis results and verification using actual equipment.

The toolpath display and estimated time cannot tell you about collisions, controller behavior or machining quality. Before running a program on the machine, verify it separately against the original CAM, the controller and on-site conditions.

When reporting an error, please provide the dialect, units, the problematic line of code, and the expected movement. Use a minimal, self-created example rather than proprietary NC code. Files are processed locally within this browser and are not automatically uploaded to public issue trackers.

Open-source implementation and usage guide