IT lexicon › Web › Matter.js

Matter.js

Web På svenska → Updated: 2026-10-27

A 2D physics engine written in plain JavaScript, for games and interactive demos that need to run in the browser without compiled dependencies.

Liam Brummitt released Matter.js in 2014 under the MIT licence. It handles rigid bodies, compound shapes, springs and constraints, collision detection with a broad phase, and sleeping bodies that drop out of the calculation. It draws nothing itself beyond a simple debug renderer targeting canvas; the idea is that you wire it up to your own graphics.

Phaser 3 ships Matter.js as the heavyweight alternative to its simple Arcade physics, which has made it one of the most widely used physics engines on the web. The competition is Box2D compiled to WebAssembly — faster, but considerably less pleasant to debug in the browser's dev tools.

← Back to the lexicon