What is the BSP file format?
A .bsp file is a compiled binary 3D game level, named after the Binary Space Partitioning algorithm used to recursively divide 3D space for efficient real-time rendering. The format was introduced in 1996 with id Software's Quake and has since branched into several closely related but mutually incompatible variants used by different game engines.
The file uses a lump-based binary container: a fixed header stores a magic number, a version integer, and a directory of numbered lumps. Each lump is a contiguous data block holding a specific category of data - BSP tree nodes, vertices, faces, edges, lightmaps, visibility (PVS) data, entity spawn-point definitions, and texture or material references. Entity data such as spawn points, triggers, and item pickups is stored as plain ASCII key-value pairs within a dedicated lump.
Major incompatible variants include:
- Quake 1 (BSP29): version int = 29; id Software, 1996.
- GoldSrc / Half-Life 1 (BSP30): version int = 30; Valve, 1998.
- Quake 2 / Quake 3 (IBSP v38/v46): ASCII magic
IBSP, then version integer. - Source Engine (VBSP): ASCII magic
VBSP, versions 17-21 depending on game (CS:GO, TF2, L4D2). - Source 2 (VBSP2):
VBSPmagic, version 29; used in CS2 and Half-Life: Alyx.
.bsp files are compiled outputs, not source files. Level designers work in .vmf (Valve Map Format) or .map files and compile to .bsp using vbsp.exe (Source Engine) or q3map2 (Quake family).
Security & safety
RISK: MEDIUMBSP files themselves are static data and cannot execute code. However, loading a maliciously crafted BSP in a vulnerable game engine could trigger buffer overflows or heap corruption bugs (historical CVEs exist for Quake-engine games). Risk is primarily relevant when downloading custom maps from untrusted sources for multiplayer games; official Steam Workshop maps are generally safer.
Format details
in a nutshell- Quake 1 BSP (BSP29) - Original 1996 id Software format, no ASCII magic, version number 29 at offset 0.
- Quake 3 / Quake Live BSP (IBSP v46) - Uses 'IBSP' magic like Quake 2 but version 46; used by open-source engines (ioquake3, OpenArena).
Programs that open BSP files
Technical details
deep spec| Container | Custom lump-based binary; incompatible variants exist per game engine |
| Encoding | Binary |
| Byte order | Little-endian |
| Magic bytes | Engine-dependent: IBSP (Quake 2/3), VBSP (Source/Source 2), raw int 29 or 30 (Quake 1/GoldSrc) |
| Version field | Integer in header: 29=Quake 1, 30=GoldSrc/HL1, 38=Quake 2, 46=Quake 3, 17-21=Source Engine titles, 29=Source 2 |
| Lump types | BSP tree nodes/leaves/planes, vertices, faces, edges, lightmaps, PVS visibility, entity definitions, material references |
| Entity data | Stored as plain ASCII key-value pairs in the entities lump (spawn points, triggers, pickups, etc.) |
| Lightmap format | 24-bit RGB per luxel (Source Engine); 8-bit monochrome per luxel (Quake 1) |
| Coordinate range | ±32,768 units (Quake 1); ±16,384 usable for geometry (Source Engine) |
| Compression | None at file level; Source 2 supports optional per-lump LZ4 compression |
| Typical size | 2 MB - 200 MB (Quake maps 1-20 MB; Source maps 5-100 MB; CS2 maps 50-200 MB) |
| Compiled output | BSP is compiler output; source is .vmf (Source) or .map (Quake), compiled with vbsp.exe or q3map2 |
| Cross-engine compatibility | None - each engine variant is mutually incompatible with others |
| Associated OS | Windows, Linux, macOS |
| Released | 1996 (Quake 1.0, id Software) |
| Latest version | Source 2 VBSP2 (2020+, used in CS2 / Half-Life: Alyx); multiple incompatible lineages |
| Specification | developer.valvesoftware.com |
BSP conversions
Community Q&A
asked by usersNo questions yet - be the first to ask about BSP files.