Introduction
glTF is an open standard from the Khronos Group for delivering 3D scenes and models, often described as the JPEG of 3D. Version 2.0 was released in 2017. It carries meshes, physically based materials, textures, cameras, skeletons and animation, in a layout that maps closely onto how graphics cards draw, so it loads quickly in browsers and game engines.
There are two forms. A .gltf file is JSON that points to separate binary
buffers and images. A .glb file packs the JSON and the binary data into a
single file. Extensions add features such as mesh compression with
Draco.
Structure
The JSON describes the scene as arrays that refer to each other by index.
scenes list root nodes; a node has a transform and may hold a
mesh, a camera or a skin. A mesh’s primitives
read their vertex data through accessors, which describe a typed view
into a bufferView, which is a slice of a buffer of raw bytes.
materials, textures, images and
animations complete the scene, and asset gives the version.
A GLB file is a 12-byte header followed by chunks. All values are little-endian.
0Header magicglTF, version 2, total length12 bytes12JSON chunk length, typeJSON, the scene descriptionvaries…BIN chunk length, typeBIN, the buffer data (optional)varies
In this reference
- JSON properties – asset, scenes, nodes, meshes, materials, textures, samplers, cameras, skins and animations
- Buffers and attributes – buffers, buffer views, accessors, component types, alignment, sparse data, vertex attributes and morph targets
- GLB container – the binary header, the JSON and BIN chunks, padding and a worked example from a real file
- Extensions – how they are declared, Draco and meshopt compression, the KHR_materials extensions and their fields, texture and scene extensions
Opening glTF files in the explorer
Drop a .gltf or .glb file on this site’s explorer to see it.
It shows the JSON as a tree with a note on each property (accessor types, enumerations
and the references between objects spelled out), a GLB’s header and chunks with the BIN
chunk cut into its buffer views, a table for every collection (nodes, meshes,
primitives, materials, textures, images, accessors, buffer views, animations, skins,
cameras and extensions), the problems it finds, and the model in an interactive 3D view
(orbit, pan, zoom, a walking camera, wireframe and other render modes), with still
pictures in a second tab, drawn from the default scene: node transforms, skinning in the rest pose, morph targets at their
default weights, instancing and the base colour texture (PNG, JPEG or WebP), with images shown
as pictures.
Compressed geometry is decoded in your browser before anything else uses it. A buffer view that
carries EXT_meshopt_compression or KHR_meshopt_compression (the modes
ATTRIBUTES, TRIANGLES and INDICES, and the filters OCTAHEDRAL, QUATERNION, EXPONENTIAL and COLOR) is
decoded into the bytes that the buffer view describes, and a primitive with
KHR_draco_mesh_compression is decoded from its Draco stream (Edgebreaker and sequential
meshes, with every attribute the stream holds) into the accessors that the primitive names. From
there the accessor values table, the tables and the pictures treat the data like any other. The
Compressed buffer views table and the Primitives table say what was compressed, how, and whether it decoded;
a stream that does not decode is reported with the reason and the primitive is left out of the
pictures. The Draco stream can also be dropped as a .drc
file of its own.
Texture extensions: EXT_texture_webp images are decoded (lossy and lossless, with
alpha), drawn in the Images tab, used as the base colour texture, and open in the
WebP viewer. KHR_texture_basisu images are KTX2 files:
they are listed with their type but the KTX2 data is not decoded. An EXT_texture_avif
image opens in the AVIF viewer, which reads the container; no AV1
still-image decoder exists in the explorer, so it is not drawn. KHR_texture_transform
and every KHR_materials_* extension are read into tables (the Texture transforms and
Material extensions tables, with every property); the transform is applied to the base colour
texture, and the material extensions are not rendered.
Limits. A file dropped on its own comes without its folder, so a .gltf
whose buffers or images are separate files (uri naming a .bin
or .png) can be described but not drawn; embedded base64 buffers and GLB
files are complete. Draco and meshopt compressed geometry and WebP textures are
decoded; KTX2 textures are listed but not decoded. The view lights the model with a simple headlight; physically based materials, transparency and animation playback are not drawn (the view has a hook for animation poses that glTF does not use yet).
Not described
What this reference and the explorer leave out. Everything here is defined by a published specification or has open source code; nothing is known to be undocumented.
Known, not yet covered
- Reference: field lists and defaults were checked against the Khronos glTF 2.0 specification and its JSON schemas on 2026-11-18 (properties, attributes, GLB); the specification’s sections on skins, instancing, texture and image details (PNG and JPEG support, non-power-of-two textures), the BRDF and animation interpolation formulas are only partly written up.
- Reference: glTF 1.0 files (a different structure, specified by Khronos) are not described.
- Reference: extensions beyond those on the extensions page, and the meshopt bitstream (meshoptimizer, open source), are not described. The Draco bitstream is described on the Draco pages.
- Viewer: the whole of a meshopt buffer view or a Draco stream is decoded in memory before use (at most 512 MB decoded for meshopt and 256 MB compressed for Draco); a larger one is reported and its primitives are left out of the pictures. Both formats could be decoded in windows, but the viewer does not do that yet. Draco streams of the bitstream versions 1.1 to 2.3 are decoded; the deprecated texture-coordinate prediction scheme (method 3) and 64-bit integer attributes are not, and the predictive Edgebreaker traversal and the multi-parallelogram scheme are ported from the Draco source but no test file made by the reference encoder uses them, so they are untested.
- Viewer: KTX2 (KHR_texture_basisu) textures are listed, not decoded: there is no KTX2 reader in the explorer, and Basis Universal transcoding is not ported. AVIF textures open in the AVIF viewer but are not drawn. Only the PNG, JPEG or WebP base colour texture is applied, sampled at the vertices.
- Viewer: buffers and images in separate files cannot be read from one dropped file; the model is described in the tree and tables but not drawn.
- Viewer: lighting, transparency and animation playback are not done; the pictures are flat-shaded stand-ins. Most extensions are listed and explained in the tree with no effect on the pictures.
- Viewer: sparse accessors, KHR_materials extensions and instancing were tested on built files only; the 44 real files do not use them.
- Viewer: the pictures draw at most 8,000,000 vertices, 6,000,000 triangles and 100,000 instances, read an accessor of at most 60,000,000 values at once, and decode a texture of up to 200 MB; the Images tab pictures the first 24 images. Nothing is lost by these limits: every accessor value is listed, in pages, in the Accessor values table, every image has a row with an Open button, and long collections are listed in pages.
- Viewer: the JSON text is read from the file in windows and its long strings (base64 buffers and pictures, long text) are never held in memory, so a long string, a data: URI of any size or a .gltf file of any size is complete and reachable (a data: URI opens as a file of its own). The rest of the JSON, with every number and short string, is kept in memory, so a document with a hundred million array items is limited by the memory of the browser.
Links
Software
- Blender – free open source 3D suite that imports and exports glTF and GLB (Windows, macOS, Linux)
- Godot – free open source game engine that imports glTF (Windows, macOS, Linux)
- Unreal Engine – Epic Games’ engine, which imports glTF (Windows, macOS, Linux)
- Khronos glTF Sample Viewer – the reference viewer from Khronos (web browsers)
Developers
- three.js – 3D library for the web, with its GLTFLoader (JavaScript)
- Babylon.js – 3D engine for the web that loads glTF and GLB (JavaScript)
- cgltf – single-file parser for glTF and GLB (C)
- tinygltf – header-only library that loads and saves glTF (C++)
- glTF Transform – library and command line tool for editing and optimising glTF (JavaScript)
Reference
- glTF 2.0 specification – the Khronos Group’s standard
- glTF repository – the Khronos Group’s repository, with the extensions