Understanding CNC File Formats: G-Code, TAP, NC, and More Explained
CNC machining revolves around precise instructions delivered to machines in the form of code files. These files vary in extension and structure based on the controller type, CAM software, and machine configuration.
In this guide, we’ll break down the most common CNC file formats, what they contain, and how to ensure compatibility across different systems.
📂 Common CNC File Extensions and Their Uses
| Extension | Meaning | Typical Use | Example Controllers |
|---|---|---|---|
.gcode | G-code | Standard CNC program | Marlin, GRBL, RepRap |
.nc | Numeric Control | Generic G-code programs | Fanuc, Haas, Siemens |
.tap | Tapping file | Often used in routers/plasmas | Mach3, Torchmate |
.txt | Text file | Universal, editable format | All controllers |
.eia | EIA compliant | Aerospace/military machines | Older legacy systems |
.min | Minimal G-code | Specialized CAM exports | Heidenhain |
🧠 What’s Inside a CNC File?
Example of a .nc file content:
%
O1001
G21 G90 G17
G0 Z5
G0 X0 Y0
G1 Z-2 F150
G1 X100 Y0 F300
G1 Y50
G1 X0
G1 Y0
M30
%
Each line performs an action:
G21= metric unitsG90= absolute positioningG1= linear interpolationM30= end of program
🆚 File Format Differences: GCODE vs NC vs TAP
| Feature | .gcode | .nc | .tap |
|---|---|---|---|
| Readable by all editors | ✅ | ✅ | ✅ |
| Contains tool info | Sometimes | Yes | Yes |
| Machine-specific format | Usually yes | Yes | Yes |
| Editable by hand | ✅ | ✅ | ✅ |
| CAM software output | Yes | Yes | Yes |
🧰 How CAM Software Affects File Format
CAM programs like Fusion 360, Mastercam, SolidCAM, or VCarve export CNC files based on:
- Postprocessor selected
- Machine definition
- Toolpaths created
Postprocessors are the key. They control how G-code is generated:
- Fanuc-style vs Siemens-style
- Custom G/M-code mappings
- Header/footer differences
You can modify postprocessors to match your controller.
🛠️ Tip: Converting Between File Types
You can rename extensions manually in many cases:
program.gcode→program.ncpart.tap→part.txt
However, make sure the internal syntax matches your machine’s dialect.
Use CAM software or a G-code editor to validate before sending to your controller.
📦 File Format Compatibility Chart
| Controller Brand | Accepts .gcode | Accepts .nc | Accepts .tap |
|---|---|---|---|
| Marlin/GRBL | ✅ | ✅ | ❌ |
| Fanuc | ✅ | ✅ | ✅ |
| Mach3 | ✅ | ✅ | ✅ |
| Haas | ✅ | ✅ | ✅ |
| Siemens | ✅ | ✅ | ❌ |
| Heidenhain | ❌ | ✅ | ❌ |
💡 Pro Tips
- Always simulate first using a G-code viewer like CAMotics or NC Viewer
- Use consistent naming conventions:
ProjectName_Material_ToolNumber.nc - Backup your original CAM projects in case you need to regenerate G-code
- Store your postprocessor settings per machine
✅ Summary
Understanding the differences between .gcode, .nc, .tap, and other CNC formats allows you to:
- Match files to the correct machine
- Prevent costly syntax errors
- Customize and optimize toolpaths
- Ensure safety and accuracy
“Know your format. Know your machine. Know your outcome.”
Leave a comment