How to convert glTF to GLB
- Parse the JSON documentSelect a .gltf file. The parser reads the asset description: scenes, nodes, meshes, accessors, bufferViews and buffers. Buffers are accepted when their data is embedded as a base64 data URI inside the file.
- Resolve embedded buffersEach data-URI buffer is decoded from base64 into bytes. The accessors' byteOffsets and byteStrides are validated against the decoded lengths before any geometry is built.
- Flatten to one meshAll mesh primitives across the scene are merged into a single indexed geometry with baked node transforms. The output GLB therefore has a minimal scene: one mesh, one node, one scene.
- Write the binary containerThe exporter serialises a new glTF JSON that points at one buffer, pads the JSON with spaces to a four-byte boundary, appends the BIN chunk zero-padded the same way, and prefixes the 0x46546C67 header with version 2 and the total length.
- Download the .glbThe result loads anywhere glTF 2.0 is supported, from three.js to Windows 3D Viewer, without external dependencies.
What happens when glTF is converted to GLB
What the two formats actually are
glTF and GLB carry exactly the same data model: glTF 2.0. The difference is packaging. The JSON flavour stores everything as text, which forces buffers and images to live in separate files or in base64 data URIs that inflate size by a third. The binary flavour replaces that with a compact header and chunks, keeps JSON as plain UTF-8 text for zero-copy parsing, and stores binary data raw.
What survives the conversion
The triangle geometry, world transforms and normals survive. Because the converter merges the scene into one mesh, node names, per-node transforms and per-primitive materials from the source do not reappear as separate entities; the JSON inside the GLB describes a single mesh. Base64 inflation disappears because the BIN chunk stores bytes raw.
External references are the hard limit
A .gltf that points at external .bin or image files cannot be resolved from a single uploaded file, because the browser never sees those sidecars. Only self-contained .gltf documents, where buffers are embedded as data URIs, convert successfully. Files with external references stop with a clear error; re-export them as .glb from the originating tool.
Chunk layout details that matter
The GLB header is magic 0x46546C67, version 2 and total length as three uint32 values. The JSON chunk is tagged 0x4E4F534A and padded with spaces, the BIN chunk is tagged 0x004E4942 and padded with zeros, both to four-byte boundaries. Padding is included in chunk lengths, which is a common source of broken hand-written writers and exactly what this exporter handles for you.
glTF vs GLB
| glTF source | GLB output | |
|---|---|---|
| Feature | glTF source | GLB output |
| Container | JSON text | Binary header plus two chunks |
| Buffers | Base64 data URIs or external .bin | Raw bytes in the BIN chunk |
| Size | Inflated by base64 when embedded | Compact binary |
| Requests to load | One, if self-contained | Always one |
| Scene structure | Full node graph | One merged mesh |
| Materials | Declared in JSON | Default surface on merged mesh |
| Padding | n/a | JSON spaces, BIN zeros, 4-byte |
| Units | Metres by convention | Metres by convention |
| Output files | One .gltf plus sidecars | One .glb |
Supported formats
| Format | Read | Write | Notes |
|---|---|---|---|
| STEP (.step .stp) | Yes | – | ISO 10303 B-rep, AP203 / AP214 / AP242 |
| IGES (.iges .igs) | Yes | – | Entity-based surfaces, up to 5.3 |
| BREP (.brep) | Yes | – | OpenCascade native B-rep |
| STL (.stl) | Yes | Yes | Binary and ASCII triangles, no units |
| OBJ (.obj) | Yes | Yes | v / vn / f records; .mtl references ignored |
| PLY (.ply) | Yes | Yes | Binary position and normal arrays |
| GLB / glTF (.glb .gltf) | Yes | Yes | glTF 2.0, binary or JSON with data URI |
| 3MF (.3mf) | Yes | Yes | OPC/ZIP package, declares millimetres |
| FBX (.fbx) | Yes | – | Binary and ASCII, static mesh only |
| DAE (.dae) | Yes | Yes | Collada scene graph is flattened |
| 3DS (.3ds) | Yes | – | Legacy chunk-based 3D Studio format |
| AMF (.amf) | Yes | – | XML, ZIP-compressed packages supported |
| USDZ (.usdz) | Yes | Yes | ZIP containing a USD stage |
Known limitations and why a conversion can fail
External .bin and image references fail
The converter receives exactly one file. A .gltf whose buffers or textures live in sibling files cannot be resolved and stops with an error naming the missing reference. Re-export as GLB, or produce a self-contained .gltf with embedded data first.
The scene graph collapses to one mesh
This converter outputs print- and viewer-ready geometry. If you need the node hierarchy, materials and animations preserved verbatim, use a glTF-aware editor instead; the GLB written here is one merged mesh.
Animations are not transferred
Skins, morph targets and animation channels are skipped during the merge. The GLB contains static geometry at the source pose.
Frequently asked questions
Can I convert on this page itself?
No. This page is the reference for the glTF to GLB path, and the conversion itself runs in the workspace that the button above opens, with both formats already selected. Your file is read in that browser tab and the download is written locally, so there is no upload stage in either place. Keeping the documentation and the engine on separate addresses lets file support and detail levels change behind one workspace without breaking the page you are reading.
Is the GLB smaller than my .gltf?
Almost always, if the source embedded its buffers as base64. Base64 inflates binary data by about a third, and the BIN chunk stores it raw. JSON text itself is a few kilobytes either way.
Do I lose the node hierarchy?
In this converter, yes: the output is one merged mesh with transforms baked in. That is what most viewers and slicers want, but it is not a byte-for-byte repack.
Can I convert the other way, GLB to glTF?
Yes, there is a dedicated GLB to OBJ page for mesh extraction, and GLB to glTF conversion follows the same chunk rules in reverse. Check the converters list on the homepage.
Why does my textured .gltf fail?
Its images are separate files. Only data-URI-embedded documents are self-contained enough to convert from a single upload.
References
Related converters
All converters
Last updated: