What is the VTF file format?
A .vtf file is a Valve Texture Format file - the proprietary binary texture container used by Valve's Source engine, first introduced with Half-Life 2 in November 2004. VTF files store compressed or uncompressed GPU-ready texture data together with a pre-built mip-map pyramid and a small DXT1-compressed thumbnail used for engine previews.
The file begins with the 4-byte magic signature VTF\0 (hex 56 54 46 00) followed by a major/minor version pair (major is always 7; minor ranges from 0 to 6). The header encodes image dimensions, frame count, depth (for volume textures), cube-map face count, a reflectivity colour vector, and a pixel format enum. Version 7.3 added an extensible resource data section for arbitrary engine-defined metadata chunks.
Supported pixel formats include DXT1 (4 bpp), DXT5 (8 bpp), BGR888 (24 bpp), BGRA8888 (32 bpp), and RGBA16161616F (64 bpp HDR). Image dimensions must be powers of two, up to 4096×4096 in typical usage.
.vtf textures are always paired with a .vmt (Valve Material Type) file that defines shader parameters, surface type, and blend modes, referencing the .vtf by name. VTFEdit is the standard community tool for creating and editing .vtf files outside of Valve's SDK.
In Source 2, the compiled texture equivalent is .vtex_c, produced by the VTex pipeline rather than VTFEdit.
Security & safety
RISK: LOWVTF is a texture data file with no executable code. Maliciously crafted VTF files could theoretically trigger parser bugs in VTFLib/VTFEdit (buffer overflows in dimension or format fields), but this is a theoretical concern. In practice, only open VTF files from trusted game or mod sources.
Format details
in a nutshellPrograms that open VTF files
Technical details
deep spec| Magic bytes | 56 54 46 00 ("VTF\0") at offset 0; major version (always 7) and minor version (0-6) at offset 4 as two DWORDs |
| Byte order | Little-endian |
| Pixel formats | DXT1 (4 bpp), DXT3, DXT5 (8 bpp), BGR888 (24 bpp), BGRA8888 (32 bpp), RGBA16161616F (64 bpp HDR); selected by format enum in header |
| Mip-map pyramid | Full mip chain stored from smallest to largest mip level; mip count specified in header; used for LOD rendering |
| Thumbnail | Small DXT1-compressed low-resolution preview stored in header area; used by the engine for quick asset identification |
| Texture types | 2D textures, cube maps (6 faces), volume/3D textures, animated sprites (multi-frame), normal maps |
| Dimension constraints | Power-of-two required (pre-v7.5); typical maximum 4096x4096; some Source versions support up to 16384x16384 |
| Resource section | Extensible resource data chunks added in v7.3, allowing arbitrary engine-defined metadata; used for particle sheet data etc. |
| Typical size | 4 KB - 32 MB depending on resolution, mip levels, and pixel format |
| Paired format | Always used with a .vmt (Valve Material Type) file defining shader, blend mode, and surface type - the .vtf holds pixel data only |
| Compression | No file-level compression; GPU texture compression (DXT1/DXT5/BCn) is baked into the stored pixel data |
| Source 2 equivalent | .vtex_c (compiled by VTex pipeline); VTF remains current for Source engine titles (Team Fortress 2, CS:GO, etc.) |
| Released | 2004 (Half-Life 2 and Source engine launch) |
| Latest version | VTF 7.5 (Source engine); VTF 7.6 (Source 2 / Portal 2 on Linux) |
| Specification | developer.valvesoftware.com |
VTF conversions
Community Q&A
asked by usersNo questions yet - be the first to ask about VTF files.