OBJ vs STL vs PLY vs OFF vs glTF
Five mesh formats that look interchangeable and are not. The difference that matters is what each one can carry besides the shape.
At a glance
| Format | Text or binary | Polygons | Colour | Texture coords | Normals |
|---|---|---|---|---|---|
| STL | both | triangles only | no | no | per facet, recomputed |
| OBJ | text | any polygon | extension | yes | yes |
| PLY | both | any polygon | yes | yes | yes |
| OFF | text | any polygon | yes (COFF) | yes (STOFF) | yes (NOFF) |
| glTF / GLB | JSON / binary | triangles only | yes | yes | yes |
STL — geometry and nothing else
An STL file is a bag of triangles. Each one stores three corner positions and a facet normal, and that is the entire format. There is no index, so a corner shared by six triangles is written out six times; a binary STL is therefore about three times larger than an equivalent PLY of the same model.
It has no colour and no texture coordinates. Anything you convert to STL loses those permanently. What it has going for it is that every 3D printer, slicer and CAD package on earth reads it.
OBJ — text, readable, universal
OBJ lists vertices, then faces that reference them by number. Faces may be quads or larger polygons, which matters for modelling: a quad mesh stays a quad mesh. Texture coordinates and normals get their own independent numbering, so one position can appear with several different texture coordinates — useful for a UV seam, and the reason an OBJ with textures often expands when converted to a format that allows only one attribute set per vertex.
Vertex colour is not in the original specification. The widely-supported convention is three extra numbers on the v line, which is what our converter reads and writes.
PLY — the one that carries everything
PLY was designed for scanner output, so it is built around arbitrary per-vertex properties: position, normal, colour, intensity, confidence, whatever the scanner produced. It comes in ASCII and in binary, little- and big-endian. Binary PLY is the most compact way here to store a coloured mesh, and the natural target when you want to keep everything a scan gave you.
OFF — the academic one
OFF is a counts line followed by vertices and faces, and that simplicity makes it common in geometry-processing research and course material. The COFF, NOFF and STOFF variants add colour, normals and texture coordinates by prefixing the header keyword.
glTF and GLB — for the web and for engines
glTF is a scene format, not just a mesh format: it stores a node hierarchy with transforms, materials, cameras and animation. GLB is the same thing packed into a single binary file. Geometry is triangles only, and positions are 32-bit floats by specification — so a survey-scale model far from the origin loses precision that PLY with 64-bit coordinates would keep.
Because a glTF holds a whole scene, converting one to a plain mesh format means flattening it: every mesh in the scene is placed by its node transform and merged into a single object. That is what our mesh converter does.
Which should I pick?
- 3D printing — STL, or OBJ if your slicer prefers it.
- Keeping scan colour — binary PLY.
- Sending to a game engine or a website — GLB.
- Editing in a modeller — OBJ, so quads survive.
- Smallest file for the same triangles — binary PLY or GLB; STL is the largest by a wide margin.
Convert between them
The mesh converter reads all five and writes all five, in your browser, without uploading anything.