How to reduce GLB file size
Start by comparing a few controlled exports. File size and triangle count describe different things: the same mesh can have a tiny texture or several large images. This guide helps you decide what to change first; the linked guides cover the individual settings.
1. Save a baseline
Keep the original GLB. Run the Conservative preset without reducing triangles or converting textures, then save the output and command. Record bytes and triangle counts for both files. Always start later trials from the original, so you can attribute each difference to the setting you changed.
2. Compare geometry compression before removing detail
Try the Smaller file preset with original textures. It enables Meshopt compression without requesting triangle reduction. If this gives enough savings and your viewer supports the output extensions, you may not need to reduce triangles at all.
| Ripple sample | File size (bytes) | Triangles |
|---|---|---|
| Original | 186,756 | 8,192 |
| Conservative preset | 119,120 | 8,192 |
| Smaller file preset | 39,248 | 8,192 |
These measurements use our original CC0 ripple sample and native gltfpack 1.3. Its texture is only 16 × 16 pixels, so it mainly illustrates geometry compression. The triangle count stayed unchanged in both exports; that does not mean the optimizer preserved every other property.
3. Test whether textures dominate
A second fixture uses the same geometry with one generated 1024 × 1024 PNG. It starts at 3,061,644 bytes. Meshopt with the PNG unchanged produces 2,914,152 bytes; changing only the texture output to WebP at quality 8 produces 445,632 bytes. All three files contain 8,192 triangles.
For that fixture, changing the texture mattered much more than compressing the mesh. This is a diagnostic example, not an expected saving for every model. A photograph, a normal map and a flat logo will encode differently.
Choose texture compression settings →
4. Stop at a result your application can use
Compare the model at the intended viewing distance, then test loading on a representative device. A smaller download does not automatically mean lower GPU memory use or faster rendering. Keep the smallest version that meets your appearance and compatibility requirements.
Reduce triangles when geometry is still too dense →
Diagnose a result that became larger →
Engine reference: gltfpack
Open the optimizer ↗