HTML5 Mario

Play the HTML5 port of Infinite Mario with keyboard controls, generated levels, coins, enemies, and power-ups.

Loading HTML5 Mario Game…Large games may need a few seconds.

How to Play

  • Use the arrow keys to move left or right and to enter doors or pipes when the level allows it.
  • Press S to jump; hold it longer for a higher jump. The game also uses S for the dash action.
  • Hold A to run. When Mario has fire power, A also launches a fireball.
  • Stomp enemies, collect coins and power-ups, avoid pits, and keep moving toward the level exit.

About HTML5 Mario

HTML5 Mario is Robert Kleffner's JavaScript and Canvas port of Infinite Mario. It adapts the Java version by Markus Persson into a browser demo with generated platforming stages.

The locally hosted build uses the original keyboard scheme shown above the canvas. It is an unofficial open-source tribute and is not a Nintendo release.

Controls

  • Left / Right Arrow: move.
  • Up / Down Arrow: interact with supported level entrances.
  • S: jump or dash; hold for a higher jump.
  • A: run, carry shells, or fire when the fire-flower power-up is active.

Goal

Cross each generated platforming stage without losing all lives. Collect coins and power-ups, avoid pits and enemies, and reach the exit so the next level can load.

Desktop and mobile compatibility

Desktop
Playable in a desktop browser with a physical keyboard. Click inside the game once if the page does not immediately capture key presses.
Mobile
Not supported by this build because it has no on-screen touch controls and depends on Arrow, A, and S keys.

Black screen, sound, or loading problems

  1. If the canvas stays black, reload and wait for the image and audio assets to initialize.
  2. If Mario does not move, click inside the game and then use the Arrow keys; make sure focus is not in the browser address bar.
  3. If sound is silent, interact with the game first. Some music formats in this older port may not work in every modern browser.
  4. If the canvas is cropped, use fullscreen or reset browser zoom to 100 percent.

Gameplay screenshots

Developer, source, and test status

Last tested
October 9, 2026

The upstream README states that this JavaScript version was ported from Markus Persson's Java Infinite Mario project. Mario remains a Nintendo property; Billy Bob Games is not affiliated with Nintendo.