9 min read

What is a GLB file? How to open, check and use one

A GLB file is a 3D model in binary glTF 2.0: what is inside it, how to open it on any device, how to make it smaller, and where it is used.

By Jorge Rodríguez

On this page

A GLB file is a 3D model saved in the binary version of glTF 2.0, an open format from the Khronos Group. One .glb file holds the shape, materials, textures and any animation, so it loads on the web without extra files. It is the usual format for 3D on product pages and for AR on Android.

Illustration of a celadon teapot, the left half in real glaze and the right half in matte grey clay under a white wireframe mesh whose UV panels peel away from the body, on a dark background
Illustration, not an easyrender result: a teapot drawn half as glaze, half as a wireframe mesh with its UV panels peeling off.

What is inside a GLB file?

A glTF model can come as a .gltf text file plus separate texture images and a .bin file for the geometry. A GLB packs all of that into one binary file, which is easier to upload, email and host. The glTF 2.0 specification defines both.

The layout is simple. A 12-byte header holds the word glTF, the version number 2 and the total length of the file. Then come two chunks: a JSON chunk that describes the scene, and a binary chunk with the geometry and the images.

We check those three header fields on every model we deliver. A file that does not start with glTF, is not version 2, or whose stated length differs from its real length is rejected as broken before anyone downloads it, and so is anything under 20,000 bytes.

Inside the clay vase GLB further down this page, read from the file itself: 301 KB in all. With a 1024-pixel WebP texture, most of the bytes are geometry.

The numbers in that diagram add up exactly, and the arithmetic is worth knowing. The vase has 14,590 triangles, and each one names its three corners with 2 bytes apiece: 87,540 bytes of indices. Its 8,406 vertices each store a position and a texture coordinate in 20 bytes: 168,120 bytes.

How big are real GLB files, and where do the bytes go?

We read every model on our showcase the same way. All six are one mesh with one material and a 1024-pixel WebP colour texture, packed for the web. The bouclé armchair, swivel chair, stoneware vase and two tables also have 512-pixel roughness and metallic maps to describe their different surface finishes.

ModelFile size (bytes)TrianglesTexture (bytes)Share that is geometry
Clay vase308,44814,59051,35483%
Stoneware vase400,79216,708116,21471%
Round coffee table326,87216,22838,03888%
Swivel armchair680,93624,268218,39468%
Bouclé armchair622,80425,879142,23677%
Bedside table1,302,80469,91055,77096%

The usual advice is that textures are the heavy part of a GLB. That is true for a file with 4096-pixel PNGs. Once the texture is a 1024-pixel WebP, as here, the uncompressed geometry is 68% to 96% of every file, and the triangle count decides the size.

What do the materials in a GLB describe?

Materials follow the PBR metallic-roughness model. PBR, physically based rendering, describes a surface by its base colour, how metallic it is and how rough it is. That is why the same GLB looks much the same in every viewer that follows the standard.

The single texture image inside the clay vase GLB: the surface of the vase cut into patches and laid flat, rings of whitewashed clay, the rim and the base
The base colour texture inside that GLB, copied out of the file unchanged, 1024 by 1024 pixels. The texture coordinates tell the viewer which patch wraps onto which part of the vase.

Every value a material leaves out falls back to a default in the spec, and one of them catches people out. An unset metallic value means 1, fully metallic, so a material that sets only a base colour is drawn as rough metal. Clay, wood and fabric can then look darker or tinted.

The check is one setting: Metallic at 0 on the material in Blender, then export again. We would make that check on any GLB before it goes on a product page, whoever made it.

Why can a GLB look faceted?

Vertex normals are the per-corner directions a viewer uses to shade a curved surface smoothly. They are optional in glTF, so a file can hold positions and texture coordinates only.

The spec covers that case: when normals are not given, viewers must calculate flat ones. On a dense mesh the facets are small, but under a low side light a curved surface can show faint flat panels.

Normals cost 12 bytes per vertex, three numbers of 4 bytes each, so a mesh of 8,000 vertices carries about 96,000 bytes of them. In Blender, Shade Smooth and an export with Normals ticked writes smooth ones. gltf-transform inspect shows whether a file has a NORMAL attribute.

How do you open a GLB file?

You need a viewer, not a converter. These open GLB files without extra setup:

iPhones and iPads do not open GLB files in AR Quick Look. Apple's AR uses USDZ, so stores that want AR on both systems keep both files.

An aged clay vase as a GLB file, open in Google's model-viewer and ready to turn
A real easyrender GLB of an aged clay vase, open in model-viewer, the component linked above. The file is 301 KB: one mesh of 14,590 triangles and one 1024-pixel WebP texture, packed with glTF Transform.

Once it is open, spin it slowly. Look underneath, behind, and close up at fine details such as handles and stitching.

To see what is inside without a viewer, run gltf-transform inspect from glTF Transform on the file. It lists every mesh, texture and extension, with vertex counts and sizes, so you can check a file against the table above.

What is a GLB file used for?

On product pages, Shopify accepts GLB files as product media. On a site you build yourself, Google's open-source model-viewer component shows a GLB with a short snippet of code, with rotate and zoom built in.

Outside ecommerce, GLB is common in web 3D, games and AR apps, because it is compact, open and read by most 3D software. Blender exports it, and so do most scanning and AI tools.

For AR on Android the file has to fit Scene Viewer's budget: it recommends at most 10 MB, 100,000 triangles and 2048-pixel textures. Every file in the table above is inside it.

How do you reduce GLB file size?

To see what each command does, we ran them on a copy of the bedside table, the model with the most triangles in the table above, with glTF Transform 4.5. The triangle count stays the same unless you simplify.

Version of the bedside tableSize (bytes)Triangles
As shown on this site1,287,43269,910
Geometry compressed with Meshopt (gltf-transform meshopt)422,48069,910
Geometry compressed with Draco (gltf-transform draco)235,77669,910
Simplified to half the triangles (gltf-transform simplify --ratio 0.5)710,07234,954

Draco gave the smallest file, 82% lighter. Meshopt took 67% off, and on the clay vase it took the file from 308,448 to 135,740 bytes. Simplifying alone saved less than either, because the remaining triangles were still stored uncompressed.

Smaller is not free. A viewer has to support the compression: model-viewer and three.js can decode both, but Scene Viewer's documentation lists neither extension. Check a compressed file in every viewer it will meet before it goes on a page.

Our verdict by destination:

  • Your own site with model-viewer: Meshopt or Draco on the geometry and WebP textures, then check the edges for rounding.
  • Android AR through Scene Viewer: a plain GLB with JPEG or PNG textures at 2048 pixels or less, simplified only if it is over 100,000 triangles.
  • Shopify: upload the uncompressed file, since Shopify optimises anything over 15 MB itself.

How do you get a GLB from Blender, a scan or a photo?

In Blender, use File, Export, glTF 2.0 and set the format to glTF Binary (.glb), so the textures travel inside the file. Tick Normals and UVs under Mesh, and pick JPEG for images unless the model needs transparency. Scanning apps and AI tools usually offer GLB as a download.

The routes to a model in the first place, from modelling to a single photo, are compared in how to make a 3D model. For a store catalogue, 3D for ecommerce covers which route suits which product.

easyrender, for example, gives you a GLB and a USDZ for every finished model it makes from one photo, following the steps in how to turn a photo into a 3D model. The model keeps shape and materials, not measurements.

GLB to USDZ: do you need both?

For AR on iPhone and iPad, yes. Apple's Reality Converter, a free Mac app, turns a GLB into a USDZ, and recent versions of Blender export USDZ directly. What a USDZ file is covers the Apple side, including why a USDZ can come out larger than the GLB it is made from.

FileWhat is insideOpens onUse it for
GLBOne binary file: geometry, materials and texturesBrowsers, Blender, Android Scene ViewerProduct pages, web 3D, AR on Android
glTFA JSON .gltf file, a .bin file and separate texture imagesThe same viewers, if the files stay togetherEditing and inspecting, since the JSON is readable
USDZAn uncompressed zip of USD layers and their imagesiPhone, iPad and Mac Quick LookAR on Apple devices

What goes wrong with a GLB, and how do you fix it?

Most GLB problems come from one of a few causes. This is the list we work through, from what you see to what to change.

SymptomCauseFix
The model is plain greyA .gltf saved without its texture files, or an export with images offExport again as binary .glb, so the textures are embedded
The file is tens of megabytes4096-pixel textures, or many of themResize textures to 2048 or 1024 and compress the geometry
Curved surfaces look facetedNo vertex normals, so viewers draw flat onesShade Smooth in Blender and export with normals
Clay or fabric looks dark or tintedMetallic left unset, so the default of fully metallic appliesSet Metallic to 0 and export again
Black patches, or parts seen from insideFaces pointing the wrong wayIn Blender, recalculate normals to point outside
It opens in one viewer and fails in anotherA glTF extension the second viewer does not support, such as Draco or WebP texturesExport a plain version for that viewer
An upload says the file is not validA download cut short, so the stated length does not matchDownload it again and compare the file size

What does a GLB file not tell you?

glTF measures in metres, but a model is only the right size if whoever made it set the size right. A model generated from a photo has no measured size, so keep dimensions in the product text.

A GLB also says nothing about how good the model is. A file can pass the glTF Validator and still have a melted chair leg or a blurry texture, which only a look in a viewer will catch.

FAQ

They are the same format in two packages. glTF can be a .gltf text file with separate texture and geometry files beside it. GLB is the binary version that packs everything into one file. Both follow the glTF 2.0 standard from the Khronos Group, and most tools that read one also read the other.

Not natively in AR Quick Look, which uses USDZ. You can view a GLB in a browser on the iPhone through a web viewer such as the Babylon.js Sandbox. For AR on Apple devices, convert the GLB to USDZ with Apple's Reality Converter on a Mac, or ask your tool for both files.

Open it in Blender, which imports GLB and exports FBX, OBJ, USD and USDZ, among others. Each conversion can lose information: OBJ, for example, has no metallic-roughness materials, so a brass handle may look flat afterwards. Check the converted file in a viewer before you use it anywhere a customer will see it.

Usually large textures, or uncompressed geometry once the textures are small. In our tests, Draco compression took a 69,910-triangle model from 1,287,432 bytes to 235,776. Resize textures to 2048 or 1024 pixels, compress the geometry with glTF Transform, then check in a viewer that the surfaces still look right.

Usually the textures were never exported: a .gltf model repackaged without its texture files, or a tool that exports geometry only, gives a plain grey shape. Re-export as binary .glb so the textures are embedded. If it looks right in the Babylon.js Sandbox but not in one app, that app is the problem.

All guides