Binary glTF is used in 3D viewers, asset pipelines, model conversion, avatar loading, and scene validation. Containers, extensions, binary chunks, and texture references all affect implementation behavior.
Common detection mistakes
The .glb extension alone does not prove the file contents. Upload and conversion flows should combine extension, MIME type, leading bytes, and format-specific structure checks.
Binary glTF can start with signatures such as 67 6C 54 46, but related containers and damaged files may require additional validation.
Security notes
Untrusted input is not safe just because the format was detected. Account for parser exceptions, large files, unexpected encodings, and external references.
Using samples
11 samples help test viewer loading, extension detection, and load time across file sizes.
Box Vertex Colors GLB is a Binary glTF sample based on Khronos glTF Sample Assets. It can be used to test downloads, parsers, previews, and file type detection.
Animated Colors Cube GLB is a Binary glTF sample based on Khronos glTF Sample Assets. It can be used to test downloads, parsers, previews, and file type detection.
Animated Morph Cube GLB is a Binary glTF sample based on Khronos glTF Sample Assets. It can be used to test downloads, parsers, previews, and file type detection.
Simple Instancing GLB is a Binary glTF sample based on Khronos glTF Sample Assets. It can be used to test downloads, parsers, previews, and file type detection.
Metal Rough Spheres GLB is a Binary glTF sample based on Khronos glTF Sample Assets. It can be used to test downloads, parsers, previews, and file type detection.
Glass Vase Flowers GLB is a Binary glTF sample based on Khronos glTF Sample Assets. It can be used to test downloads, parsers, previews, and file type detection.
Clearcoat Wicker GLB is a Binary glTF sample based on Khronos glTF Sample Assets. It can be used to test downloads, parsers, previews, and file type detection.
Water Bottle GLB is a Binary glTF sample based on Khronos glTF Sample Assets. It can be used to test downloads, parsers, previews, and file type detection.
What is the magic number (file signature) of Binary glTF?
Binary glTF files begin with the byte signature 67 6C 54 46 ("glTF"). Detect the format by reading these leading bytes rather than trusting the file extension alone.
What is the MIME type of Binary glTF?
The MIME type for Binary glTF is model/gltf-binary, model/gltf+binary.
What file extension does Binary glTF use?
Binary glTF files use the .glb extension. The extension is a convention only and does not guarantee the file contents, so combine it with signature and structure checks.