3D printing file formats: STL vs 3MF vs OBJ vs STEP explained
Use 3MF for slicer projects and multicolor prints, STL for simple universal sharing, and STEP when someone needs to edit the design in CAD. G-code, including Prusa's .bgcode and Bambu's .gcode.3mf, is printer-specific slicer output, not a model. Here's what every common 3D printing file format stores and how to move between them.
- 3MF for slicer projects, multicolor and multi-part prints. It carries units, colours, materials, thumbnails and (from a slicer) print settings.
- STL for simple, universal sharing. Every slicer opens it, but it's only triangles: no units, no colour.
- STEP for anyone who will edit the design in CAD. It keeps exact curved surfaces instead of triangles.
- G-code, .bgcode or .gcode.3mf only for sending a job to one specific printer. It's toolpaths, not a model.
3D printing file formats compared
Formats fall into three families: meshes (triangles), CAD solids (exact surfaces and features) and machine code (instructions for one printer).
| Format | Geometry | Units | Colour & materials | Settings & thumbnails | File size | Who uses it |
|---|---|---|---|---|---|---|
| STL (.stl) | Triangle mesh, surface only | None (slicers assume mm) | None in the standard | None | Medium; ASCII is several times larger than binary | Every slicer, model sites, CAD exports |
| 3MF (.3mf) | Triangle meshes in a ZIP package | Yes (mm by default) | Yes: base materials, plus colours and textures via extensions | Thumbnails; slicer projects add plates, paint and print settings | Small (compressed) | Bambu Studio, PrusaSlicer, OrcaSlicer, Cura, CAD exports |
| OBJ (.obj + .mtl) | Polygon mesh with UVs and normals | None | Materials and texture links in a separate .mtl file | None | Large (text) | Blender, renderers, AI generators, colour imports |
| PLY (.ply) | Mesh or point cloud | None | Per-vertex colour | None | Medium (ASCII or binary) | 3D scanners, photogrammetry |
| STEP (.step, .stp) | BRep solids: exact faces, edges and curves | Yes | Names and basic colours | Assembly structure; no print settings | Small for clean CAD; huge when faceted | Fusion, Onshape, FreeCAD, SolidWorks; slicers can import it |
| IGES (.igs, .iges) | Older neutral format for curves, surfaces and solids | Yes | Basic | None | Medium | Legacy CAD exchange, largely replaced by STEP |
| AMF (.amf) | XML mesh, optional curved triangles | Yes | Colours, materials, gradients | Metadata | Medium (often zipped) | ISO/ASTM standard with limited real-world adoption |
| Native CAD (.f3d, .sldprt, .FCStd) | Full feature history, sketches and constraints | Yes | Yes | App-specific | Varies | Only the program that made it (plus some importers) |
| SCAD (.scad) | A script that generates the geometry | Millimetres by convention | Depends on what you export | None | Tiny (text) | OpenSCAD, PrintPal CAD Agent |
| G-code (.gcode) | No model: moves, extrusion, temperatures, fan speeds | Machine units | Tool and filament change commands | Slicers embed settings and thumbnails as comments | Large (text) | Marlin, Klipper and most FDM printers |
| Binary G-code (.bgcode) | The same toolpaths in compressed blocks | Machine units | Same as G-code | Metadata and thumbnail blocks, checksums | About 70% smaller than text G-code (Prusa's figure) | PrusaSlicer 2.7+, Prusa MINI, MK4 and XL |
| Bambu sliced file (.gcode.3mf) | ZIP holding G-code for each plate | Machine units | Filament list per plate | Plate thumbnails, slice info, settings | Small (compressed) | Bambu Studio and Bambu Lab printers |
STL vs 3MF: which should you use?
STL dates back to the late 1980s and stores one thing: a list of triangles, each with three corner points and a normal. It has no units, no colour and no idea which triangles belong to which part. Its superpower is that literally everything opens it.
3MF, maintained by the 3MF Consortium, is a ZIP package of XML files. The core specification declares a unit (millimetres by default, with micron through metre allowed), named base materials, multiple objects and optional thumbnails. Extensions add colour, textures and more. Slicers go further still: a Bambu Studio, OrcaSlicer or PrusaSlicer project 3MF also saves plates, filament assignments, painted regions and print settings.
Use 3MF when the print has several parts or colours, when you want slicer settings to travel with the model, or when you hand a ready-to-slice project to someone.
Fall back to STL when the recipient's software is old or a model site only accepts STL.
Note: slicer projects aren't fully portable. Paint data and settings saved by one slicer may be ignored or reinterpreted by another, although the geometry still comes through. The multicolor 3D printing guide covers colour workflows per slicer.
STL vs OBJ (and PLY): when colour matters
OBJ is a plain-text mesh format from Wavefront. It can store polygons (not just triangles), texture coordinates and normals, and it points to a companion .mtl file that holds materials and texture image names. Lose the .mtl or the images and the colour goes with them, so share OBJ files as a ZIP.
PLY, the Stanford polygon format, is what many 3D scanners and photogrammetry tools produce. It stores per-vertex colour and comes in ASCII or binary flavours. Neither OBJ nor PLY records units.
For a single-colour print, OBJ and PLY offer nothing STL doesn't. For colour, they're how textured models from scanners and AI generators usually arrive, and Bambu Studio can read OBJ vertex or material colours on import and map them to filaments.
Mesh vs BRep: why STEP vs STL matters
A mesh (STL, 3MF, OBJ, PLY) approximates every surface with flat triangles. A BRep, short for boundary representation (STEP, IGES, native CAD), stores the real geometry: this face is a cylinder of radius 4 mm, this edge is an arc, these two faces meet at a 1 mm fillet. STEP itself is the ISO 10303 family of standards for exchanging product data between CAD systems.
Think of it this way: an STL is a photo of a cake, a STEP file is the recipe, and the native CAD file is the recipe with the chef's notes in the margin. You can print from any of them, but only the recipe lets you bake a slightly bigger cake.
That's why you can't easily turn an STL back into editable CAD. The triangles don't know they used to be a hole or a fillet, and the feature history (sketches, dimensions, the order of operations) was never in the file. If you're still picking a CAD program, see the best free CAD software for 3D printing.
Why mesh-to-STEP gives you a faceted solid
Converters wrap each triangle in a flat STEP face and stitch the faces into a solid. The result is valid STEP that any CAD program opens, but a cylinder made of 2,000 triangles is still 2,000 flat faces, not one round face. You can measure it, use it as a reference or add new features to it. You can't drag its diameter.
Watch the file size: STEP spends far more text per face than STL spends per triangle, so a faceted STEP is often many times larger than the mesh it came from, and slow to open.
How to convert STL to STEP (and what you actually get)
- Repair the mesh first. Only a watertight mesh converts to a solid; holes give you a surface body or a failed conversion.
- Reduce the triangle count. Fewer triangles mean fewer STEP faces and a file CAD can handle. Decimate gently so curves keep their shape.
- Convert in a CAD tool. In FreeCAD, import the STL, run Part → Create shape from mesh, then Convert to solid, optionally Refine shape, and export STEP. In Fusion, insert the mesh and use Convert Mesh: the personal license offers the Faceted method, while Prismatic (which merges flat regions into clean faces) needs a paid license.
- Decide whether you really need it. For anything you'll keep editing, remodel the part in CAD using the converted solid as a tracing reference. It's usually faster than fighting a body made of triangles.
PrintPal's CAD Agent can also export a faceted STEP of the models it generates (in Advanced mode), which is handy for dropping an AI-designed part into a CAD assembly. Its editable source is the .scad file, and the OpenSCAD tutorial shows how to work with one.
STL units and scale problems
STL coordinates are just numbers. A cube that measures 25.4 could be 25.4 mm or 25.4 inches, and the file can't say which. Nearly every slicer assumes millimetres.
- Part is 25.4× too small: it was exported in inches. Scale it by 2540% in the slicer, or re-export in millimetres.
- Part is 10× or 1,000× off: it was exported in centimetres or metres. Blender's default unit is the metre, so set scene units to millimetres before you model.
- Avoid the problem entirely: export 3MF, which declares its unit, or pick millimetres in the export dialog. Fusion's Save As Mesh and Onshape's STL export both ask for a unit.
You designed a part in inches, exported an STL, and it shows up tiny in your slicer. What happened?
STL has no unit field, and slicers assume millimetres, so a 2-inch part arrives as 2 mm. Scale it by 2540%, re-export in millimetres, or use 3MF, which records its unit.
STL export resolution and tessellation settings
When CAD exports a mesh, it approximates each curve within a tolerance. Too coarse and round holes print as polygons, slightly undersized because the flat edges cut inside the true circle. Too fine and the file swells with no visible gain.
| Where | Setting | Starting point |
|---|---|---|
| Onshape STL export | Resolution: Coarse, Medium, Fine or Custom | Fine for printed parts |
| Fusion, FreeCAD and other CAD | Mesh refinement, deviation or chord-height tolerance | The highest preset, or about 0.01 mm deviation for precise fits |
| OpenSCAD and CAD Agent | $fn, $fa and $fs | $fa = 2 and $fs = 0.4 for final renders |
| Blender | Apply Modifiers, with Render (not Viewport) properties | Export the subdivided mesh you actually see |
| Slicers importing STEP | Linear and angular deflection | Lower values give smoother curves and more triangles |
Binary vs ASCII STL
Binary STL stores an 80-byte header, a triangle count, then exactly 50 bytes per triangle. ASCII STL writes the same data as readable text, which makes it several times larger. The geometry is identical, so use binary unless a tool specifically asks for ASCII. Here's one triangle in ASCII form:
solid bracket
facet normal 0 0 -1
outer loop
vertex 0 0 0
vertex 20 0 0
vertex 20 10 0
endloop
endfacet
endsolid bracket
Watertight and manifold: what slicers need
Slicers find the inside of your part by following its surface, which only works when that surface is closed:
- Watertight: no holes, so every edge is shared by exactly two triangles.
- Manifold: no edge shared by three or more faces, and no surfaces that touch at a single point.
- Consistent normals: every triangle faces outward. Flipped ones confuse inside and outside.
- No self-intersections: no overlapping shells left over from un-merged parts or messy booleans.
Exports from parametric CAD are usually clean. Sculpts, scans and AI-generated meshes are where problems show up; see preparing AI models for 3D printing for the full clean-up routine and the 3D printing design guide for wall thickness and overhang rules.
Free PrintPal toolMesh Repair & SimplifierCheck a mesh for holes, non-manifold edges and flipped faces, fix it, and download STL or OBJOpen toolG-code, .bgcode and .gcode.3mf: printer output, not models
G-code is what the slicer writes after it has made every decision: moves, extrusion amounts, temperatures and fan speeds for one printer, nozzle and filament. It's plain text, so you can read it:
M104 S215 ; set nozzle temperature
M140 S60 ; set bed temperature
G28 ; home all axes
G1 Z0.2 F3000 ; move to first-layer height
G1 X60 Y20 E3.2 F1500 ; extrude a priming line
Two vendor variants are now common:
- .bgcode (Prusa binary G-code): a block-based, compressed format with metadata, thumbnails and checksums. Prusa says it cuts file size by about 70%. PrusaSlicer has exported it by default since 2.7.0 for supported printers (Original Prusa MINI, MK4 and XL on firmware 5.1.0 or newer), and File → Convert switches between binary and text.
- .gcode.3mf (Bambu Lab sliced file): what Bambu Studio's Export plate sliced file writes. It's a ZIP with each plate's G-code at
Metadata/plate_1.gcode, plus thumbnails and slice info. It's not an editable project; use Save Project for a .3mf you can reopen and change.
Because G-code is printer-specific, never share it as "the model". A file sliced for one machine can heat, home and move in ways another printer doesn't expect, and you can't recover clean geometry from toolpaths.
To inspect a sliced file, the G-code Viewer opens plain-text G-code (.gcode, .gco, .g and .nc). Convert a .bgcode to text in PrusaSlicer first, or unzip a .gcode.3mf and open Metadata/plate_1.gcode.
How to convert between 3D printing file formats
Most conversions happen in tools you already have. Here's what each route costs you:
| From → to | Easiest route | What you lose |
|---|---|---|
| STL → 3MF | Import into any slicer and save the project, or export 3MF from CAD | Nothing; you gain units and room for settings |
| 3MF → STL | Slicer export, or the PrintPal 3D Model Converter | Units, colours, materials and settings |
| OBJ or PLY → STL | PrintPal 3D Model Converter, Blender or a slicer | Colours and textures |
| GLB/glTF → STL | PrintPal 3D Model Converter | Colours, textures and animation |
| STEP → STL or 3MF | Export from CAD, or import the STEP straight into PrusaSlicer, Bambu Studio or OrcaSlicer | Exact curves, tessellated at the resolution you pick |
| STL → STEP | FreeCAD (Create shape from mesh, then Convert to solid) or Fusion Convert Mesh | Nothing, but you gain nothing editable either: it's a faceted solid |
| SCAD → STL or 3MF | Render and export in OpenSCAD or CAD Agent | The parameters, so keep the .scad |
| .bgcode → .gcode | PrusaSlicer File → Convert, or Prusa's bgcode command-line tool | Nothing that affects the print |
| .gcode.3mf → .gcode | Unzip and extract Metadata/plate_1.gcode | Thumbnails and slice info |
| G-code → model | Not practical | Everything that matters |
The PrintPal 3D Model Converter runs in your browser with no upload. It reads STL, OBJ, 3MF, GLB, glTF and PLY and writes STL, OBJ, GLB, glTF or PLY. It doesn't write 3MF or STEP: for a 3MF, open the STL in your slicer and save a project. Before and after converting, open the file in the 3D Model Viewer to confirm its size and shape.
Free PrintPal tool3D Model ConverterConvert STL, OBJ, 3MF, GLB, glTF and PLY files to STL, OBJ, GLB, glTF or PLY in your browserOpen toolBefore you share a model: checklist
- Export in millimetres, or use 3MF so the unit travels with the file.
- Open the export in a viewer and check the dimensions match your design.
- Run a mesh check: watertight, manifold, no flipped faces.
- Share a 3MF or STL for printing and a STEP (or the .scad source) for people who want to remix.
- For multicolor prints, share a 3MF with each colour as a separate part or painted region.
- Zip OBJ files together with their .mtl file and texture images.
- Don't share G-code as the model; if you include it, name the printer, nozzle and filament it was sliced for.
- Add the license and print notes: orientation, supports and any tolerances that matter.
Frequently asked questions
What is the best file format for 3D printing?
3MF is the best all-round choice because it stores units, colours, multiple parts and slicer settings in one file. STL is the most widely supported fallback, and STEP is best when someone needs to edit the design in CAD.
What is a 3MF file?
A 3MF file is a ZIP package of XML files defined by the 3MF Consortium. It stores the mesh plus its units, materials and colours, optional thumbnails and, when saved from a slicer, plates and print settings.
Can I convert an STL to STEP?
Yes, tools like FreeCAD and Fusion can convert a watertight STL into a STEP solid, but the result is faceted: every triangle becomes a flat face. You can measure it and use it as a reference, but you cannot edit its original features, so remodelling is often the better option.
What is the difference between STL and OBJ?
STL stores only triangles. OBJ can also store polygons, texture coordinates and normals, and links to an MTL file for materials and colours. Neither format records units.
Can I open a G-code file in CAD?
Not usefully. G-code is a list of toolpaths, temperatures and speeds for one specific printer, not a 3D model, so you cannot recover clean editable geometry from it. Keep your STL, 3MF or STEP files as the source.
Related articles
Sources & further reading
- 3MF Consortium — 3MF specifications (core and extensions)
- ISO — ISO 10303-1:2024, STEP overview and fundamental principles
- ISO — ISO/ASTM 52915:2020, Additive Manufacturing File Format (AMF)
- Library of Congress — STL (STereoLithography) File Format, Binary
- Prusa Knowledge Base — Binary G-code
- Bambu Lab Wiki — Bambu Studio quick start (exporting sliced files)
Tools for thisAll tools
Watch it doneVideo library
Thanks! We read every note and use them to decide what to update next.