Convert STL to OFF
OFF is about the simplest mesh format there is: a count line, a list of points, a list of faces. It turns up constantly in geometry courses, in CGAL, and in research code that would rather not depend on a parsing library. This tool writes one from an STL in your browser.
Drag a 3D file here, or.
This page is set up for STL files. Other formats we can read work here too.
The file is read on your own computer. It is never uploaded.
Your file is read by your own browser and never sent to a server. There is no upload, no account and no copy of your model anywhere but on your computer.
Why the point list matters here
An STL repeats every corner for every triangle that touches it. Written out as OFF without thinking, a cube would come out with thirty-six points instead of eight, and every piece of code that walks the mesh — edge traversal, curvature, Laplacian smoothing, anything at all — would give the wrong answer, because none of the triangles would appear to be neighbours.
So duplicate points are joined before the OFF is written. The result has one point per position and faces that index into it properly, which is what makes the file useful for the kind of work OFF is used for.
What OFF stores
Points and faces. No normals, no materials, no units. There is an extension called COFF that adds a colour per point, and that is written automatically when the source has colours — an STL never does.
Faces in an OFF may have any number of corners. The file written here uses triangles only, which every reader accepts and most tools prefer.
The file is plain text
You can open the result in any text editor and read it. That is the point of the format and the reason it is used for teaching.
It also means the file is large. A model that is 4 MB as a binary STL is somewhere around 10 MB as OFF. If the size is a problem, the model is probably too detailed for whatever you are about to do with it anyway.
The header word tells the reader what is in the file
The first line of an OFF file is a word, and that word declares the format of everything after it. Plain OFF is positions and faces. COFF adds a colour per vertex. NOFF adds a normal per vertex. 4OFF uses four-dimensional points, which turns up in mathematical work and nowhere else. There are combinations too — CNOFF has both colour and normals.
The file written here says OFF, because an STL carries neither colour nor usable per-vertex normals and declaring properties that are not present is how you produce a file that fails to parse. A reader that sees OFF knows precisely what to expect on every following line: one count line, then that many points, then that many faces.
Using the result with CGAL
CGAL reads OFF directly into a Surface_mesh or a Polyhedron_3, and this is the most common reason people want the format. Both of those data structures are half-edge based, which means they need to know which triangles are neighbours — and that only works if the points are shared.
This is why the welding step matters more here than in almost any other conversion on this site. An OFF written straight from STL triangles parses perfectly and then fails every algorithm you run on it, because the mesh has no connectivity at all. Loading such a file into a Polyhedron_3 typically throws, because the result would not be a valid half-edge structure.
What survives, and what does not
Kept in the OFF file
- The exact shape
- A clean list of shared points, one per position
- Consistent face winding
Lost on the way
- Normals — OFF has no place for them
- Nothing else: an STL holds only triangles
How to convert STL to OFF
Drop the .stl file in
Binary or ASCII, either is read. The 3D view confirms you have the file you meant.
Let the points be welded
Automatic, and essential for this format. Without it the faces index into a point list where nothing is shared, and every half-edge algorithm fails on the result.
Check the counts beside the 3D view
For a closed model, Euler tells you to expect roughly half as many points as triangles. If the point count is three times the triangle count instead, the corners did not meet and nothing welded.
Download the .off
A plain text file: the word OFF, a line of three counts, then the points and the faces. No units, no colour, no normals, because the source had none of them.
STL and OFF compared
| Property | STL.stl | OFF.off |
|---|---|---|
| File contents | Binary or plain text. Binary is an 80-byte header, a triangle count, then 50 bytes per triangle. | Plain text. The word OFF, three counts, then the points and the faces. |
| Geometry | Triangles only. Curves are approximated when the file is made, and cannot be recovered. | Polygons of any number of sides, from a shared point list. |
| Units | None. The file stores bare numbers, and every reader has to guess what they mean. | None recorded. |
| Colour and texture | None. There is no place in the format for a colour, a material or a texture. | Optional colour per face, rarely used in practice. |
| Separate objects | One body. Several parts written into one STL become one undivided lump of triangles. | One mesh, with no names or grouping. |
| Published by | 3D Systems, 1987, for the first stereolithography machines. | Princeton and the Geometry Center, for academic geometry work. |
| Written by | Every CAD program and every slicer, as the common denominator. | Geometry research code, CGAL and university course tools. |
Questions
- Will CGAL read this file?
- Yes. It is plain OFF with a triangle-only face list, which is what CGAL’s readers expect.
- Why is the OFF file so much bigger than the STL?
- OFF is text and binary STL is not. Every coordinate becomes a string of digits. The shape is identical.
- Can I get colours in the OFF?
- Only if the source has them, in which case a COFF file is written. An STL has no colour, so this conversion produces plain OFF.
- Why does my OFF file fail in CGAL?
- Usually because the mesh is not a valid half-edge structure — it has unshared points, or it is non-manifold at an edge. The point and open-edge counts on this page tell you which before you compile anything.
- Can I get a coloured OFF file?
- Only from a source that has colour. The COFF variant stores a colour per vertex and is written automatically when the input carries one — but an STL never does.
Where to go next
Other things to do with a STL file
Related guides and tools
- Gridfinity generatorBins and baseplates, any size, built in the browser
- Turn text into an STLType a word and print it, without drawing anything
- Turn an image into an STLA photo or a logo, turned into something you can print
- Lithophane generatorA photo printed as thickness, lit from behind
- Repair an STL that will not sliceClose the holes and separate the bad edges so a slicer accepts it
- STL to G-codeGuide
- How to convert an STL file to G-codeGuide