Home › AI Game Development › LittleJS
What is LittleJS? The tiny, fast JavaScript game engine
LittleJS is a fast, lightweight, fully open-source HTML5 game engine designed for simplicity and performance. Its small footprint is packed with 2D and 3D rendering, physics, particles, sound and input handling — with no dependencies, and a game on screen in a minute.
LittleJS in one paragraph
LittleJS (github.com/KilledByAPixel/LittleJS) is a JavaScript game engine for making HTML5 games that run in any modern browser. The whole engine is one small, well-documented codebase: five functions are the whole shape of a LittleJS game, and the live example browser lets you change the code of any of its 100+ examples while it runs. It covers 2D and 3D rendering, arcade physics with optional Box2D, audio, input for mouse, keyboard, gamepad and touch, UI, tweens, pathfinding and save data — and it ships with built-in 2D and 3D level editors.
The project appeared on GitHub in September 2021 and passed 4,400 stars by early December 2026. It is released under the MIT licence, free for any use, with no dependencies. Real games have been built with it, including Space Huggers on Newgrounds, the relaxing strategy game Isletopia on Steam, and a string of js13k competition entries. The engine is also deliberately AI-friendly: the API is small and well documented, so language models produce good results with it, and there are LittleJS AI tools and a LittleJS GPT for building games inside ChatGPT.
What LittleJS actually does
LittleJS is a complete engine in a small package. Its four parts are the rendering, the game systems, the developer tools, and the size.
1. 2D and 3D rendering in one engine
A blazing fast WebGL2 and Canvas2D hybrid renderer, measured against PixiJS, Three.js and PlayCanvas in the project's own WebGL engine benchmark. It has 2D lights with soft shadows, Shadertoy-style shaders for post-processing, a particle system with ready-made effects, parallax backgrounds and follow cameras. The built-in 3D renderer shares the canvas with your 2D game, with shape builders, OBJ loading, glTF import and export, heightmap terrain, shadow maps, lights and fog — and an optional Three.js plugin as an alternative renderer.
2. Physics, audio and input included
A robust arcade physics system with collision handling, fast tilemap collision and raycasting, swept bullet collision so small fast objects never pass through a wall, and full Box2D integration for realistic physics. Sound and music play from mp3, ogg or wave files, or from the ZzFX sound generator with no asset files at all, with spatial audio and an effects plugin. Input covers mouse, keyboard, gamepad and touch, with a customisable on-screen gamepad for mobile and pinch to zoom.
3. Game systems and developer tools
A UI system with buttons, sliders, text input and nine-slice skins, a tween system, a scene system for titles and menus, timers, seeded random numbers and persistent save data. There is grid-based A* pathfinding, and medals, leaderboards and cloud saves on Newgrounds and Wavedash. The built-in 2D and 3D level editors edit your game while it runs, with undo, autosave and prefabs, and 2D levels load and save as Tiled JSON. A debug overlay, debug drawing and a tweakables panel let you change values while the game runs.
4. Built small, on purpose
The minified engine is about 165 KB gzipped, and a bundler like Vite leaves out the plugins a game does not use, so a small 2D game comes to about 29 KB gzipped and a lit 3D scene to about 72 KB. That is why it is popular for size-coding competitions like Js13kGames, and why a game can be a single HTML file that runs straight from disk with no server.
Download and setup
There is nothing to install to try it: the example browser runs every example beside its code, and each one restarts with your change. To start a project, download the latest release from GitHub or run npm install littlejsengine, then save a single HTML file with the script path pointing at the engine file — it loads nothing else. A Vite starter template gives you a dev server that reloads on save, and full TypeScript and module support are included, with types in the npm package. The Breakout tutorial builds a complete game in about 30 minutes.
What it costs
LittleJS is free — MIT licensed, free for any use, with no dependencies and no paid version. The npm package, the examples, the editors and the docs all cost nothing. The only thing you might pay for is your own hosting, if you put a finished game on the web.
Who LittleJS is for
Web game developers
You want a game that runs in any modern browser on desktop and mobile, with 2D or 3D, physics and sound, from one small engine with no dependencies.
Game jam entrants
Built for size coding: a small 2D game is about 29 KB gzipped with a bundler, and there is a special js13k branch that builds to a 7 KB zip.
Beginners learning game dev
Five functions are the whole shape of a game, 100+ examples each with a write-up, and a Breakout tutorial that builds a complete game in about 30 minutes.
AI-assisted developers
The API is small and well documented so language models produce good results, with LittleJS AI tools, templates and prompts, and a LittleJS GPT that builds games inside ChatGPT.
LittleJS at a glance
- Project: KilledByAPixel/LittleJS — “Tiny fast 2D/3D HTML5 game engine with many features and no dependencies”
- Licence: MIT — free for any use
- Popularity: over 4,400 GitHub stars by early December 2026 (created September 2021)
- Language: JavaScript, with full TypeScript support
- Platforms: all modern web browsers and mobile devices; games run from a single HTML file
- Size: minified engine about 165 KB gzipped; a small 2D game about 29 KB gzipped with a bundler
- Editors: built-in 2D and 3D level editors that edit your game while it runs
- Home: littlejsengine.com
Honest limits
LittleJS is a web engine, and the README is honest about what that means. Your games run in the browser — there are no native desktop or console builds documented in the project. A page that loads images or modules needs a local web server, since browsers block them from a file on disk, so you run a dev server (Vite brings its own) rather than double-clicking the file. And the 3D plugins are a large part of the minified build, so a 3D game costs more size than a 2D one unless a bundler strips the plugins you do not use. Our AI game development service builds on engines like LittleJS, so the quote you get covers those choices up front.
Want a game without doing the setup?
LittleJS is one of the engines behind our AI game development service: we build your game in an engine like LittleJS instead of from scratch, playtest everything by hand, and hand over a finished game with its source code. Mini-games from £499, full 2D games from £1,499, 3D games from £2,999. You bring the idea; we bring the engine.
Have a game idea?
Tell us the idea — a sentence is enough. We will tell you what it takes and what it costs, honestly.