DXF to G-code: 4 Simple Conversion Methods
In manufacturing, various digital file types like OBJ, STL, and 3MF can be used across different machines, but some, like CNC machines, require specific formats.
Among CNC machine users, the data exchange format (DXF) is popular for sharing drawings cut on a CNC router. However, many CNC machines can only read G-code, not DXF files.
In this article, we’ll explain the differences between these files and how to convert DXF to G code using tools like ABViewer, DXF2Gcode, Carbide Create, and Autodesk Fusion. Enjoy!
【250mm/s max printing spee 】
【2500mm/s² acceleration】
【Auto leveling and Z offset】
【"Sprite" Direct Extruder】
【Stable dual Z-axis】
What Are DXF & G-code Files?

DXF is Autodesk’s open-source version of their proprietary drawing (DWG) file format, storing vector graphic information as a sequence of "groups." Since they’re open source, DXF files can be used on non-Autodesk platforms.
However, CNC routers can’t interpret DXF files and only read G-code, a programming language using alphanumeric commands to direct machine tasks.
Converting a 3D model file (e.g., STL, OBJ, 3MF) to G-code is typically done using a slicer. CNC machines, however, require a G-code generator, which allows you to add specific instructions for cutting or etching based on tooling or material requirements. Not all G-code generators can convert DXF to G-code.
The conversion process involves adapting the drawing into detailed steps for the CNC machine to follow. These steps are then converted into a G-code script that the CNC machine can read and execute. Various G-code generators offer this functionality, each with different conversion steps.
Method 1: ABViewer

Our first method is ABViewer, a popular file conversion tool from CAD Soft Tools, used by both makers and businesses to convert various file types. ABViewer supports DXF to G-code conversions, allowing you to create the G-code for your CNC machine to cut a DXF drawing. There’s a 30-day free trial, but the professional version costs around $95 for a perpetual license.
The software offers convenient controls, an intuitive UI, and is easy to navigate. It provides many tools for controlling how your cutting job will be executed. When generating G-code from a DXF file, you can scale the drawing, adjust rotation, and experiment with layers, blocks, sizes, and text styles.
Instructions:
- Open the File menu in the top-left corner and load your DXF file.
- Edit the file as required using the tools.
- On the Output tab, select the CAD to G-code icon. All drawing contours will be converted by default. Deselect any unwanted contours in the Processing queue window.
- Click the Convert icon to generate the G-code automatically.
- Click the “Save G-code” button, enter the output file name, and click “Save.” The file will be saved with the NC extension (.nc), which stands for numerical control (from “CNC”).
Method 2: DXF2Gcode

Our second method for converting DXF to G-code is the free and open-source DXF2Gcode. As the name implies, DXF2Gcode converts DXF files into G-code, specifically for LinuxCNC, resulting in a ".ngc" file type. Despite its simplistic interface, it is a reliable and effective program.
DXF2Gcode also functions as a CAM program, allowing you to configure how the DXF file is cut by your machine. It includes features like layer selection, layer view mode, and an automated basic tool path generator. The program also offers settings for rotation speeds, depth, position offsets, and more, giving users extensive control over the cutting process.
Instructions:
- Click the File menu in the top-left corner. Then, click “Open…” and select your DXF file.
- From the Layers tab on the left side of the interface, select all the shapes you want to include in your cut.
- Click the “Options” button and select “Configuration…” Here, you can adjust the configuration settings, such as the machine settings and more.
- Click the “Export” button and select “Optimize Paths.”
- Review the generated G-code, click the “Export” button again, select “Export Shapes,” and save your LinuxCNC G-code file.
Method 3: Carbide Create

Next, we have Carbide Create, another CAM and file conversion tool. Like DXF2Gcode, Carbide Create is open source and free to use, making it invaluable for converting CNC machinable files like DWG and SVG.
Carbide Create excels at converting DXF drawings to G-code and offers many additional features. It includes built-in 2D modeling tools for creating your own drawings, such as basic shapes (squares, circles), 2D text, background images, and alignment tools.
The program’s CAD features enable toolpath creation, engraving, contouring, and V-carving. It also has a tool library where you can select the toolhead you’re using on your CNC machine. Once converted, you can use the built-in G-code simulator to ensure your G-code is correct. Adjustable CNC settings include speeds, feed rates, offsets, and more.
Carbide Create stands out with its extensive features and user-friendly interface, making it a powerful tool for CNC projects.
Instructions:
- Open the File menu in the top-left corner, then click “Open” and choose your DXF file.
- In the Design section of Carbide Create, make any desired adjustments to the drawing.
- Select the “Toolpaths” button to create the toolpaths you need.
- Click the “Save GCode” button.
- The first time you use the program, you’ll need to select a post processor. We recommend choosing “Basic G-Code.” You can find the “Select Post Processor” option under the Edit menu if you need to change it later.
Carbide Create's combination of versatility and user-friendly design makes it an excellent choice for converting DXF files to G-code and managing CNC machining projects.
Method 4: Fusion

Our last method is using computer-aided design (CAD) software with CAM functionalities, specifically Autodesk's Fusion. Fusion is a versatile tool for generating G-code and accepts a wide range of file formats, including DXF.
Fusion's interface makes it easy to convert a DXF file to G-code. In the Manufacturing tab, you can import a DXF file and then use the Milling section to prepare your model for conversion. This includes adding specific cutting jobs, such as the “Face” feature.
For each cutting job, you can adjust CNC machine settings like spindle speed. Once the setup is complete, you can save your cut as an “.nc” file, which is compatible with many CNC machine programs.
Fusion also offers a variety of CAM tools for further customization, making it a powerful choice for CNC machining.
Instructions:
- Open the File menu in the top-left corner, select “Open…”, and choose your DXF file to import.
- Click the drop-down menu in the top-right corner (which should read “Design”) and select the Manufacture tab.
- In the Manufacture tab, select the “Milling” section from the top toolbar.
- Add any cutting or milling jobs and adjust the necessary settings.
- Click the “G1 G2” icon in the top toolbar's “Actions” section for post-processing options.
- In the pop-up screen, click “Post” to save your .nc file to the desired location.
Fusion's extensive features and user-friendly design make it an excellent tool for converting DXF files to G-code and managing CNC projects.
For more Creality 3D Printer, you can click the related articles as follows:
Related Articles:
Ender 3 V3 Ke with Cura: Settings & Guide >>
Conclusion
This guide covers converting DXF files to G-code for CNC machines using tools like ABViewer, DXF2Gcode, Carbide Create, and Autodesk Fusion. Each tool offers unique features, making the conversion process efficient. Mastering these tools ensures precise and effective CNC machining from DXF drawings.
Read more:
Troubleshooting Ender 3 Extruder Skipping Issues
How to Achieve Perfect Bed Leveling on Your Ender 3
PETG Print Speed on the Ender 3
Recent News

8 Halloween 3D Print Ideas to Make Before October 31

Ender Series 3D Printers Parameter Comparison

Creality Back-to-School Sale 2026: Save Up to 50% on 3D Printers and More



