NC, TAP, NGC & G-Code Files

What each CNC file type is, where it comes from, and how to open one and see the toolpath.

Have a file to look at? Open it in CutViewer to see the toolpath in 3D, the run time and any problems in the program.

Open a File in CutViewer

Free, no signup, and the file stays on your computer.

CNC programs come with many different extensions, but nearly all of them are the same thing: plain-text G-code. The extension usually tells you which program or controller the file was made for, not what's inside. If you open any of these files in a text editor you'll see lines like G1 X10 Y20 F500. To see what that code actually does, open the file in a G-code viewer.

The common CNC file types

Extension Usually comes from Opens in CutViewer
.ncFusion 360, Carbide Create, VCarve, Easel and many other CAM programsYes
.tapPrograms posted for Mach3 and Mach4Yes
.ngcLinuxCNCYes
.gcode3D printer slicers, and some CNC and laser softwareYes
.cncSome post processors and controllersYes
.txtG-code saved from a text editorYes
.mpf, .eia, .minSiemens, Mazak and Okuma controlsYes (standard G-code moves only)
.h, .sbpHeidenhain conversational, ShopBotNo – not G-code

.nc files

The .nc extension (for “numerical control”) is the most common one for CNC programs, and it's what many CAM programs use by default, including Fusion 360, Carbide Create, VCarve, Easel and Mastercam. GRBL-based routers such as the Shapeoko and X-Carve run .nc files directly.

To open a .nc file, drag it onto CutViewer or click Open File. The code appears in the editor and the toolpath is drawn in 3D. The Job panel shows the estimated run time, part size, tools used, and warnings for problems such as a missing feed rate or a rapid move below Z0.

Not every .nc file is a CNC program. Scientific software uses the same extension for NetCDF data files, which are binary and won't open in a G-code viewer. If your file came from a CAM program or a CNC machine, it's G-code.

.tap files

.tap is the extension Mach3 and Mach4 expect, so CAM post processors for Mach machines usually save in this format. The name goes back to the days when programs were stored on punched paper tape. Inside, it's ordinary G-code, and you can open it in CutViewer the same way as a .nc file.

.ngc files

.ngc is LinuxCNC's native extension. The name comes from the NIST RS274NGC interpreter that LinuxCNC's G-code dialect is based on. CutViewer opens .ngc files. LinuxCNC-specific features such as O-word subroutines and loops may not display.

.gcode files

.gcode is used most by 3D printers. Slicers such as Cura and PrusaSlicer save print files with this extension. Some CNC and laser software uses it too. A 3D printer file is G-code like any other, but it's full of extrusion and temperature commands, and a print can have thousands of layers. CutViewer is built for CNC milling and routing programs.

.cnc files

.cnc is a generic extension that some post processors and controllers use. As with the others, the code inside is plain-text G-code, and CutViewer opens it directly.

Industrial controls and non-G-code formats

  • .mpf (Siemens Sinumerik main program), .eia (Mazak EIA/ISO) and .min (Okuma main program) hold G-code with extra commands specific to each control. CutViewer opens them and draws the standard G0, G1, G2 and G3 moves, but not control-specific cycles and variables.
  • .h files from Heidenhain controls are written in Heidenhain's conversational (Klartext) language, and .sbp files are ShopBot's OpenSBP language. Neither is G-code, so they won't display in a G-code viewer.

Does the extension matter?

For viewing, not really. What matters is whether the G-code inside suits your machine's controller. That depends on the post processor you chose in your CAM program, not on the extension. A program posted for a Haas won't run properly on a GRBL router just because you rename it .nc. Before you cut, it's worth opening the file in a viewer to check the toolpath and the program's extents. The G-code reference explains what each command does.

Frequently Asked Questions

What is an NC file?

An NC file (.nc) is a CNC program saved as plain text. It holds the G-code your machine follows, including moves, feed rates, spindle speeds and tool changes. CAM programs such as Fusion 360, Carbide Create and VCarve export NC files.

How do I open a .nc file?

Open CutViewer in your browser and drag the file onto the window, or click Open File. You'll see the code, a 3D view of the toolpath and an estimate of the run time. Any text editor, such as Notepad or TextEdit, also opens an NC file, but only as text.

Are .nc, .tap, .ngc and .gcode files different?

Usually not. They are all plain-text G-code; the extension mostly shows which program or controller the file was made for. Mach3 uses .tap, LinuxCNC uses .ngc and 3D printers use .gcode. What matters is whether the code inside matches your machine's controller, which is set by the post processor in your CAM program.

Can I rename a .tap file to .nc?

Yes. Renaming doesn't change the code inside, so the program will run the same as long as your controller understands that G-code. Some controllers only list files with the extension they expect, which is the main reason to rename.

Is my file uploaded when I open it in CutViewer?

No. CutViewer reads the file in your browser and doesn't send it anywhere. It only fetches a file from a server when you open a link to a file that's hosted online.

Can I convert an NC or G-code file to STL?

Not in CutViewer. A G-code file only describes the path the tool takes, not the finished part, so turning it back into a 3D model means simulating the material the tool removes.