Collections

51 Best Open Source HTML5 and JavaScript Games 2023

Online games provide a great means of entertainment in your free time. But have you ever wondered how your favorite online games are created? Maybe you would love to develop your own games and share them with your friends and family but don’t know how to get started?

In this article, I have carefully organized a list of the best open source HTML5 and JavaScript games. As the source code of these games is publicly available so it allows you to get an understanding of the actual procedure behind creating such games.

The best thing about these open-source HTML5 and JavaScript games is that you can easily download their source code on your computer, modify it according to your needs, run it using the web browser, and even re-distribute it however you like.

If you don’t know how to create an online browser-based game then I would highly suggest that you take this JavaScript Game Development Course from Udemy. In this course, you will learn how to create a Snake game, Breakout game, and Cupcake Catcher game in a step-by-step manner.

I also took this course back in 2018 when I was completely unfamiliar with how games are actually created. It really helped me gain practical knowledge of online game development.


PixelDefense

PixelDefense is one of the most beautiful and perfectly designed examples of open source HTML5 and JavaScript games. It is based on the tower defense game genre.

In this game, you have to place the towers in the specified places to prevent the incoming monsters from entering your homeland. You will be pleased to hear that the source code of this outstanding game is freely available for download from the Github repository.

It will be a great opportunity for you to understand the mechanics of online game development if you are familiar with the basics of HTML5 and JavaScript.

Live DemoDownload


Pocket Island

Pocket Island is an incredible browser-based game that makes use of the flexibility provided by HTML5 and JavaScript. It has a really advanced UI design that comes with an attractive storyline.

The game revolves around a wish list of the king which consists of several tasks. You have to fulfill his wishes in order to win the game.

Download


2048

2048 is a clone of the popular Play Store game 1024. Its source code is written in HTML5, CSS3, and JavaScript. If you are familiar with these languages then I would suggest you to contribute in this stunning game and display your skills to the whole world. This game is licensed under the well-known MIT License.

Live DemoDownload


HexGL

HexGL stands out from the rest of open source HTML5 and JavaScript games when it comes to the cutting edge graphics for the game design. This futuristic racing game has an unbelievable user interface that makes it look like we are playing an offline video game on a desktop computer.

It uses HTML5 and JavaScript for rendering the game environment. This open-source project is developed and maintained by Thibaut Despoulain with the help of some contributors.

Live DemoDownload


Mimstris

Mimstris is a cool online puzzle game that you will definitely enjoy playing in your free time. In this game, you have to quickly arrange the falling blocks of different shapes to fill the horizontal line similar to the video game Tetris. It is created using HTML5 and some JavaScript frameworks such as React and Redux. I bet you will fall in love with this game.

Live DemoDownload


Tower Building Game

Tower Building Game makes you feel joyful. Yes, that’s true because the game is designed in such a way that we want to play it again and again.

It is similar to the award-winning Tower Bloxx Deluxe game where your task is to drop the blocks on top of each other and make your way towards the skies.

Its structure is created using the new canvas element of HTML5 language while the logic is written in ES6 (an outstanding update to the JavaScript language).

Live DemoDownload


BrowserQuest

BrowserQuest is an open source massively multiplayer online (MMO) game, which is an experiment conducted by Little Workshop for Mozilla.

It is based on an adventure genre where your task is to explore the world. You will face several enemies on the way so stay calm and defeat them. You may even discover gifts that will help you stay strong and focus on achieving your goals.

The game is built using HTML5 and JavaScript which proves the flexibility of these languages.

Live DemoDownload


mk.js

mk.js resembles in concept with one of the most popular video game series Tekken. The fighting game comes in three types “Basic”, “Multiplayer” and “Network”.

Its basic structure is created in HTML5, styling is done using CSS3 while the game logic is written in JavaScript. If you are a great fan of fighting games then you will love to read its code and I hope you will be able to write something better in the future.

Live DemoDownload


3D Hartwig chess set

3D Hartwig chess set is one of the most interesting examples of open source HTML5 and JavaScript games. As it has one of the most appealing user interfaces and provides an amazing user experience. It is created using HTML5, CSS3 and JavaScript. Note that its source code is available under MIT License.

Live DemoDownload


Astray

Astray is no doubt an amazing example of the best open-source HTML5 and JavaScript games. This game really stands out from the rest of the crowd as it showcases the ability of what WebGL can do in a web browser.

It uses the Three.js and Box2dWeb libraries to create an advanced 3D user interface. The developer does not believe in the licenses and allows you to use the source code of this game however you like.

Live DemoDownload


Clumsy Bird

Clumsy Bird is a clone of the “Flappy Bird” game and it makes use of the open source and lightweight HTML5 game engine MelonJS. The game works by you controlling a flying character and the mission is to successfully pass it from in-between the incoming walls without hitting them.

Live DemoDownload


Hextris

Hextris is an awesome puzzle game that is according to its developer inspired by the famous game Tetris. The game steadily increases its pace as it progresses which makes it very addictive. It makes use of the HTML5 canvas to render the game with the help of JavaScript and style it using CSS3.

Live DemoDownload


Last Colony

Last Colony belongs to a real-time strategy (RTS) game genre which is a unique example of open source HTML5 and JavaScript games.

It comes with single-player and multiplayer modes. In single-player campaign mode, the game has a scripted storyline where your task is to build the economy and defeat your enemies. The game has a variety of buildings, aircraft, and vehicles which creates excitement in its users. The interesting thing about this game is that its codebase is also written in HTML5, CSS3, and JavaScript.

Live DemoDownload


Javascript Pseudo 3D Racer

Javascript Pseudo 3D Racer is similar in concept to the OutRun video game. As the name suggests it is developed using HTML5 and JavaScript. The game evolves incrementally in 4 versions and you can even check its step-by-step progress through the Github repository.

According to its developer, the game is more suitable for modern web browsers. He also stated that the source code is not structured well as the game is only meant to demonstrate the basics of pseudo-3d racing games.

Live DemoDownload


Pacman-canvas

Pacman-canvas is completely re-written from scratch in HTML5 and JavaScript. In Pacman-canvas you have to control a character using arrow keys on the keyboard and collect the items placed in a maze while protecting yourself from enemy units. You will be promoted to the next level after you have successfully picked up all the items.

Live DemoDownload


Canvas Tetris

Canvas Tetris is a really simple illustration of the Tetris game which is written in HTML5 and JavaScript to give beginner developers a basic understanding of 2D game concepts. The developer has mentioned that he created this game in just 45 minutes. So, if you are familiar with the basics of HTML5, CSS3 and JavaScript then I would definitely suggest you read its source code and enhance your game development skills.

Live DemoDownload


Ancient Beast

Ancient Beast is an amazing browser-based multiplayer game that utilizes the flexibility provided by HTML5 and JavaScript. This game is a strategy game based on players’ turns and is played online against other players.

This game features a wide variety of creatures that a player can acquire as they play along and then players can put them to use in order to defeat their opponents. The version of this game available now is 0.3 which was developed using HTML and JavaScript with required socket plugins.

Live DemoDownload


OpHog

OpHog is one of the most interesting and engaging tower defense games developed using HTML5 and JavaScript. The game lets you place defending units in order to defeat the enemy boss of each level while defending your portals. The developers have used HammerJS for touch gestures in the game and JQuery UI for the UI.

Live DemoDownload


Flexbox Froggy

Flexbox Froggy is the game developed. This game allows you to enter CSS styles in order to move the frog and reach the bottom where the pond is situated. The game is developed simply using HTML5, JavaScript, CSS styles, and some images.

Live DemoDownload


Grid Garden

Grid garden is a game similar to Flexbox Froggy and published by the same developer. Grid Garden is a game that helps players to learn about Grid CSS property. The developer makes use of animate.css and JQuery to design and develop this simple yet creative game.

Live DemoDownload


Quantum Game

Quantum Game is a simple and creative browser-based puzzle game that makes use of terminologies from quantum mechanics in the game.

The game contains photon sources to emit photon particles, rocks that act as an obstacle, mirrors to deflect the photon particle, and a photon detector that receives the photon particle.

The trick is to arrange the mirror in such a way that the photon particle emitted from the photon source should reach the photon detector evading the rocks. This game is developed using a simple HTML5 layout and JavaScript with CSS and sound plugins.

Live DemoDownload


Radius Raid

Radius Raid is an amazing and engaging space-themed game developed using HTML5 animations with JavaScript. It is a shooting game where players need to shoot at relentless enemies and destroy them before the enemy ships destroy them. This game consists of different types of enemies, amazing background designs with old-fashioned sound effects, and locally stored players’ statistics which will keep the players engaged in the game for a long time.

Live DemoDownload


React Simon Says

As the name says, React Simon Says is the game that was developed using the React JavaScript framework with Redux functionality. This game basically contains 4 colored blocks that light up in specific order.

After the blocks light up, players have to click the blocks in the same order as they light up in order to gain a point. The developer makes use of the React-redux project with some CSS styled-components in order to develop this simple game.

Live DemoDownload


React-2048-game

React-2048-game is the complete re-implementation of an addictive mobile game named “2048” that everyone must have played. As the name suggests, this game was developed using best practices of React JavaScript framework with redux including HTML5 and JavaScript game codes. This game provides users with arrow buttons to move the number blocks. The players have to move the number blocks in such a way that it combines and adds up to other blocks in order to reach the 2048 score.

Live DemoDownload


SpaceInvaders

SpaceInvaders is an incredible space-themed shooting game developed using HTML5 and JavaScript code. This game is actually a remake of the space invader phaser game. The developer makes use of Require.js in order to make the code for this game more manageable and structured using JavaScript modules.

Live DemoDownload


BreakLock

BreakLock is an interesting example of an HTML5 game. This game is a hybrid combination of Mastermind and Android lock game making use of android pattern locks as a game component. You need to connect the dots in order to match the lock pattern and win. This game makes use of Webpack and progressive web app solutions in order to provide a beautiful and mind-boggling game.

Live DemoDownload


Circus Charly html5 tribute in phaser

Circus Charly is a simple and addictive game developed using HTML5 and JavaScript as an honor to the phaser game. This game features a track with fire rings and a player with a circus lion who has to jump through the fire ring and cover a considerable distance to score higher. As the level progresses, fire rings become smaller and the game animation becomes faster.

Live DemoDownload


ClashJS

ClashJS is an interesting and creative AI-based game built using HTML5 as an interface and JavaScript as logic. This is an AI battle game featuring fighter jets where the participants code their AI in order to make them fight. It is a great opportunity to understand how AI works with JavaScript. The game is freely available on GitHub with all the details stating the mechanics of this incredible AI game.

Live DemoDownload


Dental Defender: Saga of the Candy Horde

Dental Defender is one of the most interesting HTML5 tower defense games. It is a hybrid combination of tower defense and shooting games. This game is created using HTML5 for UI, CSS3 for styling while the game logic is written in JavaScript. This game has a concept similar to tower defense where a player has to defend teeth from being eaten by germs. A player can move around the teeth and shoot the germs in order to kill them. This game is very interesting and you will surely like it a lot.

Live DemoDownload


diablo-js

Diablo-js is one of the best HTML5 and JavaScript games that you can find and play right now. It is developed using a minimal code base as possible with html5 canvas and JavaScript. The UI and visuals in this game are incredible where HTML5 animation and JavaScript logic have been put into optimal use. The game basically revolves around a fighter who can move around the map using mouse clicks and killing the enemies which appear. This game might be your best chance to learn about HTML5 to its fullest.

Live DemoDownload


DUCK HUNT JS

Duck Hunt game is a very interesting and engaging game that everyone might have played during the reign of video games. In this game, we basically shoot the ducks which fly from the grass using a joystick but in this case, we use mouse clicks to knock down the flying ducks. This game is implemented using HTML5 and JavaScript. The developer has used PixiJS as a rendering engine and Green Sock Animations for animation purposes.

Live DemoDownload


emoji-minesweeper

We all know about the minesweeper game that is available in windows games inventory. Well, this Emoji-minesweeper game is a re-interpretation of the minesweeper game using HTML5 and JavaScript. The only difference is that we place emojis as a marker to spot the bomb position instead of flags. You use left-click to open a spot, right-click to mark a spot as a bomb. I am sure that this game will be as interesting as the traditional one we used to play.

Live DemoDownload


HTML5 tower defense

HTML5 tower defense is another interesting tower defense game that is implemented using HTML5 and JavaScript. In this game, we drag our defensive cannons to the layout map and place them in such a way that the enemies appearing from the whole doesn’t reach our hole. The game also contains statistical data that updates dynamically as the game progresses.

Live DemoDownload


Infinite Mario in HTML5 JavaScript

This Infinite Mario game is a clone of the original Infinite Mario, coded in JavaScript for web browsers using HTML5 for UI/UX. This game features a good example of using Canvas and Audio elements. You will be able to learn a lot about Canvas and Audio elements going through the source code of this game available freely in GitHub.

Live DemoDownload


Tap Tap Adventure

Tap tap adventure is an online game in which you have to move your player to the right place in the game. Whenever you tap on the screen your player moves from one place to another and you can also collect the prices in the game.

Download


The original TETRIS game simulator

The Tetris game is an interesting and creative simulation of the original 1984 version of the TETRIS game. The developer makes use of HTML5 and JavaScript to implement this game for browsers. The game is completely text-based where every frame of the game animation is rendered into a string of text with 25 rows of 80 chars.

Live DemoDownload


Tic Tac Toe

Tic Tac Toe is one of the most simple and addictive available out there. This game is developed using HTML5, JavaScript, and CSS for some styling. The developer has made use of Google fonts to make this game more visually appealing. This game is an exact replica of tic tac toe that we play in real life using pen and paper. Here, we basically use mouse clicks to place circles and cross in the layout interface.

Live DemoDownload


TooAngel Artificial intelligence for screeps

TooAngel game is an incredible screeps game build incorporating Artificial Intelligence along with HTML5 and JavaScript for interface and logic. Screeps basically means “scripting creeps”. This game is an open-source sandbox game for coders, where the core mechanics is to program your units’ AI. You control your colony by writing JavaScript code. This may be a great opportunity for you to learn AI scripts using JavaScript.

Live DemoDownload


towerdefense

towerdefense is a simple tower defense game implemented using p5.JS. You can also make and edit custom maps using this map editor. The game code is freely available in Github along with the controls to play this game.

Live DemoDownload


Turrets

Turrets are the small towers on the walls of the castle mostly used as a defensive position for cover firing against the enemy. In this game, you have to kill the enemies using these turrets. You can move the turrets by using the cursor.

You can buy or sell the turrets during the game and you also have to select the difficulty level before starting the game.

Live DemoDownload


Typer

Typer is a simple Alphabetic Game in which you have a red circle in the center. The random alphabets are approaching this circle which is in the center. If these alphabets hit the center then you lose the game.

So in this game, you have to stop the alphabet from hitting the circle by typing the alphabet and important thing is that this game is case sensitive.

Live DemoDownload


Web Tower Defense

In this game, you have to place the defensive tower on the square in front of the enemies. You have to click on the tower icon and then place it on the square where you want to build the tower.

You have to place towers in such a way in which you can kill maximum enemies.

Live DemoDownload


Alien Invasion

Alien invasion is a game in which you have to kill the aliens by using your plane. In this game, you have to kill the alien coming in the opposite direction of your plane.

You also need to protect your plane from the attack of the aliens and also save your plane from being hit by the aliens.

Live DemoDownload


Basketball GM

Basketball GM is a sports management game and you are the sports manager of the team and you have to do all the management duties like managing finances, winning more competitions, player development, and selecting different leagues.

The game is divided into different phases E.g preseason, regular season, playoffs, and drafting. The rules of the game are similar to NBA. This is a very interesting game and you can learn a lot from this game code.

Live DemoDownload


Canvas Tower Defense Game

Live DemoDownload


canvas-td

This is a tower game built using canvas element which is used to build 2d shapes in JS. In this game, the player has to buy the turrets and he has to place these turrets in the way of the enemies. When enemies reach near the turret it opens fire on the enemies.

Live DemoDownload


homemade tower defense game

This is a single-player game in which you have to protect your player from snow bears. You can move your player with the help of the cursor. To survive in this game you have to maintain your help and you can give a boost to your health from towers.

Live DemoDownload


Sleeping Beauty

Sleeping beauty is an online game based on a fairy tale. In this game, you have to reach the princess who is sleeping on tower floor 1. By using arrow keys you can move around and try to reach the tower where a princess is sleeping.

And on a funny note, we also warn you here that before you many adventurers go behind her but no one comes back so be careful.

Live DemoDownload


Space Company

Space company is an online game in which your main task is to gather resources. You can get these resources by mining. You can hire workers or build machines to gain these resources.

Live DemoDownload


SwiftCODE

Swift code is a multiplayer seed typing game for coders. In this game, the coder can make their own single-player or multiplayer game by using a preconfigured programming language. The user has also an option to join the existing games.

Live DemoDownload


Tower Defense

The Tower defense game is built using the three.js library of javascript. In this game, you have to build the tower and assigned bullets to each tower. Your score and progress are also stored in this game. You also have to choose the difficulty level before starting the game.

Live DemoDownload

Furqan

Well. I've been working for the past three years as a web designer and developer. I have successfully created websites for small to medium sized companies as part of my freelance career. During that time I've also completed my bachelor's in Information Technology.

View Comments

Recent Posts

Llama 3.1 vs GPT-4 Benchmarks

We evaluated the performance of Llama 3.1 vs GPT-4 models on over 150 benchmark datasets…

July 24, 2024

Transforming Manufacturing with Industrial IoT Solutions and Machine Learning

The manufacturing industry is undergoing a significant transformation with the advent of Industrial IoT Solutions.…

July 6, 2024

How can IT Professionals use ChatGPT?

If you're reading this, you must have heard the buzz about ChatGPT and its incredible…

September 2, 2023

ChatGPT in Cybersecurity: The Ultimate Guide

How to Use ChatGPT in Cybersecurity If you're a cybersecurity geek, you've probably heard about…

September 1, 2023

Add Cryptocurrency Price Widget in WordPress Website

Introduction In the dynamic world of cryptocurrencies, staying informed about the latest market trends is…

August 30, 2023

Best Addons for The Events Calendar Elementor Integration

The Events Calendar Widgets for Elementor has become easiest solution for managing events on WordPress…

August 30, 2023