CNC Machine File Formats

CNC Machine File Formats
— · 0 votes

A CNC machine runs a machine-specific program called G-code, stored as a text file with a name like an NC file, and it does not read CAD or design files directly. That text file holds the coordinates, feed rates, spindle speeds and other commands the controller executes one line at a time. Format the file in a way the controller accepts, and the file also carries a header, tool changes and a clean program end. The design side uses DXF, STL and STEP files, so the page explains how those formats differ and how each one reaches the machine.

G-code and the NC file

G-code is the command language every CNC controller interprets, and an NC file is the plain-text file that carries it to the machine. Each line holds a motion command or a machine setting, written as letters and numbers the control reads in order. The G-code file is tied to one machine and one setup, so a program written for one machine needs review before it runs on another. File extensions such as .nc, .tap or .txt label the same kind of content, and the controller manual names what it accepts.

Design files are not machine files

A CAD file describes geometry, while a CAM toolpath file describes the path the tool follows to cut that geometry. DXF files carry 2D outlines for profiles and nested parts, and STL files carry triangle meshes for 3D shapes. STEP files carry solid models with precise dimensions and are used when the part needs real engineering data. None of these files runs a machine on its own, and each one needs a CAM step before a CNC control can act on it.

How a job moves from design to cut

The route from a drawing to a cut part starts in CAD, passes through CAM, and ends as a G-code file at the controller. CAM software imports a DXF, STL or STEP file, then the programmer picks tools, stock, offsets and cutting strategy to generate toolpaths. That CAM output is posted into the G-code dialect of the target machine, using a postprocessor written for that control. A wood router, mill or lathe each has its own needs, so the file is checked against the machine and the setup before the first cut.

CNC file format questions

What file format does a CNC machine use?

A CNC machine uses a G-code program saved as a plain-text file, with names such as .nc, .tap or .txt depending on the control. That file holds the coordinates, feeds, speeds and tool commands for the job. The controller reads the lines in order and moves the axes to match. Confirm the accepted extension and dialect in the machine manual before you send a program.

What type of file does a CNC router use for wood?

A wood CNC router runs G-code, the same program type as a mill or lathe, generated from a design through CAM software. A DXF file supplies 2D outlines for panel work, and an STL file supplies 3D shapes for carving. CAM software converts that geometry into toolpaths and posts them as a router-specific program. The router control then executes the file, so check the postprocessor and the tool numbers first.

Is G-code the same as an NC file?

Yes, an NC file is the text file that contains G-code, so the two names describe the same program at different levels. G-code is the command language, and the NC file is the container that stores it for the control. The extension changes by control maker, while the content follows the dialect that control expects. A program moved between machines needs a check of that dialect before it runs.

Can a CNC machine cut straight from an STL or DXF file?

No, a CNC machine cannot run an STL or DXF file directly, because those files describe shapes rather than tool motion. CAM software reads the geometry, lets the programmer choose tools and strategy, and writes the toolpaths. The output is then posted as G-code for the specific control. Only that posted program reaches the machine, so a CAM step always sits between the drawing and the cut.

Read next

Latest articles