What the compressor does
A glTF model is made of three things that cost bytes: geometry (vertex positions, normals, texture coordinates and the triangle list), textures (the images for colour, normals, roughness and the rest) and a small JSON description that ties them together. In most models exported from Blender, a scan or a CAD tool, textures are by far the largest part. This tool reads your .glb or .gltf in the browser, runs the steps you tick, and writes one optimised .glb. It measures the file after every step, so you can see which one paid off, and shows the original and the result side by side so you can check nothing broke.
When to use it
- Before putting a model on a landing page or product page. A hero model should be visible within a second or two on a phone, which usually means a file under 2 to 5 MB.
- When a model from a scan, a marketplace or a CAD export weighs tens of megabytes.
For GPU-compressed KTX2 textures, which also cut GPU memory, use the command line shown below.
Recommended settings
- Texture size: 2048 for an object that fills the screen, 1024 for objects in a grid or a wider scene, 512 for small props. Each halving removes about three quarters of the pixels.
- WebP quality: 80 to 90. Colour textures hold up well at 80. Normal maps show blocks and banding sooner, so keep 85 or more if the camera gets close.
- Meshopt compression: on. Geometry usually shrinks by 60 to 80 percent, and the decoder is a small script that ships with three.js.
- Quantise only: use it when you can’t add a decoder. Geometry roughly halves and any loader that supports KHR_mesh_quantization reads it.
- Weld, dedupe and prune: on. They don’t change how the model looks.
- Simplify: only for dense meshes such as scans and sculpts. Start at 50% and compare the two previews up close.
Trade-offs
WebP makes the download smaller, but the GPU still holds every texture as uncompressed pixels, so GPU memory stays the same at the same resolution; only a smaller size or KTX2 reduces it. Lossy WebP can soften fine detail. Quantisation rounds positions to a 14-bit grid per mesh: invisible on screen, but not for exact engineering dimensions. Meshopt needs a decoder in the loader. Simplification removes triangles for good and can tear UV seams or skinned meshes, so the tool leaves it off by default.
Step by step
- Drop a .glb, or a .gltf with its .bin and texture files. You can drop the whole folder.
- Check what’s inside: triangles, meshes, materials, and each texture with its size in pixels and bytes.
- Choose a texture size and format, the geometry compression and the clean-up steps.
- Press Optimise model. The table shows the file size after each step.
- Orbit either preview; both follow. The line under them compares mesh counts and bounding boxes.
- Download the .glb and copy the loader code. It already includes the decoder your options need.
The same with the command line
glTF-Transform, the library this page runs, has a command-line version. This matches the default options here. optimize also joins meshes, simplifies and makes instances by default, so the extra flags turn those off:
npx @gltf-transform/cli optimize input.glb output.glb \
--compress meshopt --meshopt-level medium \
--texture-compress webp --texture-size 2048 \
--simplify false --join false --instance false --palette false
Or one step at a time, which makes it easy to see what each step does:
npx @gltf-transform/cli dedup input.glb step1.glb
npx @gltf-transform/cli weld step1.glb step2.glb
npx @gltf-transform/cli prune step2.glb step3.glb
npx @gltf-transform/cli resize step3.glb step4.glb --width 2048 --height 2048
npx @gltf-transform/cli webp step4.glb step5.glb --quality 85
npx @gltf-transform/cli meshopt step5.glb output.glb --level medium
The CLI also writes KTX2 textures (uastc and etc1s), which the browser tool doesn’t. Load those with KTX2Loader as well.
How this tool works
glTF-Transform 4.5.1 reads the files into a document in memory. Dedupe, weld, prune and quantise are its own functions; simplification and meshopt use meshoptimizer 1.3.0 compiled to WebAssembly. Textures are decoded with createImageBitmap, resized on a canvas with high-quality smoothing and encoded with the browser’s own WebP encoder, one at a time so only one image is decoded at once.
FAQ
Is my model uploaded?
No. The files are read and processed by your own browser and never leave your device. The page only downloads its own code and the open-source libraries it runs (glTF-Transform, meshoptimizer and three.js) from a public CDN.
Which files can I drop?
A single .glb, or a .gltf together with the .bin and texture files it points to. You can select them all at once or drop the folder. Textures can be PNG, JPEG or WebP. KTX2 textures are kept as they are. Draco-compressed files can’t be decoded here; export them again without Draco or use the CLI.
Do I need a decoder to load the result?
Only if you tick meshopt compression. Then GLTFLoader needs MeshoptDecoder, which ships with three.js, and the loader code on this page sets it up. Quantised geometry and WebP textures load with a plain GLTFLoader.
Why are my textures still the biggest part?
Texture size matters more than format. A 4096 × 4096 texture holds four times the pixels of a 2048 one. Lower the maximum size first, then the WebP quality. For a model that fills the screen, 2048 is usually enough.
Does WebP save GPU memory?
No. WebP and PNG are decoded to the same uncompressed pixels on the GPU, so they only make the download smaller. To cut GPU memory as well, use KTX2 (Basis Universal) textures with the CLI’s uastc or etc1s commands.
Can I use the output commercially?
Yes. The tool is free, the output is your own model, and the loader code is free to use on any site without credit. Check the licence of the model itself.