Skip to content

Toolpath playback · CNC · 3D printing

G-code Simulator Online

Load a G-code file and play its toolpath back move by move in 2D or 3D, at a speed you choose. This simulates the path your program describes. It is not a machine simulation, and this page explains where the difference matters.

What “G-code simulator” can mean

The term covers three different levels of checking, and it helps to know which one you need.

  1. Toolpath playback (backplot). The program is read line by line and the path is drawn as the tool would move. This shows the shape and order of the moves. ViewGcode does this.
  2. Material-removal simulation. A stock model is cut away by the tool, so you can see the finished part and gouges. CAM software and dedicated simulators do this. ViewGcode does not.
  3. Machine and controller simulation. The whole machine is modelled, including axis limits, fixtures and collisions, using the controller’s own logic. This comes from the machine maker or your CAM system. ViewGcode does not do this either.

What the playback does

  • Play, pause and step. Run the whole file, step one move forward or back, or jump to the start or end.
  • Adjustable speed. A slider sets how fast the path is drawn, so a long program does not take as long as the real job.
  • Move-by-move position. A slider follows the file order, and the X, Y, Z, F and E values of the current move are shown as you go.
  • Layer by layer. For 3D printing files, step through layers or show everything up to the selected one. Earlier moves are drawn in full colour and later ones dimmed.
  • Linked source. Click a path to find its line of code. With the source panel open, the matching line follows the playback.
  • 2D and 3D. Use the top view for the layout and the 3D view, with top, front, side and isometric cameras, for depth.

How to simulate a G-code file

  1. Open the viewer and drop in your file. It works with .gcode, .nc, .tap and other plain-text G-code.
  2. Check the profile (3D printing or CNC / milling) and the units.
  3. Press play, or drag the movement slider to scrub through the file.
  4. Open the parser notes to see any commands that were skipped, because they are not part of the picture.

What this simulator does not do

You want to checkHereUse instead
Shape and order of movesYes, drawn from the program-
Rapids and arcs (G0, G1, G2, G3)Yes-
Program extents against stock or build volumeYes, as toolpath bounds-
Material removal and the finished partNoCAM simulation or a stock-removal simulator
Collisions with clamps, fixtures or the machineNoCAM or machine simulation
Tool length offsets and cutter compensationNo, the programmed path is shownYour controller’s simulation or dry run
Machine limits, acceleration and run timeNo, and no time estimateYour slicer or controller
Canned cycles, splines, macro variablesSkipped with a warningYour CAM preview

Treat the playback as a way to look at a program before it runs, not as a guarantee that a job is safe. Run a controller dry run for anything that could damage a machine.

Who uses toolpath playback

CNC users use it to check a program from CAM or a download before it reaches the machine: unexpected rapids, a wrong unit, or a path that leaves the stock. See the CNC G-code viewer and the NC file viewer. 3D printer users use it to look at the first layer, travel moves and retractions; see the 3D printer G-code viewer.

G-code simulator questions

Is it a CNC simulator? It is a CNC toolpath viewer with playback. It does not cut a virtual part.

Is it free, and is my file uploaded? It is free, and your file is read in your browser and never uploaded. See the privacy policy.

Can it simulate G-code for a lathe or a 4th or 5th axis? Not reliably. A, B and C axis words are ignored, so rotary programs are drawn as if only X, Y and Z moved.

Can I edit the code while it plays? No. It is a viewer. Edit the file in a text editor or CAM software, then open it again.

Back to the online G-code viewer.