whatisgithub

What is draco.js?

mrdoob/draco.js — explained in plain English

Analysis updated 2026-05-18

153JavaScriptAudience · developerComplexity · 2/5LicenseSetup · easy

In one sentence

A small, pure JavaScript library that decodes Draco-compressed 3D mesh files in the browser as a drop-in replacement for three.js's official loader.

Mindmap

mindmap
  root((draco.js))
    What it does
      Decodes Draco meshes
      Pure JavaScript
      Drop in for three.js
    Tech stack
      JavaScript
      three.js
      WebGL
    Use cases
      Replace WASM loader
      Load glTF meshes
      Load standalone drc files
      Faster first render
    Audience
      Web developers
    Limits
      Triangle meshes only
      No metadata passthrough

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Swap this loader into an existing three.js project in place of the official DRACOLoader to shrink page weight.

USE CASE 2

Load compressed 3D triangle meshes from glTF files that use Draco compression, without a WebAssembly dependency.

USE CASE 3

Load standalone .drc Draco files directly into a three.js BufferGeometry.

USE CASE 4

Speed up first render of a single 3D model on a page by avoiding a large WASM decoder download.

What is it built with?

JavaScriptthree.jsWebGL

How does it compare?

mrdoob/draco.jsfoundzigu/smsbazaarfrank-masciopinto/no-kings
Stars153150146
LanguageJavaScriptJavaScriptJavaScript
Setup difficultyeasy
Complexity2/5
Audiencedevelopergeneralgeneral

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min

Drop-in ES module replacement, no WASM fetch or worker setup required, but only triangle meshes are supported.

The code it's based on (Google Draco) is Apache-2.0 and the API it mirrors (three.js DRACOLoader) is MIT, both permissive licenses that allow free use including commercially.

So what is it?

Draco.js is a small JavaScript library that decodes compressed 3D mesh files in the browser. It is specifically built to work with three.js, a popular library for rendering 3D graphics on the web. The compression format it decodes is called Draco, which is a standard way to shrink the size of 3D model files so they download faster. The main reason this project exists is to offer an alternative to the official Draco decoder. The official version ships as a WebAssembly file, which is a type of precompiled binary that browsers can run quickly. The official decoder weighs around 100 kilobytes when compressed for delivery. This JavaScript port weighs about 20 kilobytes compressed, making it roughly five times smaller. That smaller size means less data to download before a page can show a 3D model, which can result in the model appearing on screen sooner even though the JavaScript decoder is a bit slower at the actual decoding step. The library is a drop-in replacement, meaning you swap it into an existing three.js project in place of the original loader without changing how the rest of the code is written. It accepts the same method calls and configuration options. Underneath, it decodes the Draco bitstream format that current 3D tools and glTF exporters produce. There are two things this version does not handle. It only works with triangle meshes, not point clouds. It also does not pass geometry metadata back to the caller, though files that contain metadata will still load correctly. The project is a JavaScript translation of Google's original Draco C++ source code. The API design mirrors the three.js loader it replaces. Both the original Draco library and three.js are open-source, and this library follows the same licensing.

Copy-paste prompts

Prompt 1
Show me how to replace three.js's official DRACOLoader with draco.js in a GLTFLoader setup.
Prompt 2
Explain the tradeoff between this pure JavaScript Draco decoder and the official WebAssembly one.
Prompt 3
How do I load a standalone .drc file using this library's loadAsync method?
Prompt 4
What mesh types and metadata does this Draco decoder not support?

Frequently asked questions

What is draco.js?

A small, pure JavaScript library that decodes Draco-compressed 3D mesh files in the browser as a drop-in replacement for three.js's official loader.

What language is draco.js written in?

Mainly JavaScript. The stack also includes JavaScript, three.js, WebGL.

What license does draco.js use?

The code it's based on (Google Draco) is Apache-2.0 and the API it mirrors (three.js DRACOLoader) is MIT, both permissive licenses that allow free use including commercially.

How hard is draco.js to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is draco.js for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.