# three.js

> A free JavaScript library for 3D on the web. It makes WebGL much easier to use.

**Field:** Design  
**Category:** 3D & Immersive  
**Also known as:** Three.js, ThreeJS, three

## Think of it like

It is like toy blocks for 3D on the web. You snap a scene, a camera and a light together.

## Definition

three.js is a free, open source JavaScript library that makes 3D on the web much easier. It sits on top of WebGL and hides most of its hard parts. You build a scene, add a camera, lights and models, and it draws them in the page. It can load models exported from 3D apps and supports VR and AR in the browser. Ricardo Cabello first released it in 2010, and it is now one of the most used 3D libraries on the web.

## Example

Noah adds a spinning 3D logo to his landing page with about 20 lines of three.js.

## Example code

```javascript
const scene = new THREE.Scene();
const camera = new THREE.PerspectiveCamera(50, innerWidth / innerHeight, 0.1, 100);
const cube = new THREE.Mesh(new THREE.BoxGeometry(), new THREE.MeshNormalMaterial());
scene.add(cube);
camera.position.z = 3;
const renderer = new THREE.WebGLRenderer();
renderer.setSize(innerWidth, innerHeight);
document.body.appendChild(renderer.domElement);
renderer.render(scene, camera);
```

A scene, a camera and a cube, drawn once into the page through WebGL.

## Why it matters

Designers and web coders can add real 3D to pages. They do not need to learn hard graphics code.

## Common mistake

Loading huge models straight from a 3D app. Shrink and compress them first, or the page loads slowly.

## Three principles

- **On top of WebGL.** Hides the hard parts.
- **Scene, camera, light.** The building blocks.
- **Keep models light.** For fast pages.

## Related terms

- [WebGL](https://learn.benibix.com/term/design/webgl)
- [Blender](https://learn.benibix.com/term/design/blender)
- [JavaScript](https://learn.benibix.com/term/development/javascript)
- [3D Rendering](https://learn.benibix.com/term/design/3d-rendering)
- [GL Transmission Format (glTF)](https://learn.benibix.com/term/design/gltf)
- [WebXR](https://learn.benibix.com/term/design/webxr)

![A row of steps: a model made in a 3D app, exported as a file, loaded by a JavaScript library in a web page, drawn through WebGL by the graphics card, and shown on screen.](https://learn.benibix.com/diagrams/web-3d-pipeline.svg)

---

Source: https://learn.benibix.com/term/design/three-js
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-17
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
