planck.js is a free, open-source 2D physics engine written in TypeScript for game developers building cross-platform HTML5 games in JavaScript.
What it is
Planck.js is a JavaScript and TypeScript rewrite of Box2D, the established 2D rigid-body physics engine, packaged for use in browser-based and mobile game projects. It lives in the HTML5 and JavaScript game-development ecosystem, where physics runs alongside rendering on canvas and in the browser runtime rather than in a native binary, and it exposes what the project describes as an idiomatic JavaScript/TypeScript API instead of a ported C-style interface.
The concrete problem it solves is gaining Box2D-quality physics without leaving the web toolchain. Developers who want collision detection, joints, and rigid-body simulation in an HTML5 game would otherwise have to compile, bind, or WebAssembly-wrap the original C++ engine, or accept a library whose API does not match the language they are writing in. The project's stated motivations are to take advantage of Box2D's efforts and achievements, to provide readable and editable code in JavaScript and TypeScript, to offer an idiomatic API, and to optimize the library for web and mobile platforms.
Key capabilities
- Provides a full 2D rigid-body physics simulation derived from Box2D, covering the box2d feature set within a TypeScript codebase.
- Ships an API designed to read as native JavaScript and TypeScript rather than a mechanical transliteration of C++ conventions.
- Targets cross-platform HTML5 development, with canvas and HTML5 listed among its supported contexts.
- Is optimized for web and mobile platforms, which is one of the four stated motivations of the project.
- Ships a documentation site at piqnt.com/planck.js/docs/, including a testbed page for reproducing issues.
- Maintains a public examples gallery at piqnt.com/planck.js/ that demonstrates the engine in working scenes.
- Keeps a "Made with Planck.js" wiki listing projects built with the engine, alongside an issue tracker with 33 open issues.
Who uses it and how
- Game developers building HTML5 and canvas-based games who need rigid-body physics running in the browser or on mobile without a native build step.
- Teams writing their game logic in TypeScript who want type-checked access to the physics API rather than an untyped wrapper.
- Contributors and users who work through the project's testbed workflow: when filing an issue, they are asked to provide testbed code that reproduces the problem so it can be resolved faster.
- Developers evaluating engines through the examples gallery and the "Made with Planck.js" wiki before adopting it for their own title.
- Community members who ask questions and coordinate on the project's Discord server.
Getting started
The README does not give an install command; instead it directs newcomers to the documentation at piqnt.com/planck.js/docs/ and the examples at piqnt.com/planck.js/, with project discussion on the linked Discord server.
How it compares
Among the engines named in these facts, Planck.js's direct counterpart is Box2D itself, the C++ 2D physics engine it rewrites; Planck.js's distinction is that it is written in TypeScript and targets HTML5 and web/mobile runtimes, whereas Box2D is the original native implementation whose efforts the project explicitly builds on. It is additionally distinguished by carrying an MIT licence and by being written as readable, editable source in the language its audience already uses.
When to use it — and when not
Choose it when your project is a JavaScript or TypeScript HTML5 game and you want Box2D-class 2D physics without leaving the browser toolchain; skip it if you need a native or non-web engine, since it is built for web and mobile platforms. Be aware that the README is quite short and points to external documentation rather than describing setup inline, and that 33 issues remain open at the time of listing, so plan to consult the docs and Discord for answers not spelled out in the repository itself.