Three.js
JavaScript 3D library for creating and displaying animated 3D computer graphics in the browser using WebGL.
Websites Using Three.js
What Is Three.js?
Three.js is the dominant JavaScript library for creating and displaying 3D graphics in the web browser using WebGL. It wraps the verbose, low-level WebGL API in an approachable scene-graph model, so developers can build cameras, lights, materials, and 3D objects without writing raw shader and buffer code by hand. If you want the short answer: Three.js is the de facto standard for browser-based 3D, powering the spinning product viewers, immersive scroll experiences, data visualizations, configurators, and WebGL games you encounter across the modern web.
Three.js was created by Ricardo Cabello, known online as Mr.doob, and has been developed continuously through a long series of revisions. It is widely regarded as the most popular and capable general-purpose 3D library for the web, and it is reported to be used on a very large number of websites and creative projects. Exact adoption figures vary by source and change over time, so treat any single number cautiously; what is consistently observed is that when a website renders real-time 3D in the browser, Three.js is by far the most likely library behind it.
The library is the foundation for a rich ecosystem. React Three Fiber brings Three.js into React as declarative components, and helper collections like Drei provide ready-made abstractions. This ecosystem has made 3D on the web dramatically more accessible than it was when WebGL first appeared.
How Three.js Works
Three.js organizes a 3D world around a small set of core objects. A scene is the container that holds everything you want to render. A camera, usually a PerspectiveCamera for realistic depth or an OrthographicCamera for flat projection, defines the viewpoint. A renderer, almost always the WebGLRenderer, draws the scene from the camera's perspective onto an HTML <canvas> element using the GPU.
Objects in the scene are meshes, each combining a geometry (the shape, defined by vertices and faces, such as BoxGeometry, SphereGeometry, or a loaded model) with a material (the surface appearance, such as MeshStandardMaterial for physically based rendering or MeshBasicMaterial for unlit color). Lights like ambient, directional, point, and spot lights illuminate materials that respond to lighting, while the renderer computes how each surface looks given the lights and camera.
Rendering is typically driven by an animation loop built on requestAnimationFrame. On each frame, the application updates object positions, rotations, and other properties, then calls renderer.render(scene, camera) to draw the current state. This loop is what produces continuous motion, from a slowly rotating model to a fully interactive 3D environment. Camera controls such as OrbitControls let users rotate, pan, and zoom by translating pointer and touch input into camera movement.
Three.js handles the heavy lifting of talking to WebGL: compiling shaders, managing GPU buffers and textures, batching draw calls, and dealing with the math of 3D transforms via its vector, matrix, and quaternion classes. It supports advanced techniques including physically based rendering, shadow mapping, environment maps and reflections, post-processing effect composers (bloom, depth of field, color grading), particle systems, skeletal and morph-target animation, and fully custom shaders through ShaderMaterial for developers who want to drop down to GLSL.
Loaders import external 3D assets. The GLTFLoader reads the glTF format, which has become the standard for web 3D because it is compact and renderer-friendly, while other loaders handle OBJ, FBX, and additional formats. Textures, environment maps, and compressed geometry can be streamed in to build rich scenes from authored content rather than code-generated primitives.
Three.js is distributed as the three package and as a single file (three.min.js) that exposes the THREE namespace. Because it sits directly on top of WebGL, performance depends on the same factors that govern any GPU rendering: the number of draw calls, polygon counts, texture sizes, and shader complexity. Well-optimized Three.js scenes run smoothly even on modest hardware, while unoptimized ones can become heavy, which is why the library also provides tools for instancing, level-of-detail, and frustum culling.
How Three.js Renders a Page
When a page using Three.js loads, the library initializes a WebGL context on a <canvas>, builds the scene graph, and starts its animation loop. The visible result is the unmistakable look of real-time 3D in the browser: interactive product models you can spin, parallax and depth in scroll-driven hero sections, particle fields, and immersive environments, all rendered live on the GPU rather than as pre-baked video or images.
How to Tell if a Website Uses Three.js
Three.js leaves clear fingerprints in both the loaded scripts and the page's rendering surface. Because StackOptic analyzes pages server-side by fetching their HTML and referenced assets, the script URLs and exposed globals are the most reliable signals, with the WebGL canvas as a strong corroborating clue.
Signals in the page and network
- Script filenames. Look for
three.min.js,three.js, or versioned files like[email protected]/build/three.min.js. Module projects may import from athreepackage and also load helpers such asOrbitControls.jsorGLTFLoader.js. - CDN paths. Three.js is commonly served from
cdnjs.cloudflare.com/ajax/libs/three.js/...,cdn.jsdelivr.net/npm/three@.../, andunpkg.com/three@.../. Spotting these in the Network tab is a strong indicator. - The global
THREEobject. Classic builds attachTHREEtowindow. TypingTHREEin the DevTools Console and receiving an object full of constructors (likeScene,Mesh,WebGLRenderer) confirms presence. - The revision property. Running
THREE.REVISIONin the Console returns a version number string (for example160), confirming the build revision in use. - A WebGL canvas. Three.js renders into a
<canvas>element backed by a WebGL context. In DevTools you can inspect the canvas, and querying its context type indicateswebglorwebgl2. A page whose main visual is a full-bleed canvas with 3D content strongly suggests a WebGL library. - Asset formats. Network requests for
.gltf,.glb,.obj,.fbx, or.hdrfiles alongside the script are characteristic of 3D scenes.
Tools to confirm it
| Tool | What you do | What it reveals |
|---|---|---|
| View Source | Open the page source | <script> tags for three.min.js or loaders like GLTFLoader.js |
| DevTools Console | Type THREE and THREE.REVISION | The global object and exact build revision |
| DevTools Network | Reload with the Network tab open, filter by three | Requests for Three.js files plus 3D asset formats |
| DevTools Elements | Inspect the rendering surface | A <canvas> element with a WebGL context |
| Wappalyzer | Run the browser extension | Flags Three.js in the JavaScript graphics category |
For a reusable method you can apply to any front-end dependency, see our guide on how to check what JavaScript libraries a website uses, and for whole-stack profiling, the broader primer on how to find out what technology a website uses.
A caveat: when Three.js is bundled with a build tool or used through React Three Fiber, the global THREE may be absent and the filename signal may disappear. In those cases the WebGL canvas plus 3D asset requests (especially .glb/.gltf) are the most reliable indicators, and detection extensions can help confirm.
Key Features
Three.js combines an accessible API with deep capability.
- Scene-graph model. Scenes, cameras, lights, geometries, materials, and meshes provide an intuitive structure for 3D.
- WebGL rendering. The
WebGLRendererdrives GPU rendering, with WebGL2 support for modern features. - Physically based rendering. Realistic materials, lighting, shadows, and environment reflections.
- Asset loaders. glTF/GLB, OBJ, FBX, and texture loaders import authored 3D content.
- Animation. Keyframe, skeletal, and morph-target animation plus an animation mixer.
- Post-processing. Effect composers add bloom, depth of field, color grading, and custom passes.
- Custom shaders.
ShaderMaterialandRawShaderMaterialallow direct GLSL programming. - Controls and helpers. OrbitControls, transform controls, and math utilities for interaction and geometry.
The features that most define Three.js in practice are its scene-graph abstraction, which is what makes WebGL approachable, and its glTF support, which connects the library to a standard asset pipeline so designers and developers can author models in other tools and load them directly. The ecosystem around it, especially React Three Fiber and Drei, further amplifies these features by making them composable.
Pros and Cons
Three.js trade-offs reflect its role as the bridge between raw WebGL and everyday development.
Pros
- Makes browser 3D accessible without hand-writing WebGL.
- Extremely capable, from simple viewers to complex interactive scenes.
- Large community, abundant examples, and a rich ecosystem (React Three Fiber, Drei).
- Standard glTF asset pipeline integrates with 3D authoring tools.
- Framework-agnostic core that works anywhere JavaScript runs.
Cons
- 3D adds significant complexity and a real learning curve.
- Performance requires optimization; heavy scenes can strain devices and batteries.
- Larger bundle and asset footprint than typical 2D libraries.
- Accessibility and graceful fallbacks need deliberate effort.
- Rapid revision cadence can introduce occasional breaking changes between versions.
The pragmatic stance is to use Three.js when 3D genuinely enhances the experience, budget for asset optimization and performance testing across devices, and provide sensible fallbacks for users on low-power hardware or with reduced-motion preferences.
Three.js vs Alternatives
The browser-3D space includes higher-level engines and lower-level options.
| Library / engine | Strengths | Trade-offs |
|---|---|---|
| Three.js | The standard; flexible, huge ecosystem, glTF pipeline | Lower-level than a game engine; you assemble more yourself |
| Babylon.js | Full-featured engine, strong tooling, built-in physics | Larger framework; more opinionated than Three.js |
| PlayCanvas | Cloud editor, game-engine workflow, good performance | Editor-centric; different workflow from code-first Three.js |
| Raw WebGL/WebGPU | Maximum control and performance | Very verbose; steep expertise required |
| 2D animation (e.g. GSAP) | Lightweight, simpler, great for motion design | Not 3D; no scene graph or WebGL rendering |
When a project needs sophisticated 2D motion rather than real 3D, an animation library is the better tool; our profile of GSAP covers that side, and the two are often used together on richly animated sites. Against Babylon.js, Three.js is typically chosen for its flexibility and ecosystem, while Babylon.js appeals to teams wanting a more complete, engine-style toolkit out of the box.
Use Cases
Three.js appears wherever the web needs real-time 3D.
- Product configurators and viewers. Interactive 3D models of shoes, cars, furniture, and devices that users can rotate and customize.
- Immersive marketing sites. Scroll-driven 3D hero sections, particle effects, and brand experiences.
- Data and scientific visualization. 3D plots, molecular models, and spatial data exploration.
- Games and interactive experiences. Browser-based games and playful WebGL demos.
- Architecture, maps, and digital twins. Walkthroughs, terrain, and 3D representations of real environments.
For technographic and competitive analysis, detecting Three.js signals a design-led or product-driven team investing in premium, interactive experiences and capable of nontrivial front-end engineering. That makes it a strong qualifying signal for vendors selling 3D, creative, or performance tooling, and a useful benchmark for agencies assessing how ambitious a competitor's web presence is.
Frequently Asked Questions
Is Three.js a game engine?
Not exactly. Three.js is a 3D rendering library that provides a scene graph, materials, lights, and a WebGL renderer, but it leaves higher-level concerns like physics, audio, and full game tooling to you or to add-on libraries. Engines such as Babylon.js or PlayCanvas bundle more of that out of the box. Many games are still built on Three.js by adding the pieces they need.
How can I tell which version of Three.js a site uses?
If the classic global build is loaded, open the DevTools Console and type THREE.REVISION, which returns a revision number like 160. You can also read the version from a CDN URL such as [email protected]/build/three.min.js. When Three.js is bundled or used via React Three Fiber, the global may be absent, so inspect the script filenames or look for 3D asset requests.
Does Three.js require WebGL?
Yes, in practice. Three.js renders through its WebGLRenderer, which needs a WebGL (or WebGL2) context, so the device and browser must support WebGL. The library is also developing support for WebGPU as that newer standard matures. If WebGL is unavailable, a Three.js scene will not render, which is why production sites should provide a fallback.
Is Three.js bad for performance or battery life?
3D rendering is inherently more demanding than 2D, and an unoptimized Three.js scene with many draw calls, high polygon counts, or large textures can strain GPUs and drain battery. Well-built scenes that use instancing, level-of-detail, compressed assets, and sensible frame management run smoothly on most devices. Respecting reduced-motion preferences and offering fallbacks is good practice.
What is React Three Fiber and how does it relate to Three.js?
React Three Fiber is a renderer that lets you build Three.js scenes using React components instead of imperative code. Under the hood it still uses Three.js, so everything you can do in Three.js is available, but the scene is expressed declaratively and integrates with React state and the broader React ecosystem. Helper libraries like Drei add ready-made components on top.
Want to detect Three.js and the entire front-end and graphics stack behind any website instantly? Try StackOptic at https://stackoptic.com.
Alternatives to Three.js
Compare Three.js
Analyze a Website
Check if any website uses Three.js and discover its full technology stack.
Analyze Now