# WebGL

> A web standard that lets pages draw 3D with the graphics card. No plug-in is needed.

**Field:** Design  
**Category:** 3D & Immersive  
**Also known as:** Web Graphics Library, WebGL 2

## Think of it like

It is like a back door from a web page straight to the graphics card.

## Definition

WebGL is a web standard that lets a page draw 3D graphics using the device's graphics card. No plug-in is needed. It draws into a canvas element on the page. Its code is low level, so most people use a library on top of it instead of writing it by hand. The Khronos Group released version 1.0 in March 2011, and every major browser supports it. A newer standard, WebGPU, is starting to take over some of its work.

## Example

A car maker's site lets visitors spin a 3D car and change its paint. WebGL draws each frame in the browser.

## Example code

```javascript
const canvas = document.querySelector("canvas");
const gl = canvas.getContext("webgl");
console.log(gl ? "WebGL is ready" : "No WebGL here");
```

The page asks the canvas for a WebGL drawing context and checks that it got one.

## Why it matters

It is why 3D product viewers, maps and games can run inside a normal web page.

## Common mistake

Assuming every device draws it well. Old phones struggle, so plan a simple backup.

## Three principles

- **Graphics card from the web.** No plug-in.
- **Draws into a canvas.** Part of the page.
- **Low level.** Usually used through a library.

## Related terms

- [three.js](https://learn.benibix.com/term/design/three-js)
- [Rasterization](https://learn.benibix.com/term/design/rasterization)
- [Shader](https://learn.benibix.com/term/design/shader)
- [JavaScript](https://learn.benibix.com/term/development/javascript)
- [Graphics Processing Unit (GPU)](https://learn.benibix.com/term/infrastructure/graphics-processing-unit)
- [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/webgl
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.
