What is G-Code? Learn and Visualise G-Code with NC-Viewer

What is G-Code?


G-code is a language for communicating with machines. G-code is a rather simple language, that can be edited with a text editor like Notepad or TextEdit.

The G-code determines a machine’s movement, but also parameters such as spindle speed, depending on the CNC; Or may control temperature depending on the machine. (G-code is also used for 3D Printers!)

Early machines would take input from punch cards that would look like this:

G-Code Punchcard

Fortunately, these days Computer Aided Manufacturing (CAM) software generates G-Code for us. Using V-Carve Pro, SolidCAM or Fusion360, you can easily set up jobs for your CNC Router, then send and carry out the job without needing to write any G-Code.

By the way, you also use G-code when you use slicer software (eg. Slic3r, Ultimaker Cura or PrusaSlicer) with a 3d Printer.

Therefore, an understanding of G-Code is absolutely NOT necessary, but it may be of interest.

Learn G-Code with NCViewer


There are many, many types of individual G-Code operations, as you can see here. We recommend using the examples like those on NCViewer.com. NCViewer.com is a G-code simulator that interprets G-code for you, even as you edit it. Link to its online simulator: https://ncviewer.com.

NC-Viewer

Play around a little to understand how CNC machines “think”. Try writing a G-Code sequence that draws:

  • Curves
  • Lines
  • That use all 3 dimensions

View in the NCViewer application above to check your result!

NC-Viewer