phaserjs /phaser

Phaser is a fun, free and fast 2D game framework for making HTML5 games for desktop and mobile web browsers, supporting Canvas and WebGL rendering.

★ 40,684⑂ 7,185👁 1,181⑃ 2,542● 4,669▤ 178◈ 132
JavaScriptMITCreated 2013-04-12phaser.io
40,684
stars
+9
7,185
forks
1,181
watchers
2,542
prs
4,669
issues
178
releases
132
discussions

README

Phaser - HTML5 Game Framework

!Phaser Banner


!JSDelivr
!GitHub

Phaser is a fast, free, and fun open source HTML5 game framework that offers WebGL and Canvas rendering across desktop and mobile web browsers and has been actively developed for over 13 years.

Games can be built for the web, or as YouTube Playables, Discord Activities, Reddit games, Twitch Overlays or compiled to iOS, Android, Steam and native apps using 3rd party tools. You can use JavaScript or TypeScript for development. Phaser supports over 40 different front-end frameworks including React and Vue.

Phaser is commercially developed and maintained by Phaser Studio Inc along with our fantastic open source community. As a result of rapid support, and a developer friendly API, Phaser is currently one of the most starred game frameworks on GitHub.

Interested in learning more? Click the image below to watch our intro video.



---

 Installing Phaser from NPM

Install via npm:

bash
npm install phaser


Then import it in your project:

js
import Phaser from 'phaser';


 Using Phaser from a CDN

Phaser is on jsDelivr which is a "super-fast CDN for developers". Include _either_ of the following in your html:

html




It is also available from Cloudflare's cdnjs:

html




 Create Phaser Game App

The easiest way to get started quickly with Phaser is our create-phaser-game app. This CLI tool presents an interactive selection of official project templates and demo games. Issue the command, answer some questions and the app will download and configure the right package for you.

bash
npm create @phaserjs/game@latest
npx @phaserjs/create-game@latest
yarn create @phaserjs/game
pnpm create @phaserjs/game@latest
bun create @phaserjs/game@latest


We support Vue.js, React, Angular, Next.js, SolidJS, Svelte and Remix with Vite, Rollup, Parcel, Webpack, ESBuild, Import Map and Bun. Most come in both JavaScript and TypeScript versions.

View the create game app tutorial.

 How Big is Phaser?

Don't be alarmed if you look at phaser.js and see a file over 8 MB. Over 84% of that is inline documentation - JSDoc comments, type annotations, and detailed method descriptions that power the TypeScript definitions and API docs. It's there for your IDE, not for your players.

The minified build, phaser.min.js, strips all of that out and comes in at 345 KB with standard gzip web server compression. This is the full version, with every feature included, but is still smaller than most texture images. You can reduce it further still by tweaking the build settings to exclude features your game doesn't need.

| Build | Raw Size | Compressed (gzip) |
| ----- | -------- | ------------------ |
| phaser.js (with docs) | 8.23 MB | - |
| phaser.min.js (full) | 1.29 MB | 345 KB |
| phaser-arcade.min.js | 1.18 MB | 313 KB |

 Why Phaser?

- Battle-tested - Over a decade of active development. Tens of thousands of games shipped. A huge community of developers who've seen it all.
- Truly cross-platform - One codebase 

Top issues

Discussions

Latest release

Phaser v4.2.1 v4.2.1 2026-07-09
Version 4.2.1 - Giedi - 9th July 2026

 Fixes

- Stencil option stencilInvert works correctly (an alpha bug prevented it from having the intended effect)
- Framebuffers now correctly clear stencil on use
  - The global stencil settings defaulted to deactivating the stencil write mask, so it couldn't actually run the clear process correctly. Write mask is now enabled by default, but is never triggered because default stencil operations keep existing values.
- Remove inline access of Phaser namespace from CombineColorMatrix, ImageLight, and Texture. These would break in the ESM build. Tha

Snapshot: 2026-11-10T09:35:25Z · Data license Apache-2.0 · JSON