What is the DEM file format?
.dem files store gameplay recordings (commonly called demos) captured by the game engine during a live match or scripted sequence. The format is most closely associated with first-person shooters, particularly games running Valve's GoldSrc and Source engines, though the extension first appeared in id Software's Quake engine in the mid-1990s.
.dem files contain gameplay replay data recorded on the game engine: timestamped network snapshots, player input commands, and game events that allow the engine to reproduce the match in full.
There are two main types of .dem recordings:
- Player or server recorded replay - a live match recorded using the
recordconsole command or by an HLTV relay server. Competitive players use these for personal review, highlights, and anti-cheat submission. - Pre-scripted showcase demo - a non-interactive sequence consisting of prerecorded gameplay elements shown from various camera perspectives. This type is typically used for engine performance showcases and in-game attract screens shipped with the game.
.dem files can store both types of gameplay recordings.
A .dem file is not a video file - it stores raw game state that only the matching game engine and build can replay. To produce a watchable video you must play the demo back inside the game and capture the output with a screen recorder or a tool like HLAE.
Multiple distinct .dem formats share the extension, each identified by its file header: GoldSrc demos begin with HLDEMO\0, Source engine demos with HL2DEMO\0, and Source 2 demos (CS2, Dota 2) with PBDEMS2\0. Because the demo protocol version and network protocol version are stored in the header, files are engine- and build-specific - a Source 1 demo will not play back in Source 2.
.dem recordings are used throughout the competitive scene for match analysis, content creation, and anti-cheat review. Related formats include .VDM demo script files and .REP replay files.
Security & safety
RISK: LOWA game .dem is passive replay data parsed by the game engine, so risk is low - it can't run code on its own. Only play demos in the matching official game build; a corrupt or wrong-version demo simply fails to load. Be wary of sites offering "DEM to MP4 converter" downloads - there is no such direct converter, and those are often bundled adware; use the game's own recording tools or OBS instead.
Format details
in a nutshell- USGS DEM (Digital Elevation Model) - A terrain-elevation raster used in GIS/mapping - completely unrelated to game replays; opened in QGIS/ArcGIS.
- Quake / Hexen / Descent demo - Older single-game demo recordings sharing .dem; each replays only in its own engine.
- VirtualDub project / misc - Occasionally seen as a non-game .dem; identify by the application that created it.
Programs that open DEM files
Technical details
deep spec| File type | Binary game-state and network-snapshot replay recording |
| Byte order | Little-endian |
| File magic (Source engine) | HL2DEMO\0 - 8 bytes at file offset 0 |
| File magic (GoldSrc engine) | HLDEMO\0 - 7 bytes at file offset 0 |
| File magic (Source 2) | PBDEMS2\0 - 8 bytes at file offset 0; used by CS2 and Dota 2 |
| Compression | None (GoldSrc and Source 1); protobuf + Snappy (Source 2) |
| Typical file size | A few hundred KB to several hundred MB depending on match length |
| Internal version fields | Demo protocol version and network protocol version stored in the header, tied to the specific game build |
| Playback requirement | Must be opened in the matching engine and a compatible game build; not cross-engine or cross-version |
| Map integrity check | BSP map CRC may be embedded in the header for consistency verification |
| MIME type | application/octet-stream |
| Structure | Header (magic, protocol version, map name, game directory, playback time) followed by a stream of timestamped frame and command packets |
| Supported platforms | Windows, macOS, Linux (varies by game title) |
| Primary developer | Valve Software (GoldSrc and Source engines); id Software (original Quake-era format) |
| Released | 1996-1998 (Quake/GoldSrc era); Valve Source DEM since 2004 |
| Latest version | Source 2 demo (protocol-specific; e.g. CS2 .dem, 2023) |
| Specification | developer.valvesoftware.com |
DEM conversions
Community Q&A
asked by usersNo questions yet - be the first to ask about DEM files.