OBJ files, and how to convert them
OBJ is the plain text mesh format that every modelling program can read and write. It has been in use since the 1980s, it is trivially easy to parse, and it has one wrinkle that causes most of the trouble people have with it: the materials are in a second file.
.obj · model/obj
OBJ conversions that work today
Convert a OBJ file into something else
Make a OBJ file from something else
Things to do with a OBJ file
OBJ guides
The .mtl file, and why your model is grey
An OBJ file holds points, texture coordinates, normals and faces. It does not hold materials. What it holds is a line naming a companion file — the .mtl — and then references to material names defined inside it. The .mtl in turn names the image files used as textures.
So a textured OBJ is really three or more files that must travel together: the .obj, the .mtl, and every image. Send someone only the .obj and they get correct geometry in flat grey, every time. This is the single most common OBJ problem and it is not a bug in anything.
When you convert an OBJ here and the result keeps textures, you get a ZIP holding all of those files with the references between them already correct. When the target format cannot hold textures at all, you get a single file and the page says so before you start.
What OBJ keeps that STL does not
Named objects and groups, so a model of an assembly stays separable. Material names per face group. Texture coordinates, which is what lets an image be painted onto the surface. Shared points, so the mesh is a real mesh rather than a pile of loose triangles.
What it does not keep is animation, rigging, or a scene graph with transforms. An OBJ is a static shape. If you need bones or movement, GLB is the format to use.
Units, and the metre convention
Like STL, OBJ does not record its units. Unlike STL, there is a loose convention: most exporters write metres, because the format is most used in modelling and rendering where metres are normal.
This is a convention, not a rule, and plenty of files ignore it. A model exported from a CAD program for printing is usually in millimetres. If a converted model comes out a thousand times too large or too small, this is why, and the unit boxes on every converter page are the fix.
What OBJ cannot store
- Animation or rigging — the format has no concept of either
- A scene graph with transforms — every object sits where its points say
- Units, though most exporters mean metres
- Materials inside the file itself — they live in a separate .mtl
- Curved surfaces in practice, though the specification allows them and nothing writes them
OBJ in detail
| Property | OBJ.obj |
|---|---|
| File contents | Plain text, one item per line. Materials live in a separate .mtl file beside it. |
| Geometry | Triangles and polygons. Also stores free-form curves, which almost nothing writes. |
| Units | None. Like STL, the numbers are bare, though exporters usually mean metres. |
| Colour and texture | Material names and texture coordinates, with the materials themselves in the .mtl file. |
| Separate objects | Named objects and groups, each able to carry its own material. |
| Published by | Wavefront Technologies, 1980s, for the Advanced Visualizer. |
| Written by | Blender, Maya, 3ds Max, ZBrush and most modelling programs. |
Questions
- Do I need the .mtl file to convert an OBJ?
- Only if you want the materials or textures to survive. The geometry is entirely in the .obj file, so converting to STL, PLY or OFF needs nothing else. Converting to GLB or 3MF and keeping colour needs the .mtl and the images too.
- Why is my OBJ so much larger than the STL it came from?
- OBJ is text, and text costs space. Against that, OBJ shares its points instead of repeating them, which removes roughly two thirds of the numbers. The two effects roughly cancel for most models, so expect a similar size or a little larger.
- Which programs read OBJ?
- Effectively all of them. Blender, Maya, 3ds Max, Cinema 4D, ZBrush, MeshLab, Unity and Unreal all read it directly. It is the safest format to hand to someone whose software you do not know, as long as you send the .mtl with it.