Project
Skip to content

Files, scanning & the web · Intermediate · 3 min

Putting 3D on a Website

How to show interactive 3D in a browser: glTF/GLB, the model-viewer component, three.js and Babylon.js, compression with Draco, meshopt and KTX2, performance budgets, SEO and AR.

By the 3DA.XYZ editorsUpdated 2026-11-05Original renders & data

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

ApproachEffortBest for
<model-viewer> web componentOne HTML tagProduct viewers, galleries, simple AR
three.jsJavaScript libraryCustom scenes, configurators, interactive art
Babylon.jsJavaScript engineGame-like apps, editors, XR
Raw WebGL / WebGPUWrite your own rendererSpecialised 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:

ItemPractical target for a product viewer
GLB fileUnder 2–5 MB
TrianglesTens of thousands, not millions
Textures1–2K resolution, compressed
Draw callsAs 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 .glb files 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?

2. What do Draco and meshopt do?

3. How should a page help search engines understand a 3D model?