G-code is a programming language that tells a 3D printer how to print an object. The individual commands perform different functions. For example, “G28” tells the printer to move the print head to home. Another code, “G0”, tells the printer to move as rapidly as possible to the next location.
The RepRap wiki lists 13 different flavors of G-code used with various 3D printers. From this, we can see that it is common for 3D printers to use G-code even if they perform similar functions. With so many flavors of G-code out there, it is useful to know what file formats can be converted to and from G-code.
Given that G-code is the universal language for 3D printing, it’s possible to convert most 2D and 3D files into G-code. To aid our discussion, we’ll break this up into direct conversions (one step) vs indirect (many step) conversions.
The following file formats can be converted directly into G-code using the popular slicers Cura, Slic3r, or Simplify3D. That said, other file types may exist that can be directly converted in other slicers.
Indirect conversions involve first converting a file to an STL. Next, the STL file can be converted into G-code using a slicer. Using this method, a wide variety of files can be converted to G-code. To illustrate, the following is a list of file types supported by Fusion 360 alone:
Want to convert your files for free? Well, there are ways to use Fusion 360 for free, but if you’re looking for a totally free tool, there are many free CAD programs out there. You just have to check that they support conversion to STL.
Converting from G-code to another format is typically difficult to do compared to going the other way round. This is because G-code often has added materials from the slicing software, such as supports and brims, which are unrelated to the actual model. These objects show up as part of the 3D model when converted from G-code to another format. Nevertheless, two methods exist to convert G-code back to STL (and then to another format).
These methods include MakePrintable’s G-code reverser service as well as the Voxelizer software. More information can be found about this process in our article about converting from g-code to STL. With this information, you should be able to convert nearly every type of file to G-code and back again.
Feature image source: All3DP
License: The text of "G-Code Converter – What Can Be Converted to and from G-Code" by All3DP is licensed under a Creative Commons Attribution 4.0 International License.