Clicking a link and watching a thirty-year-old game boot inside a browser tab feels a little like magic. There's no download, no installer, no old PC in a closet — and yet the game runs exactly as it did in 1993. The technology making that possible is DOSBox compiled to WebAssembly. This explainer takes it apart in plain English: what's actually happening, why it runs offline, and why it keeps your session private.
The problem: DOS hardware no longer exists
DOS games were written for a very specific machine — a 1990s PC with a real-mode CPU, a Sound Blaster card, VGA graphics, and a memory model that modern operating systems abandoned long ago. The game talks directly to that hardware. On a current computer, that hardware isn't there to talk to, which is why the original .EXE simply won't launch.
You can't change the game, and you can't bring back the hardware. So the solution is to fake the hardware convincingly enough that the game can't tell the difference. That's emulation.
What DOSBox actually does
DOSBox is a long-running open-source emulator that recreates a whole DOS PC in software. When a game asks the "CPU" to run an instruction, DOSBox interprets it. When the game writes to what it thinks is a sound card, DOSBox catches that write and produces the sound itself. When it draws to VGA video memory, DOSBox turns those bytes into an image. To the game, it looks like a genuine early-90s computer; in reality it's a program pretending to be one.
The key idea: emulation isn't about running the old game natively — it's about building a convincing fake of the old machine so the unmodified game runs on top of it.
Where WebAssembly comes in
Traditionally DOSBox is a desktop application you install. To get it into a browser tab, its C++ source is compiled to WebAssembly (often shortened to Wasm) — a compact, low-level binary format that every modern browser can execute at close to native speed. Wasm was designed for exactly this kind of workload: performance-heavy code, like an emulator, that would be far too slow if written in ordinary JavaScript.
The pieces working together
- WebAssembly runs the emulator core — the CPU interpreter and hardware simulation — fast enough to hit a playable frame rate.
- A canvas element is where the emulated VGA output gets drawn, frame by frame, so you see the game.
- The Web Audio API takes the emulated sound-card output and plays it through your speakers.
- Keyboard and mouse events from the browser are fed back into the emulator as if they came from real hardware.
Put together, these turn a browser tab into a small virtual PC. That's the engine inside DOS Game Hub: DOSBox WebAssembly doing the emulation, the browser handling display, sound and input.
Why it runs offline
This is the part people find surprising. Because the emulator and the game files ship with the extension and run through WebAssembly on your own device, there's no server anywhere doing the computing. Nothing is streamed. Once the extension is installed, you can disconnect entirely and every game still runs — on a plane, on the subway, with the router off. DOS Game Hub makes no network requests during gameplay at all.
Contrast that with cloud gaming, where a remote machine runs the game and streams video to you. That approach needs a fast, constant connection and puts the workload on someone else's servers. Local WebAssembly emulation does the opposite: your device is the machine.
Why it's private
Privacy falls out of the architecture for free. If the game runs on your own hardware and never phones home, there's nothing to log and nothing to send. There's no account, no session telemetry, no gameplay data leaving the tab. DOS Game Hub layers on a deliberate no-tracking stance too: zero analytics, zero cookies, zero data collection. What you play, and when, stays with you. The full details are in the Privacy Policy.
A note on licensing
DOSBox is open-source software released under the GPL v2 licence, which is what allows it to be compiled to WebAssembly and distributed inside an extension. Just as important, the games themselves have to be legally free to share — which is why DOS Game Hub only includes officially released shareware and freeware versions. Good emulation tech and legitimately free content are two separate requirements; a responsible retro tool needs both.
Is emulation accurate?
Mature emulators like DOSBox are remarkably faithful — timing, sound and video are close enough that most games behave exactly as they originally did. Emulation is never a perfect atom-for-atom copy of old silicon, and a few edge cases exist, but for the shareware classics of the early-to-mid 1990s the experience is authentic. You get the real game, quirks and all, not a remake.
The bottom line
Running DOS in a browser isn't a trick or a stream — it's a genuine emulator, DOSBox, compiled to WebAssembly and executed locally on your machine. That single design choice is what makes browser-based retro gaming instant, offline-capable, and private all at once. Understanding it also makes the appeal obvious: no install per game, no server between you and the fun, and nothing watching over your shoulder.
Want to see WebAssembly emulation in action? Try DOS Game Hub — it's free, from Pascual Labs.