Commodore 64 Emulator Online

Play the C64 in your browser: a working Commodore 64 with BASIC, a program library, an on-screen keyboard and joysticks. Free, nothing to install.

This is a real Commodore 64, emulated in your browser. Nothing to install, nothing to sign up for. It boots to BASIC exactly as the machine did in 1982: click the screen, type PRINT "HELLO" and press RETURN. Pick a program from the list to see it do more, or drop one of your own files onto the screen.

Loading the emulator…

Drop a .prg or .d64 file on the screen to run your own program.

How to use it
  • Click the screen, then type. The C64 starts in BASIC: try PRINT 2+2 and press RETURN.
  • Joysticks: most games read port 2, which is W A S D with the left Shift to fire. Port 1 is the arrow keys with the left Ctrl to fire; choose Both for a two-player game. Loading a program switches port 2 on and Reset switches it off. While a joystick is on, its keys steer rather than type, so set it to Off to type BASIC. On a touch screen a pad for port 2 appears under the screen.
  • Esc is RUN/STOP, Delete is RESTORE (so Esc and Delete together reset a stuck program), Backspace is INST/DEL and Home is CLR/HOME. Symbols sit where the C64 had them rather than where your keyboard prints them, so the on-screen keyboard is the reliable way to reach them; every key on it is labelled as on the machine.
  • Pick a program and press Load and run, or drop your own .prg or .d64 file on the screen. Reset gives you a fresh machine.

Emulation by Thomas Hochgoetz's C64 Emulator, compiled to WebAssembly. Free for non-commercial use.

How to use the C64 emulator

  1. Click or tap the screen so the emulator receives your keys. On a phone the on-screen keyboard opens by itself; on a computer press the Keyboard button to show it.
  2. Type BASIC. Try 10 PRINT "BRAINDUMPS ";, then 20 GOTO 10, then RUN. Press RUN/STOP (Esc on your keyboard) to stop it and LIST to see the program again.
  3. Load a program. Choose one from the Program list and press Load and run. Each one is a short BASIC listing, so LIST shows how it was written.
  4. Play with a joystick. Most C64 games read port 2, which is W, A, S and D with the left Shift to fire. Port 1 is the arrow keys with the left Ctrl. Loading a program switches port 2 on; set the Joystick list to Off to type again.
  5. Turn the sound on. Browsers keep audio off until you ask, so the SID chip is silent until you press Sound.

Programs you can load

  • Hello, World: the first program, five times over.
  • Maze: the famous one-line maze, a random diagonal printed forever.
  • Sixteen colours: cycles the border and background with POKE.
  • Guess the number: a little game. Type a number and press RETURN.
  • Sine wave: draws a sine wave down the screen with TAB and SIN.

All five were written for this page, so they are free to copy, change and share. The listings are short enough to type in by hand if you want to learn how BASIC V2 works.

Run your own programs

Drag a .prg, .d64, .t64, .tap or .crt file onto the screen and it loads and runs. The file stays in your browser; nothing is uploaded. Programs you write on a real C64, in a cross-assembler or in another emulator all work the same way. Old commercial games are still copyright however old they are, so only load games you own or that their authors have released.

Questions

Is it free?

Yes. The emulator is free to use and the programs on this page are free to share. The emulation engine is free for non-commercial use, which this site is.

Does it work on a phone or tablet?

Yes. The on-screen keyboard has every key of the real machine, and a touch joystick appears under the screen. A landscape screen gives you more room.

Why do some symbols type wrongly from my keyboard?

The engine maps a PC keyboard by position rather than by what is printed on the key, so on a UK or US keyboard the symbol keys land where the C64 had them: the key to the right of P types @ and the next one types *. The on-screen keyboard sends the right code for every key, which is why it is there.

Can I play games?

Yes, if you have a file you are allowed to use. Load it onto the screen and choose a joystick port. The plan is to add a few games whose authors have released them freely.

How fast is it?

The same speed as the real machine: a 1 MHz 6510 processor with 64 KB of memory. BASIC is as slow as it ever was, which is part of the charm.

About the Commodore 64

The Commodore 64 went on sale in 1982 and became the best-selling single model of home computer ever made, with somewhere between twelve and seventeen million sold. It had a MOS 6510 processor, the VIC-II graphics chip with sixteen colours and hardware sprites, and the SID sound chip, whose three voices and filters still get used by musicians today. It came with Commodore BASIC V2 in ROM, so the machine was ready to program the moment it was switched on, and that is what this page reproduces.

How this page works

The emulator is Thomas Hochgoetz’s C64 Emulator, compiled to WebAssembly and wrapped in a small WordPress plugin. If you would like one on your own site, this article explains how it is built, from the bare-bones page to the plugin.