Skip to content
3DToolBench

Convert OBJ to GLB

OBJ is two or three files that have to travel together. GLB is one. This tool packs an OBJ and its material file into a single binary you can drop straight into a web viewer, without sending anything to a server.

Drag a 3D file here, or.

This page is set up for OBJ files. Other formats we can read work here too.

The file is read on your own computer. It is never uploaded.

Add a file to switch this on.

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.

Bring the .mtl file too

An OBJ on its own has no colour. The colours live in a companion .mtl file that the OBJ names at the top. Drop both files in together — select them both at once, or drag them in as a pair — and the material colours are read and written into the GLB.

Without the .mtl, the model still converts perfectly well. It simply arrives grey.

Objects stay separate

Unlike STL, GLB can hold several named meshes, so each object in the OBJ stays its own object with its own material. Nothing is merged.

This matters if you plan to do anything with the model afterwards: hide a part, colour one piece differently, or attach a click handler to one object in a web page.

The unwrap is kept. The image files are not, yet

Texture coordinates come across in full. Those are the numbers that say which part of a picture belongs on which part of the model, and they are usually hours of somebody’s work. They are written into the GLB exactly as the OBJ had them, seams and all.

The image files are not carried across, and the reason is on the reading side rather than the writing side. A GLB holds its pictures inside itself, so a GLB converted here keeps them. An OBJ refers to its pictures by filename from the .mtl, and those files are not part of what you dropped in, so there is nothing for the converter to pack. The material colours are read; the images named beside them are not.

Because the unwrap survives intact, relinking a picture at the other end is one drag in Blender or a single line in a glTF editor. The seams, the layout and the coordinates are all exactly where the OBJ had them.

Vertex colours, if your OBJ has them

Some programs — MeshLab and several scanners among them — write a colour for each point directly into the OBJ, as three extra numbers after the x, y and z on every v line. It is not part of the OBJ specification and the format has no official place for it, but enough software writes it that it is worth knowing about.

Those colours are read and written into the GLB as a vertex colour attribute, which glTF does support properly. So a scan exported from MeshLab as a coloured OBJ keeps its colour, even though nothing in the .mtl describes it.

What survives, and what does not

Kept in the GLB file

  • Separate named objects, one mesh each
  • Material colours from the .mtl file
  • The texture coordinates, seams included
  • Rebuilt normals for correct shading

Lost on the way

  • The image files the .mtl names — an OBJ keeps those beside it, not inside it
  • Specular, bump and other maps from the .mtl

How to convert OBJ to GLB

  1. Drop the .obj and .mtl in together

    Select both at once in the file picker, or drag them onto the page as a pair. Without the .mtl the model still converts, and arrives grey.

  2. Check the object list

    Each named object in the OBJ stays a separate mesh in the GLB. The list under the 3D view shows them, and you can isolate one to check you have the right file.

  3. Set the input unit to what the OBJ actually used

    Most exporters write OBJ in metres, which matches glTF, so the default is often already right. A CAD export for printing is more likely millimetres.

  4. Set the output up axis to Y

    glTF is Y-up. OBJ usually is too, so this often needs no change — but check the marker in the corner of the 3D view rather than assuming.

  5. Download the .glb

    One binary file with the geometry, the material colours and the texture coordinates inside it. Any picture the .mtl named has to be relinked at the other end.

OBJ and GLB compared

OBJ and GLB compared, row by row
PropertyOBJ.objGLB.glb
File contentsPlain text, one item per line. Materials live in a separate .mtl file beside it.One binary file: a small header, the same JSON as glTF, then all the buffers and images.
GeometryTriangles and polygons. Also stores free-form curves, which almost nothing writes.Triangles, with skinning weights and animation channels alongside them.
UnitsNone. Like STL, the numbers are bare, though exporters usually mean metres.Metres, fixed by the specification.
Colour and textureMaterial names and texture coordinates, with the materials themselves in the .mtl file.Full physically based materials, with the texture images packed inside the file.
Separate objectsNamed objects and groups, each able to carry its own material.A scene graph of named nodes, each with its own position and rotation.
Published byWavefront Technologies, 1980s, for the Advanced Visualizer.The Khronos Group, 2015, as the single-file packaging of glTF.
Written byBlender, Maya, 3ds Max, ZBrush and most modelling programs.Blender, Sketchfab, Substance Painter, and every tool that ships models to the web.

Questions

How do I include the .mtl file?
Select both files at the same time in the file picker, or drag them onto the page together. The tool reads the material file the OBJ names and uses the colours from it.
Will my textures come through?
The texture coordinates will, and so will the material colours. The image files will not: an OBJ refers to its pictures by name as separate files, and those files are not part of what you dropped in. Because the unwrap survives exactly as it was, linking the picture again at the other end takes a moment rather than an afternoon.
GLB or glTF for a website?
GLB. It is a single file, so there is one request and nothing to lose. Use .gltf only if you need to edit the JSON by hand.
My OBJ came from MeshLab with colours baked into the points. Do those survive?
Yes. Those are vertex colours written as extra numbers on each v line, and glTF has a proper place for them. They are read and written into the GLB.

Where to go next