Planck.js is a JavaScript rewrite/port of the physics engine Box2D, designed to provide 2D rigid-body physics simulation usable directly in web contexts or any JavaScript environment. By offering collision detection, rigid-body dynamics, joints, and simulation capabilities, Planck.js makes it possible for developers to build physically realistic 2D games, simulations, or visualizations in browsers or Node.js without relying on native code. Its API mirrors Box2D’s concepts — bodies, fixtures, shapes, joints — which makes it familiar to users of classic Box2D, while being idiomatic for JavaScript developers. Because it's pure JavaScript, Planck.js integrates easily with HTML5 canvas, WebGL, or other browser-based rendering pipelines, facilitating smooth physics-driven games across platforms. It also is conducive to rapid prototyping and experimentation, since it avoids the complexity of compiling native libraries for web.
Features
- 2D rigid-body physics simulation with collision detection, dynamics, and joints
- Pure JavaScript implementation — works in browsers and any JS runtime without native dependencies
- Familiar API modeled after Box2D (bodies, fixtures, shapes, joints) for ease of use if you know Box2D
- Integrates easily with canvas, WebGL, HTML5 or other JS rendering pipelines
- Suitable for games, simulations, or interactive visualizations needing realistic physics behavior
- Good for rapid prototyping and cross-platform 2D physics in web contexts