glTF vs GLB — Same Format, Different Packaging

Same Data, Different File Layout
glTF 2.0 (Khronos Group, 2017) is the schema. .gltf stores the schema as JSON with separate .bin geometry buffers and image files referenced by URI. .glb packs the same JSON, buffers, and images into a single binary container. Loaders parse both — three.js, Babylon.js, model-viewer, Blender, Unity, Unreal all handle either. The on-screen result is identical; the choice is about delivery, not capability.
How GLB Wraps glTF Internally
A GLB file starts with a 12-byte header — magic number 'glTF' (4 bytes), version 2 (4 bytes), total file length (4 bytes). Then come length-prefixed chunks. Chunk 0: JSON (the same JSON that would be in .gltf, padded to 4-byte alignment). Chunk 1: BIN (concatenated buffer data — vertices, indices, UVs, normals, animations). Optional Chunk 2+: embedded image data. The JSON references buffer chunk 1 via byteOffset/byteLength, so loaders parse JSON first, then slice the binary chunk by offset. No ZIP, no compression, just length-prefixed binary.
Practical Differences
- File count — .gltf is 3+ files (JSON, .bin, textures); .glb is one file. One file means one HTTP request and no broken sub-asset references.
- Editability — .gltf JSON is human-readable and hand-editable; .glb requires extraction tools to inspect or modify.
- Size — .glb is slightly smaller (no JSON whitespace, no path overhead) but not compressed; for real size reduction use Draco or Meshopt.
- CDN delivery — .glb is friendlier (one Content-Type, one cache entry); .gltf needs CORS configured for sub-asset fetches.
- Streaming — .glb supports progressive load via byte-range requests; .gltf can stream sub-assets in parallel.
- Tooling — gltf-pipeline (Cesium) and gltf-transform (donmccurdy) convert between formats and apply Draco/Meshopt/KTX2 compression to either.
Which Should You Pick — Five Decision Rules
- Open pcbviewer.app — for production web delivery, use .glb. One request, one Content-Type, one CDN entry, no broken references.
- For development and debugging, use .gltf. JSON is readable in any text editor; you can hand-edit materials, swap textures, or inspect node hierarchy without tooling.
- For asset libraries with shared textures across multiple models, use .gltf. Sharing a single PNG between five models saves bytes and CDN cache space.
- For email or single-file handoff, use .glb. No risk of separating the package; one attachment is everything.
- For maximum compression, apply Draco (KHR_draco_mesh_compression) and KTX2 (KHR_texture_basisu) regardless of container — both work in .gltf or .glb.
Convert STEP, STL, or other formats to glTF/GLB in your browser — preview in MakerSuite 3D before deploying.
Try MakerSuite 3D FreeWhy the Format Choice Affects Your Pipeline
Your CI/CD, CDN config, and asset versioning all depend on this. Multi-file .gltf needs CORS configured for each sub-asset domain, complicates cache busting, and risks broken links if a texture file gets renamed. Single-file .glb is easier to deploy but harder to debug. Pick based on your team's bottleneck — if asset debugging is the pain, .gltf during development; if CDN reliability is the pain, always .glb.
Where Each Format Wins
- E-commerce 3D — .glb for product viewers, simpler CDN integration
- AR/VR experiences — .glb for transport over network, model-viewer and WebXR both prefer it
- Game asset pipelines — .gltf during development with Draco compression at build time
- Architectural visualization — .glb for client previews, .gltf when sharing source assets
- Educational and museum 3D — .glb for embedding, .gltf for downloads when learners want to inspect the data
Verify Your Conversions in the Browser
Both .gltf and .glb may contain proprietary 3D models. MakerSuite 3D parses both formats entirely in your browser using three.js's GLTFLoader — no server, no upload, no cached copy. Drop your converted asset to verify geometry, materials, and textures before deployment. Safe for NDA work, prerelease product visualization, and IP-sensitive 3D models.
Frequently Asked Questions
What's the actual difference — same data?
Same data, different packaging. glTF 2.0 (Khronos Group, 2017) defines the scene-graph schema; .gltf files store it as JSON with separate .bin geometry buffers and texture image files referenced by URI. .glb is the same JSON + buffers + images packed into a single binary container with a 12-byte header (magic 'glTF', version, length) followed by chunks. Loaders parse both — three.js, Babylon.js, model-viewer, Blender, Unreal, Unity all handle either. The on-screen result is identical; only the file layout differs.
Which should I use for web?
GLB, almost always. One file means one HTTP request, no CORS quirks for sub-assets, no broken references when a file gets renamed. Servers can apply Content-Type: model/gltf-binary in one place. CDNs cache the bundle as a unit. The exception: if you want to hand-edit JSON for debugging, .gltf is readable in any text editor. For production, ship .glb and keep .gltf in version control as the editable source if you need it.
Does GLB compress better?
No — GLB is uncompressed binary. The size advantage over .gltf comes from removing JSON whitespace and consolidating files, not from compression. For real size reduction, use Draco (geometry compression, Khronos extension KHR_draco_mesh_compression) or Meshopt (KHR_meshopt_compression). These can reduce mesh data 5-10x at minor decompression cost. KTX2 with Basis Universal compresses textures. All three can be applied to either .gltf or .glb. Tools: gltf-pipeline (Cesium, JS) or gltf-transform (donmccurdy, Node).
What's inside the GLB binary?
Three or more chunks after the 12-byte header. Chunk 0: JSON (the same JSON that would be in .gltf, padded to 4-byte alignment). Chunk 1: BIN (concatenated buffer data — vertices, indices, UVs, normals, animations). Chunks 2+: optional, typically embedded image data referenced from JSON. The JSON in chunk 0 references buffer chunk 1 via byteOffset and byteLength, so loaders parse JSON first, then slice the binary chunk by offset. No ZIP, no compression — just length-prefixed chunks.
Can I extract assets from a GLB?
Yes, with any glTF tool. gltf-pipeline can convert GLB to glTF with separated assets: gltf-pipeline -i model.glb -o model.gltf --separate. The output gives you the JSON, .bin buffers, and individual texture files. Useful for debugging materials, swapping textures, or hand-editing the scene graph. For inspection without extraction, the donmccurdy.com glTF Viewer and gltf.report inspect GLB internals directly. MakerSuite 3D opens both formats in the browser viewer.
Related Articles
Drop your .gltf or .glb file — preview in any browser
Launch 3D Viewer