The difference between .gcode and .3mf files
.gcode is the actual set of instructions your 3D printer reads and follows. It contains the exact movements the printer's nozzle will make, how fast it will move, what temperature to heat to, and when to extrude plastic. Think of it as the finished recipe ready to cook. .3mf is a 3D model file — it holds the shape and dimensions of the object you want to print, but not the printer-specific instructions. It's the ingredient list and photo of the finished dish, not the cooking steps.
When you download a 3D model from a site like Thingiverse or Printables, you usually get a .3mf file (or sometimes .stl, which serves the same purpose). That file alone cannot run on your printer. You have to open it in slicing software — programs like Cura, PrusaSlicer, or Bambu Studio — which converts the 3D shape into .gcode by calculating all the printer movements, layer heights, infill patterns, and support structures. Only the .gcode file goes onto your printer's memory card or connects to the printer over USB.
Key Takeaways
- .3mf files contain the 3D model shape; .gcode files contain the printer instructions that tell your machine exactly what to do.
- You cannot print a .3mf file directly — you must convert it to .gcode using slicing software first.
- .gcode is printer-specific: the same .3mf model sliced for a Prusa will produce different .gcode than the same model sliced for a Bambu printer.
- Slicing software is usually free and runs on Windows, Mac, or Linux, and most printer manufacturers provide their own version.
Why printers need .gcode instead of just the 3D model
A 3D model file like .3mf describes only the outer shape — it says "this object is a cube 10 millimeters on each side." Your printer needs to know much more: how thick each layer of plastic should be, how fast the nozzle should move, whether to fill the inside solid or with a honeycomb pattern, where to place support material if the design has overhangs, and how hot the nozzle and bed should be. Different printers have different capabilities, so the same .3mf file needs different .gcode depending on whether you're using a budget Ender 3 or a high-end Prusa.
The slicing software does all this calculation. It breaks the 3D model into thin horizontal layers (usually 0.1 to 0.3 millimeters thick), figures out the path the nozzle must take to draw each layer, and writes out every movement as a .gcode command. This is why slicing takes time — a complex model might produce a .gcode file with hundreds of thousands of individual instructions.
How to convert a .3mf file to .gcode
Open your slicing software and load the .3mf file. The software will display the 3D model on screen. You then choose your printer model from a dropdown menu (so the software knows the printer's size, nozzle diameter, and other specs), select your material (PLA, PETG, resin, etc.), and adjust settings like layer height and infill percentage. Most software comes with preset profiles for common materials that work well out of the box.
Once you're happy with the preview, click the "Slice" or "Export" button. The software generates the .gcode file and saves it to your computer. You then transfer that .gcode file to your printer — either by copying it to an SD card and inserting the card into the printer, or by connecting the printer to your computer over USB and sending the file directly. Some newer printers can receive .gcode over WiFi.
Popular free slicing software includes Ultimaker Cura (works with most printers), PrusaSlicer (optimized for Prusa printers but works with others), and Bambu Studio (for Bambu printers). Each has a learning curve, but the basic workflow is the same: load model, pick printer, adjust settings, slice, save .gcode.
Why .3mf is becoming more common than .stl
.stl files have been the standard 3D model format for decades, and you'll still find them everywhere. But .3mf is newer and stores more information in a single file — it can include color, texture, multiple parts, and metadata without needing separate files. For simple single-color prints, the difference doesn't matter much. For complex multi-part assemblies or colored prints, .3mf is cleaner to work with.
Both formats work in all major slicing software, so you don't have to choose. If you download a model and it's .stl, use it as-is. If it's .3mf, use that. The slicing software handles either one the same way.
What happens if you try to open .gcode in a regular program
.gcode is plain text, so you can open it in any text editor — Notepad, Word, or any code editor. You'll see lines like "G0 X10 Y20 Z0.2" (move to position X=10, Y=20, Z=0.2) and "G1 E5 F1200" (extrude 5 millimeters of filament at 1200 millimeters per minute). It's readable but not useful unless you're debugging a print problem or learning how your printer works.
You cannot convert .gcode back to a 3D model — the information about the original shape is lost during slicing. If you need to edit a model, you must go back to the original .3mf or .stl file, make changes in 3D design software like Fusion 360 or Blender, and re-slice it.
Storing and organizing your files
Keep your original .3mf and .stl files in one folder so you can re-slice them later if you change printers or want to try different settings. Store your .gcode files in a separate folder organized by printer model, since .gcode for a Prusa won't work on an Ender 3. Many people keep a "Models" folder and a "Prints" folder, with subfolders for each printer inside "Prints."
If you're sharing a print with someone else, send them the .3mf or .stl file, not the .gcode. They'll need to slice it for their own printer anyway, and sending the model file lets them adjust settings for their specific machine and material.
Frequently Asked Questions
Can I use the same .gcode file on different printers?
No. .gcode is specific to the printer it was sliced for — the nozzle size, bed dimensions, and movement speeds are all baked in. A .gcode file made for a Prusa will likely fail or print poorly on an Ender 3. Always re-slice your .3mf file for each different printer you use.
Is slicing software hard to learn?
The basics are straightforward: load a file, pick your printer, click slice. Learning to tweak settings for better quality takes practice, but you can print successfully with default settings while you learn. Most software includes tutorials and the 3D printing community is active with guides.
What if I lose the original .3mf file and only have .gcode?
You can still print from the .gcode, but you cannot edit the model or re-slice it with different settings. If you need to modify the design, you would have to find the original model file again or recreate it in 3D design software. This is why it's worth keeping backups of your original model files.
Do I need to understand .gcode to 3D print?
No. Slicing software handles all the .gcode generation for you. Understanding what .gcode is helps you troubleshoot print problems and learn why certain settings matter, but you can print successfully without ever looking at the code itself.