Vi3W
Skip to content

Guides

How to reduce GLB file size for the web

Most of a GLB is textures. How to shrink one with texture resizing, KTX2, Draco or Meshopt, and simplification, with free tools.

Aman PorwalFounder @ Vi3W

3 min read

A pencil sketch of a brass lantern on paper, with the same lantern rising off the page as a solid, lit object

Quick answer

How do you reduce a GLB file's size?

Start with textures, which are usually most of the file: resize them to what's visible on screen and convert to compressed formats such as KTX2 or WebP. Then compress the mesh with Draco or Meshopt, and simplify geometry if the polygon count is high. Free tools like glTF-Transform, gltfpack and Blender's exporter do all of this.

Find out what's heavy first

Before compressing, look inside. A GLB contains geometry, textures and sometimes animation. Open it in a glTF inspector (glTF-Transform's inspect command, or an online glTF viewer that lists resources) and check:

  • Texture count and resolution. Four 4096×4096 maps can be tens of megabytes.
  • Vertex and triangle count.
  • Number of meshes and materials.

Nine times out of ten, textures are the problem.

1. Resize textures

Ask how big the model appears on screen. A product viewer on a phone rarely needs more than 1K–2K textures; a small icon-sized model needs far less. Shopify's 3D partner checklist, for example, recommends textures at 2K or less.

  • glTF-Transform: gltf-transform resize input.glb output.glb --width 2048 --height 2048
  • Blender: scale images down in an image editor, relink, re-export.

2. Compress textures

  • WebP: smaller than PNG/JPEG at similar quality; supported via a glTF extension.
  • KTX2 (Basis Universal): stays compressed in GPU memory, which also saves memory on phones. Viewers need the KTX2 loader (model-viewer and three.js support it).

glTF-Transform and gltfpack can both convert textures.

3. Compress the mesh

  • Draco: strong geometry compression; needs a decoder in the viewer.
  • Meshopt: fast decoding, good compression, also handles animation.

Both are glTF extensions that model-viewer and three.js read. Blender's glTF exporter has a Draco compression option.

4. Simplify geometry

If the triangle count is high for its on-screen size, reduce it:

Vi3W retopologises every model, so its exports start lighter than raw generations; simplification is usually a final trim.

5. Clean up

  • Remove unused materials, textures and nodes (gltf-transform prune).
  • Merge duplicate materials and meshes where possible.
  • Remove animations you don't use.

A typical command-line pass

With glTF-Transform installed via npm:

  1. gltf-transform inspect model.glb to see what's heavy.
  2. gltf-transform resize model.glb step1.glb --width 2048 --height 2048
  3. gltf-transform webp step1.glb step2.glb (or ktx2 with the KTX tools installed)
  4. gltf-transform meshopt step2.glb final.glb (or draco)
  5. Compare final.glb visually with the original in a viewer.

Or use gltfpack for a one-command optimisation. Always check the result: aggressive settings can blur textures or distort shapes.

Delivery tips

  • Show a poster image while the model loads.
  • Lazy-load models below the fold.
  • Serve with compression and caching headers from your host or CDN.

Embed a 3D model on a website covers the viewer side, and best 3D model format for websites covers why GLB is the right starting point.

Need a web-ready model to start from? Generate it in Vi3W and export GLB.

Last reviewed