Use glTF
glTF 2.0 (and its single-file binary form, GLB) is the format browsers and web libraries expect: compact binary buffers, PBR materials, textures, animation, metres and Y-up by specification. Convert STL, OBJ or 3MF to GLB with the converter; export textured scenes from Blender as glTF Binary. Format guide.
Three ways to display it
| Approach | Effort | Best for |
|---|---|---|
<model-viewer> web component | One HTML tag | Product viewers, galleries, simple AR |
| three.js | JavaScript library | Custom scenes, configurators, interactive art |
| Babylon.js | JavaScript engine | Game-like apps, editors, XR |
| Raw WebGL / WebGPU | Write your own renderer | Specialised tools (like this site’s Studio) |
WebGL is supported by essentially every current browser. WebGPU, the newer graphics API, is rolling out across browsers and offers more modern GPU features.
Performance budgets
A 3D model is usually the heaviest thing on a page. Keep it light:
| Item | Practical target for a product viewer |
|---|---|
| GLB file | Under 2–5 MB |
| Triangles | Tens of thousands, not millions |
| Textures | 1–2K resolution, compressed |
| Draw calls | As few meshes and materials as possible |
Our format benchmark shows how much the format alone changes file size: the same 65,024-triangle sphere was 3.25 MB as binary STL and 0.78 MB as GLB.
Compression
- Draco (KHR_draco_mesh_compression) and meshopt (EXT_meshopt_compression) shrink geometry dramatically; the viewer must include the matching decoder.
- KTX2 / Basis Universal textures stay compressed on the GPU, saving download size and memory.
- Serve
.glbfiles with HTTP compression and long cache lifetimes.
The Studio here reads uncompressed GLB; Draco and meshopt files must be decompressed first.
Loading and accessibility
- Show a lightweight poster image first and load the model on interaction or when it scrolls into view.
- Provide a text description and keyboard controls; a canvas is invisible to screen readers without them.
- Respect prefers-reduced-motion — avoid auto-rotation for users who ask for less motion.
3D and search engines
Search engines index text, not geometry. Put the important information — what the object is, its size, materials — in HTML around the viewer, add a descriptive image, and link the model file. Structured data such as schema.org’s 3DModel type describes the files.
AR from the browser
<model-viewer> can open a model in Scene Viewer on Android (from GLB) and AR Quick Look on iPhone and iPad (from a USDZ file you provide). WebXR offers full AR and VR in supported browsers and headsets (AR and VR explained).
Check your understanding
1. Which format is the standard for 3D on the web?
It was designed for efficient real-time delivery.
2. What do Draco and meshopt do?
The viewer needs a decoder to unpack them.
3. How should a page help search engines understand a 3D model?
Engines index text, not geometry.