Skip to content
A quick and silly script for adding the konami code easter egg to your site. Works with gestures on iPhone/Android as well.
Latest commit 26044a3 Apr 29, 2016 @georgemandis georgemandis Merge pull request #26 from AaronCritchley/patch-1
Changing archived link to Google Code with Github link


Important Update

NOTE: I've decided to simplify the repository. Just the JavaScript file and the README with some links to examples.

Recently I started receiving requests to including Konami-JS in a variety of JavaScript module loaders. If that feature is important to you I'd encourage you to fork the repo and implement it yourself — I have no plans of introducing anything like that here.

Simplified Implementation

Previously the simplest version of a Konami-JS implementation looked like this:

var easter_egg = new Konami();

This would redirect the user to a specified website upon successfully completing the Konami Code.

You could also pass along a function to execute when the easter egg is completed. The simplest version of that looked like this:

var easter_egg = new Konami();
easter_egg.code = function() { alert('Konami code!'); }

That is even sillier than the other implementation.

You can now set either the URL to redirect to OR the function to execute when you instantiate the class:

var easter_egg = new Konami('');


var easter_egg = new Konami(function() { alert('Konami code!')});

A passed string is assumed to be the URL to redirect to. A passed function will be executed when the code is successfully entered:

This is why you do code reviews more often than once ever two years.


Every site should have an implementation of the Konami Code. It makes things more fun. If you're unfamiliar with it, the Konami Code is a "cheat code" that appeared in many of Konami's video games going all the way back to 1986. It was typically entered on a Nintendo controller. Recently, ESPN received attention for the funny, flashy things that would happen when the code was entered on their website. Those shenanigans were the inspiration for whipping up this script.

Gesture Support

As of version 1.1, Konami-JS includes support for gestures on iOS and Android devices. Technically the code becomes "up, up, down, down, left, right, left, right, tap, tap" on these devices but that's close enough!

Support for touch gestures is automatically loaded when konami.load() is called. See the example page for details on how to deliver touch-specific easter eggs.


If you'd prefer to use a coffeescript version you can find one here:

Are you looking for GamePad support? Check out this fork:

As Seen On...

Something went wrong with that request. Please try again.