OBJ to GLB converter

Turn an OBJ and its material file into one GLB for a web page, AR or a game engine. The colors are kept, and the size is stated in meters.

60 mm40 mm30 mm

Drop an OBJ file anywhere on this pageChoose an OBJ file to convert it

Nothing is uploaded. Drop the MTL with the OBJ to keep its colors. Textures are not carried over.

The OBJ to GLB converter with a bracket open: an L-shaped part with three holes, a size of 60 × 30 × 40 mm, a check mark at Watertight, and a Download GLB button with links for STL, 3MF, glTF and PLY.
The sample bracket, ready to save as one GLB at its real size in meters.

What the GLB keeps, and what it loses

In the GLB
ShapeEvery triangle, with its corners shared. Faces with more corners are cut into triangles
ColorsA material for each color of the material file, up to 32. More than that, as from a scan, as the colors of the vertices
ShadingThe OBJ's normals, when every corner has one
SizeMeters, from the unit you choose for the OBJ
Which way upY up, as the model stands on screen
Object and group namesLost: a mesh for each color instead
TexturesLost

How to convert an OBJ to GLB

  1. Drop the OBJ on this page with its material file, or a ZIP of its folder, or choose them with the button. They are read in your browser; nothing is uploaded.
  2. Look at the model in its colors. If it lies on its back, choose Z points up in the Views menu.
  3. Under Units, choose the unit the model was drawn in.
  4. Choose Download GLB. The file is named after the OBJ: lamp.obj becomes lamp.glb.

Colors and materials

An OBJ keeps its colors in a material file that it names on a mtllib line. Each material has a diffuse color (Kd), and each face of the OBJ says which material it is in. The converter gives the GLB a material for each color that the faces use, and puts the faces of each color in a mesh of their own, so a program that opens the GLB can change one color without the others. The material is matte, with no metal in it, which is what a diffuse color describes.

A material file can also name pictures, for the color, the bumps or the shine of a surface. Those are not read: the GLB has the materials’ colors only. An OBJ may also give a color with each vertex, as scanners write it; such colors are kept, as materials when there are few and otherwise as the colors of the GLB’s vertices.

Size and orientation

glTF is in meters with Y up, and every program that reads a GLB knows it, so a GLB arrives at its real size and the right way up without a setting. An OBJ states neither. The converter takes the unit you choose under Units and the way up you see in the viewer, and writes the GLB from them: a part 80 mm long is 0.08 in the GLB, and a program that shows it in centimeters says 8 cm.

GLB, glTF or OBJ

  • GLB is one file, for a web page, AR on Android, or a game engine such as Godot.
  • glTF is the same as text, with its geometry in a .bin file beside it, for editing by hand or by script.
  • OBJ stays the format nearly every older program reads.

The STL, 3MF, glTF and PLY are saved from the links under the button.

Questions

Is my file uploaded?

No. The OBJ and its material file are read and the GLB is written by your own browser. Nothing is sent to a server.

How do I keep the colors?

Drop the OBJ together with its material file (.mtl), or a ZIP of the folder they are in. The panel says when the OBJ names a material file that was not dropped with it. Each color becomes a material of the GLB.

Are the textures kept?

No. The materials' colors are, but not the pictures an OBJ's material file names, which this page does not read yet. A model whose look is all in its texture arrives in its materials' plain colors.

What size is the GLB?

The real size, in meters, which is the unit glTF uses. An OBJ has no unit of its own, so choose the one it was drawn in under Units: a model in millimeters becomes a GLB a thousand times smaller in number and the same size in the world.

Which way up is it?

As the model stands in the viewer, which takes an OBJ to stand on Y, as glTF does. An OBJ from a CAD program may stand on Z: choose Z points up in the Views menu, and the GLB is turned to stand on Y.

Are the object names kept?

No. Each color becomes a mesh of its own in the GLB, named after the file with a number for each color, and the names of the OBJ's objects and groups are not kept.