A complete emulator for the 1977 CHIP-8 virtual machine — 4KB of memory, sixteen registers,
a 64×32 phosphor display and a hex keypad — written from scratch in vanilla JS.
The three cartridges below are original ROMs, hand-assembled for this page with a
custom Python assembler. Or drag any .ch8 file onto the page to run your own.
CHIP-8 isn't a physical console — it's a tiny virtual machine from 1977, invented by Joseph Weisbecker so hobbyists could write games for the COSMAC VIP microcomputer in a compact interpreted bytecode instead of raw 1802 assembly. It's the "hello world" of emulation: 35 two-byte opcodes, 4KB of RAM, sixteen 8-bit registers (V0–VF), a 64×32 monochrome XOR display, two 60Hz timers and a buzzer.
This page implements the whole machine: every opcode, the timers, sound, sprite collision flags, and both common compatibility profiles (modern behavior by default; tick COSMAC quirks for original-1977 shift and memory semantics — some older ROMs need it). Pause it and use Step to single-step the CPU while watching the registers.
The CHIP-8 hex keypad maps to your keyboard like this (tap the on-screen keypad on mobile):
| Keyboard | 1 2 3 4 | Q W E R | A S D F | Z X C V |
|---|---|---|---|---|
| CHIP-8 | 1 2 3 C | 4 5 6 D | 7 8 9 E | A 0 B F |
Emulators are legal; game ROMs usually aren't. So instead of shipping someone else's games, the three cartridges here were written for this page from scratch — a ~100-line Python assembler DSL emits the bytecode, and a reference interpreter verified each ROM headlessly before it ever touched the browser. Paddles is 324 bytes; the entire starfield demo is 103. Writing for a machine this small is a puzzle in itself.
.ch8 file anywhere on this page to run it.
Homebrew ROMs are freely available from the CHIP-8 community if you want to test drive more.