OBJ to GLB: A Practical Guide for Web and AR

·11 min read

OBJ is the lingua franca of 3D. Every DCC on Earth reads and writes it, from Blender to ZBrush to a dusty copy of Maya 4. It was invented at Wavefront Technologies in the 1980s, back when 3D meant film VFX and SGI workstations, and it has barely changed since. That longevity is why it's still everywhere — and also why it's a poor fit for the modern web.

OBJ is a plain-text ASCII format. It has no animation, no PBR materials, no compression, no scene graph, no cameras, no lights. It stores every vertex as text: v 1.234 5.678 9.012, one per line. A modern 3D asset with a hundred thousand vertices is a five-megabyte text file before you've even added textures. For the web, where every kilobyte costs someone battery and cellular data, that's a problem. GLB fixes it.

What OBJ actually contains

  • .obj — geometry: vertices (v), texture coordinates (vt), normals (vn), and faces (f).
  • .mtl — material sidecar: diffuse color (Kd), specular (Ks), transparency (d), and texture paths (map_Kd, map_Bump).
  • textures — image files referenced by relative path in the .mtl.

A converter needs all three to reconstruct the model faithfully. If you're uploading an OBJ that references a missing MTL, the result will be untextured. If the MTL points to ../textures/wood.jpg and the textures folder isn't included, the same thing happens. When in doubt, zip the whole folder before converting so nothing gets lost.

OBJ to GLB: what changes

  • Materials get upgraded. The legacy MTL diffuse/specular gets mapped to glTF PBR base color and a sensible default roughness. The result isn't magically physically correct — you started with a non-PBR asset — but it renders correctly in modern viewers.
  • Geometry gets packed. ASCII vertices become tightly packed float32 buffers. A 40 MB OBJ commonly becomes a 6 MB GLB before any additional compression.
  • Textures get inlined. All referenced images are embedded in the GLB, so the file is self-contained.
  • Indices get deduplicated. OBJ stores separate indices for position, UV, and normal, which most GPUs can't render directly. GLB unifies them into a single index buffer.
  • Normals get generated when the OBJ doesn't include them, or preserved when it does.

Size wins

A 40 MB OBJ + MTL + textures folder typically becomes a 6–12 MB GLB before compression. With Draco geometry compression on top, expect another 3–5x reduction on the geometry portion. Textures compress further with KTX2 if your target viewer supports it. Total savings on a typical furniture or product asset land in the 80–95% range compared to the original OBJ bundle.

AR and web viewers

model-viewer, three.js, Babylon.js, PlayCanvas, Apple Quick Look, and Android Scene Viewer all accept GLB directly. None of them read OBJ without a userland loader that you have to ship yourself, adding bundle size and a second parsing pass. If you're building for the web or AR, converting to GLB is not an optimization — it's the practical default.

Common issues and how to fix them

  • Flipped normals. Some DCCs export inverted winding order, causing faces to appear inside-out. Recalculate normals in your DCC before exporting, or flip them in the viewer as a last resort.
  • Missing UVs. Check that your OBJ has vt lines. Without UVs, textures can't be applied and the model will render as flat-shaded base color.
  • Multiple materials. OBJ groups (g or usemtl) become GLB primitives; make sure your DCC exports groups instead of collapsing everything into one mesh.
  • Non-triangular faces. OBJ supports n-gons; GLB does not. Triangulate before export for predictable topology.
  • Massive files. If your OBJ is over 100 MB, decimate before converting. GLB will shrink it, but the browser still has to parse the source first.
  • Wrong scale. OBJ has no unit convention. If your model imports at the wrong size, check your DCC's export scale.

Convert in the browser, keep your files

3D Model Converter processes OBJ files entirely on your device using WebAssembly. There's no upload, no queue, and no server-side storage. For client work, NDA'd assets, or anything you'd rather not hand over to a third party's servers, that matters. Drop the OBJ (with its MTL and textures), get a GLB back, ship it.

Ready to convert? Convert OBJ to GLB