# Matter.js

> 2D rigid body physics engine for the web in JavaScript, with collisions, constraints and a canvas renderer

Source: https://talira.ai/catalog/matter-js-egff3vpv
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Library
- Categories: [libraries / physics engines](https://talira.ai/categories/libraries/physics-engines), [gaming / game engines](https://talira.ai/categories/gaming/game-engines)
- Platforms: web[^1]
- Licence: MIT[^2]
- Pricing: Free and open source[^1]
- Free tier: yes[^1]

Matter.js is an MIT-licensed 2D rigid body physics engine for the web, written in JavaScript by Liam Brummitt as an original implementation rather than a port. It simulates rigid, compound and composite bodies with mass, friction, restitution, gravity and constraints, detects collisions and supports raycasting, sleeping bodies, time scaling and plugins, and ships a canvas renderer. It runs in browsers and Node.js, and its gallery lists projects built on it, among them [Phaser](https://talira.ai/catalog/phaser-413cmnpx.md). It isn't the Matter smart home library of the same name.

## Links

- Website: https://brm.io/matter-js/
- GitHub: https://github.com/liabru/matter-js
- Docs: https://brm.io/matter-js/

## Problems it solves

- add 2D physics to a browser game
- simulate falling, stacking and colliding shapes on a web page
- make interactive physics animations on a website with JavaScript

## Features

- rigid, compound and composite bodies
- concave and convex hulls
- collisions with broad, mid and narrow phases
- constraints, friction, restitution and gravity
- raycasting and region queries
- sleeping and static bodies
- time scaling
- canvas renderer
- plugins
- runs in browsers and Node.js

## Trust

Overall: 0.49 out of 1.
Signals: maintenance 0.58, adoption 0.85, momentum 0.63, community 0.57, backing 0.00, extensibility 0.00.

- last commit 2 months ago
- 20 commits in the last 90 days
- 18.7k GitHub stars
- 25 contributors

## Alternatives

- [Box2D](https://talira.ai/catalog/box2d-7rkgsyjj.md): 2D physics engine for games, written in portable C

## Sources

[^1]: https://github.com/liabru/matter-js/blob/master/README.md (checked 29 Nov 2026)
[^2]: https://github.com/liabru/matter-js/blob/master/LICENSE (checked 29 Nov 2026)
