The Anatomy of the Konami Code: Why Kazuhisa Hashimoto Created History

One programmer could not finish his own game. The shortcut he wrote for himself shipped by accident, turned up in Contra two years later, and is now the only ten-button sequence a few billion people can recite.

Published by · updated 13 Oct 2026

Almost every famous cheat code is famous inside one game. This one escaped.

The Konami Code written as arrows: up, up, down, down, left, right, left, right, B, A
Ten inputs. No letters, no menus, no modifier keys — which is most of the reason it travelled. Photo: Maximile (talk) (Uploads), Public domain, via Wikimedia Commons

What is the Konami Code? The Most Famous Cheat in Gaming

Up, Up, Down, Down, Left, Right, Left, Right, B, A, Start

The sequence is ↑ ↑ ↓ ↓ ← → ← → B A, usually with Start on the end and sometimes Select before it. The Start is a confirmation, not part of the code — in the game that made it famous, the sequence check stops at the tenth input and deliberately ignores both Start and Select, which we will get to.

Hardware that lacks the right buttons substitutes. *Gradius Galaxies* on the Game Boy Advance takes L L R R in place of the second pair of directions. *Superman Returns* ends on Y X rather than B A. *The Incredibles* wanted it typed: UUDDLRLRBAS.

A Nintendo Entertainment System controller
Every input in the code is one of the six buttons that every controller of the era had, in the same place. Photo: Evan-Amos, Public domain, via Wikimedia Commons

From Hidden Developer Secret to Pop Culture Icon

It was never meant to be seen by anyone outside the building. What it is today — the thing a Discord 404 page, a Netflix app, a central bank's commemorative-banknote microsite and three voice assistants all recognise — is the result of one deletion that did not happen in 1986.

The Origins: Gradius and the QA Testing Dilemma

Translating a Grueling Arcade Experience to the NES

*Gradius* arrived in arcades in 1985, built on the economics of the arcade: difficulty is the business model, and a player who dies buys another credit. Its power-up system compounds that. You do not start equipped. Speed, missiles, the double shot, the laser, the Options that trail behind you and the shield are all earned in order, slowly, and losing a life takes most of them away.

An arcade cabinet in a Japanese game centre
An arcade game is tuned to take coins. A home conversion of one has to be played start to finish, repeatedly, by the people building it. Photo: Hawken King from Tokyo, Japan, CC BY 2.0, via Wikimedia Commons

Konami put the NES conversion in the hands of Kazuhisa Hashimoto and three colleagues, and they finished it in under six months. Hashimoto had joined the company in 1981, straight out of college, starting on circuit boards for coin-operated medal games; by then he had already converted *Track & Field* to the NES, a job that took him and one other programmer about half a year.

A Nintendo Famicom console with its controllers
The Famicom, 1983. The NES port of Gradius shipped for this machine in 1986. Photo: Evan-Amos, Public domain, via Wikimedia Commons

Kazuhisa Hashimoto's Desperate Measure for Playtesting

Here is the problem nobody puts on a box. To test a conversion you have to play all of it, over and over, including the late stages — and the late stages of *Gradius* assume a fully-equipped ship. Hashimoto could not reliably get that far. He was a programmer, not the kind of player the arcade original was designed around.

So he gave himself a back door: a button sequence, entered while the game was paused, that handed over the full set of power-ups at once. Not a design feature, not an Easter egg for players. A tool for one person, so that one person could do his job.

The Accidental Release: Forgetting to Delete the Code

It was supposed to come out before the game went out. It did not. The oversight was only noticed when *Gradius* was already being prepared for mass production, and by then the calculation had changed: pulling code out of a finished, tested ROM risks introducing something worse than a cheat nobody knows about.

So they left it in, and shipped. Players found it anyway — and told Konami about it. Other Konami developers started putting the same sequence into their own games.

A Nintendo Entertainment System cartridge
Once a cartridge is mastered, the code inside it is final. That cuts both ways. Photo: Evan-Amos, Public domain, via Wikimedia Commons

Contra and the Mainstream Explosion

The "30 Lives" Phenomenon That Saved a Generation

*Contra* reached the NES in 1988, and that is the version most of the world learned the code from. Enter it on the title screen and you start with thirty lives instead of three.

The disassembled game shows exactly how modest the change is. At the start of a game the lives counter is loaded with #$02 — two in reserve plus the one you are playing. If the code flag is set, it loads #$1d instead, which is 29 decimal. The legendary "30 lives" is a single byte, and it is stored as twenty-nine.

The routine that does it loops over both players, which settles an old playground argument: the reason pressing Select first "gives both players thirty lives" is not the Select press. Select is what chooses two-player mode on the title screen, and the lives setup writes the same number into both players' counters.

A Nintendo Entertainment System console
In North America the code is still called the Contra Code, or just the 30 Lives Code. Photo: Evan-Amos, Public domain, via Wikimedia Commons

How the Code Spread Before the Internet (Magazine Tips and Playgrounds)

There was no patch note and no official announcement, because officially the thing did not exist. What carried it was the distribution network a cheat code had in 1988: magazine tip sections, rental-shop counters, the back of a school bus. A code spread if it was short enough to repeat from memory and reliable enough that the person you told it to got the same result.

That is the quiet reason this sequence won and thousands of others were forgotten. Ten inputs, no letters to spell, no console-specific button names, and it worked on a controller every single person you were talking to already owned.

Under the Hood: How the Code Actually Works

The best place to see the mechanism is *Contra*, because the US version has been disassembled and annotated line by line. What follows is that code.

Reading Sequential Controller Inputs in Assembly

The NES controller is a shift register, not a set of pins. The console writes a 1 then a 0 to $4016 — strobe high, strobe low — which latches the state of all eight buttons, and then reads the same address eight times. Each read hands back one button in bit 0, always in the same order: A, B, Select, Start, Up, Down, Left, Right.

A MOS 6502 processor in a dual in-line package
A 6502 core, the architecture inside the NES's 2A03. Everything the code does is a handful of compares on a processor like this one. Photo: Dirk Oppelt, CC BY-SA 3.0, via Wikimedia Commons

*Contra*'s read loop does precisely that, rotating each bit into a byte eight times, for both controllers at once. It then does the whole thing twice and compares the two results, because sampled audio playback on the NES can corrupt a controller read — if the two reads disagree, the game keeps the last known good one.

One more step matters for the code. Every frame the game takes the new reading, exclusive-ORs it against the previous known-good reading and ANDs that with the current state. What is left is the buttons that *became* pressed this frame. Holding Up does not count twice. That single operation is what makes a sequence check possible at all.

The State Machine: Tracking the Sequence Frame-by-Frame

There is no clever pattern matching here. There are two bytes of zero page and a ten-byte table:

ByteAddressJob
KONAMI_CODE_NUM_CORRECT$3fHow many inputs have been entered correctly so far
KONAMI_CODE_STATUS$24$00 not entered, $01 entered

The lookup table is the code itself, one byte per input:

$08 $08 $04 $04 $02 $01 $02 $01 $40 $80

Which decodes as Up, Up, Down, Down, Left, Right, Left, Right, B, A — bit per button, exactly as the controller read assembled them.

The check runs on the title screen and is about a dozen instructions. It loads the index; masks the newly-pressed buttons with #$cf, which throws away Select and Start and keeps only the d-pad, A and B; exits if nothing new was pressed; and compares what is left against the table entry at the current index. Match, and the index increments. When the index reaches #$0a — ten — the flag is set.

And if you get one wrong? The routine stores #$ff in the index, and the first instruction of the check is a test for a negative value that exits immediately. The sequence does not restart from the beginning. It is locked out for good, until the title screen initialises the index back to zero. One mistimed press and you reset the console.

That detail also answers the question of why the code ignores Select and Start. It is not an accident of the mask: on a screen where Start begins the game and Select switches between one and two players, a sequence check that counted those buttons would be impossible to enter.

The underside of a Nintendo Entertainment System motherboard
Ten bytes of table, two bytes of state, and about a dozen instructions on the title screen. Photo: Evan-Amos, Public domain, via Wikimedia Commons

Triggering the Memory Flag

Setting the flag does nothing by itself. Nothing on screen changes, no sound plays, and the title screen carries on exactly as before.

The payoff comes later and somewhere else entirely. When the game begins and sets up the players, it loads the default two reserve lives, checks KONAMI_CODE_STATUS, and if the flag is set loads twenty-nine instead. That is the whole cheat: one byte written on one screen, read by an unrelated routine on another.

It is the same shape as nearly every built-in cheat that followed. A flag gets set, and some code further down the line asks about it.

Cultural Migration: The Code Leaves Konami

Paying Homage: Easter Eggs in Non-Konami Games

Once the sequence was common knowledge, developers with no connection to Konami started hiding it in their own games, as a wink rather than a cheat. Tengen's NES *Tetris* turns the current piece into an I-piece, once per game. *Ratchet & Clank: Up Your Arsenal* swaps the wrench for a double-ended lightsaber. *BioShock Infinite* unlocks 1999 Mode with it, *Bloodstained* a 1986 Mode, *Tetris Effect* a 1984 level, *Hollow Knight: Silksong* its Steel Soul mode. It turns up in *Metal Gear Rising*, *Dead by Daylight*, *Assassin's Creed III*, *Anno 1800*, *Ultrakill* and a Fortnite minigame. In 2024, thirty-five years after the console it was written for, a variant was found in *Castlevania: Legacy of Darkness* that unlocks characters, outfits and a hard mode.

Web Apps, Voice Assistants, and the Internet Age

A backlit computer keyboard
On a keyboard the code is four arrow keys and two letters — close enough that the convention survived the move off controllers intact. Photo: Colin, CC BY-SA 4.0, via Wikimedia Commons

The second migration was off games entirely. Opera hid power-user settings behind it for thirty-five versions. Netflix uses it to reset the app on some devices, webOS used it to unlock developer mode, Discord's 404 page turns into Snake, Twitch's creator dashboard responds to it, and so did the Bank of Canada's page for a commemorative ten-dollar note. A Chromebook Pixel blinks its lid LED.

A smart speaker on a desk
Google Assistant, Siri and Alexa each have a scripted answer ready if you recite it. Photo: Asivechowdhury, CC BY-SA 4.0, via Wikimedia Commons

What all of these have in common is that none of them is a cheat. The code stopped being a way to get something and became a password that means *you are one of us*.

Why We Still Remember It

Three things, and none of them is nostalgia on its own.

The Legacy of Kazuhisa Hashimoto

How a QA Workaround Became a Permanent Piece of Gaming History

Kazuhisa Hashimoto was born on 15 November 1958 and joined Konami in 1981. Besides *Gradius* his credits include *Track & Field*, *The Goonies*, *The Legend of the Mystical Ninja* and the *International Superstar Soccer* series — a working programmer's career, at a company with a great many of them. He later became executive vice president of Star Online.

He died on 25 February 2020, at 61. His death was announced by Konami and by his friend Yuji Takenouchi, and it was reported by NPR, the New York Times and USA Today — an unusual set of obituaries for a console programmer, and they all led with the same ten buttons. (You will still see his age given as 79; the 1958 birth date, which he confirmed in a 2003 interview, makes that wrong.)

The thing worth holding onto is how ordinary the origin is. He was not designing an Easter egg or a piece of brand identity. He was a programmer who could not get through the fifth stage of his own conversion, so he wrote himself a shortcut — the same instinct behind the debug menus and console commands that fill most of this site. The only unusual part is that he forgot to take it out, and then the world got hold of it.

Every built-in cheat is somebody's leftover tool. This one just got famous. If you want the rest of that story, there is the history of cheat codes and, for the hardware that let players write their own, how the Game Genie worked.

Sources: Wikipedia: Konami Code; Wikipedia: Kazuhisa Hashimoto; NESdev Wiki: Standard controller; vermiceli/nes-contra-us: annotated Contra (US) disassembly; Contra disassembly: bank7.asm (konami_input_check); Contra disassembly: ram.asm (zero-page map).