STL vs. OBJ: Which Should You Use?

Posted on
3D Insider is ad supported and earns money from clicks, commissions from sales, and other ways.

The world of 3D printing has seen huge growth in the last couple of years, with professionals and hobbyists alike discovering more and more possibilities for the technology. Along with evolution, 3D printing technology has also undergone some diversification. There’s now a huge variety of 3D printers, different filament materials, and various techniques and accessories that expand the capabilities of 3D printing.

In recent years, the file formats used for 3D printing has also seen some variety. However, two file formats stand supreme: STL and OBJ. What’s the difference between the two? Read on as we take a detailed look at the intricacies of the STL and OBJ file formats and determine which format will work best for you.

What is a 3D file format?

A 3D file format is just like any file format, in that it stores information in a manner that can read and modified by a 3D processing software. The information in each 3D file is stored in either plain text or binary formats, and typically include details on the model’s appearance. The level of richness or detail of information depends on the specific file format. Some file types merely describe the shape of a model, while others can contain information on colors and textures, as well as scene-related information such as the direction of light sources.

Right now, there are hundreds of file formats used in the 3D modeling industry. Each CAD software manufacturer, such as AutoCAD or Blender, has its proprietary format. There are also industry-standard formats that can be converted between different proprietary formats and opened in different CAD software platforms. Called “neutral” or “open-source” file formats, these file types solve the problem of interoperability limitations that have come up due to proprietary file formats.

By using neutral file types, it becomes much easier for 3D printing professionals to collaborate, whatever software platform they may be using. STL and OBJ are two of the most popular neutral 3D modeling file types used today, although there are a lot more, such as COLLADA, IGS, and STEP.

What is STL?

Let’s start our discussion with STL, as it is undoubtedly the simpler of the two. STL is also vastly more popular in 3D printing, for reasons we shall see later on. STL stands for “Stereolithography” and is a native file format to the stereolithography CAD software platform that was developed by 3D Systems. Being one of the oldest 3D file formats, STL was developed in the 1980s as a way to transfer data from 3D CAD models to a 3D printer quickly and simply.

One of the main characteristics of an STL file is that it encodes the surface of the 3D object into a triangular mesh. Think of it approximating a smooth surface using a series of very small and non-overlapping triangles. Known as a tessellated format, this method of encoding a smooth surface is the most commonly used in the 3D modeling field because of its simplicity and versatility.

The resolution of an STL file can be improved by decreasing the triangle size of the surface encoding. However, this also means that approximating the surface will require a higher number of triangles. As expected, a higher resolution model comes at the price of a larger file size. Even at the highest resolution possible, file formats that use approximate surface encoding still have lower fidelity than formats that use precise surface encoding.

Tessellated formats are vastly preferred in the 3D printing and rapid prototyping fields, as most 3D printers are also limited in the resolution or fidelity that they can print. Being one of the simplest and leanest 3D file formats available, the STL format is widely compatible with almost all 3D printing software platforms. In fact, there are some 3D slicers that read-only STL files.

One limitation of the STL file format is that it does not contain information beyond the geometry of the 3D model. Thus, aside from the size and shape of the model, an STL contains no other information. If you want to preserve information on the texture and color of your 3D model, then converting it to STL is not the way to go.

Another downside of STL files is that it can be very hard to modify a 3D model that has already been encoded in STL.  Since an STL file only contains an approximate version of the original model’s actual surface, it is often easier to re-model the original object rather than to attempt to modify an STL file. However, this limitation is also the reason why most models shared for 3D printing online are in STL format. By encoding the surface in a tessellated format, the 3D model can no longer be modified, and only the original modeler has access to a fully modifiable version.

However, the new generation of 3D printers may lead to a decline in the popularity of the STL file format. Modern high-fidelity and multi-color printers may now utilize the increased resolution and texture data of more sophisticated 3D file formats. This level of 3D printing technology isn’t quite popular yet, but the next few years could prove to be revolutionary for the field of 3D printing.

What is OBJ?

The OBJ file format was developed by Wavefront Technologies Inc. for their Advanced Visualization animation package. Despite STL being the more popular format for 3D printing, OBJ is still the universal format used for the wider field of 3D modeling. Aside from slicers, various other modeling programs such as CAD software and game engines recognize the OBJ file format.

In contrast to STL, OBJ is much more complex. Aside from preserving the shape of the model, an OBJ file also contains information on its geometry, texture, and the original mesh it was created with. An OBJ file can support approximate encoding of the surface, similar to STL, but can also have a precise mesh. Approximate surface encoding in OBJ is not limited to just triangular segments. Depending on the user, the surface of the OBJ model can be encoded using various polygons, such as quadrilaterals or hexagons. The result is a smoother mesh that better simulates the original surface.

The ability of OBJ files to support precise mesh surface encoding is one of its greatest strengths. With a precise mesh, the surface of a model does not need to be defined by discrete facets or units. Instead, the surface can be defined by Non-uniform Rational B-spline (NURBS) patches. Instead of discrete shapes, this type of surface is anchored by “knots” – points from which smooth splines are interpolated. The result is a surface that looks smooth no matter what scale you view it. If you want to create a 3D model with highly accurate details, then you should go for precise mesh encoding. The downside, as you might have expected, is that a high-resolution OBJ file takes much longer to render and has a larger file size.

An OBJ file can also come with a texture map, which is basically a 2-dimensional image that can be wrapped around your 3D object to give it texture or color. Color and texture information can also be stored as face attributes. If you have ever encountered an OBJ 3D model, then you might have noticed that it comes with either a PNG file (the texture map) or an MTL file (the face attributes).

Although OBJ is a much more flexible file format, its size and complexity have limited its popularity in the field of 3D printing. However, with full color and high-fidelity printing on the horizon, the use of the OBJ file format is expected to get much wider.

Which one should you use?

With the knowledge of the strengths and limitations of each file format, we can now determine the best use cases for each one.

 1. Use STL for…

  • …quick sharing of models exclusively for 3D printing. STL files are much smaller and less complex. Practically all slicer software platforms are capable of opening STL files, with some versions designed to open ONLY STL.
  • …publishing your models in a public platform such as Thingiverse. With an STL file, anyone can download and print your model, but modifying it will be so impractically difficult. Of course, this is under the assumption that you don’t want you model to be modified by anyone.

 2. Use OBJ for:

  • …sharing of models for collaborative work. With an OBJ file, your original model if open for modification or improvements, either for your colleagues or even for the general public. Best of all, an OBJ file is cross-compatible with different CAD software platforms.
  • …if you need to publish the model in a format that preserves its original mesh and other texture data. In addition to being open to modification, the preservation of texture data can be crucial for high-resolution or full-color 3D printing.
  • …saving a model for later modification. If you’re working on a 3D modeling project which you think you’ll want to improve on later, then you will have to store in the OBJ file format.
  • …exporting a model for use in animation or a game engine. These are highly specialized applications of 3D modeling. The visual appeal that is typically desired for games or animations can only be achieved by preserving texture mapping in the model.

Final thoughts

Most people who are into 3D printing nowadays are probably very familiar with the STL file format. After all, a vast majority of the free 3D models available online are encoded in STL. While it’s lean file size and relative simplicity are great for quick distribution of models, STL files are severely limited in the richness and resolution of information that it can contain.

We’re not knocking on the usefulness of STL files. The popularity of 3D printing nowadays was probably borne out of the shareability of STL models. However, we think that OBJ files are the future of 3D printing. With the capability to preserve texture data as well as precise mesh encoding, OBJ files provide an opportunity to explore full-color 3D printing. For those who are interested in modifying or creating their own 3D models, the OBJ file format is the only way to go.

Warning; 3D printers should never be left unattended. They can pose a firesafety hazard.