# HF2 — HF2/HFZ Heightfield

> HF2 (HF2/HFZ Heightfield): Tiled binary heightfield format for terrain elevation grids, associated with L3DT and gzip-wrapped as .hfz. Specs, software and free sample files; convert HF2 to 50 formats online.

- Page: https://beta.mygeodata.cloud/formats/hf2



## What is a HF2 file?

HF2 is a binary heightfield format designed by Bundysoft for terrain data exchange and is primarily associated with the L3DT terrain generation software. It stores digital elevation models for terrain modelling, game and simulation content, and visualisation. The .hfz extension denotes the same structure wrapped in gzip compression.

A file begins with a header containing the HF2 signature, grid dimensions, tile size, vertical precision and horizontal scale. Optional extended header blocks can carry georeferencing or projection information. The elevation grid is divided into square tiles. Each tile stores its own scale and offset, and heights are encoded as compact integer differences, so values are reconstructed as 32-bit floating point with quantisation limited to the declared vertical precision. This scheme makes files considerably smaller than raw floating-point grids. Only a single elevation band is supported, and coordinate reference system information is optional.

HF2 files usually come from terrain authors, game and simulation developers, and visualisation teams exchanging elevation grids, often exported from L3DT. Heights are quantised to the vertical precision set in the header, so a round trip from a float DEM can lose fine detail. Georeferencing is optional, so check that a coordinate system is present before combining the data with other layers.

### Technical details

| | |
|---|---|
| Full name | HF2/HFZ Heightfield |
| Data type | Raster · Elevation & grid |
| File extension | .hf2, .hfz |
| Files | Single file |
| Media type | — |
| Bands | Single-band elevation. |
| Pixel types | 32-bit float (scaled) |
| Compression | None, gzip (.hfz) |
| Coordinate system | Any (georeferenced) |
| Converter support | Read & write |
| Typical software | L3DT, GDAL/OGR, QGIS |
| Specification | https://gdal.org/en/stable/drivers/raster/hf2.html |

### Specifications & references

- https://gdal.org/en/stable/drivers/raster/hf2.html

### Sample HF2 files — free download

- [Elevation (Float32)](https://beta.mygeodata.cloud/static/landing/samples/v1/hf2/st-helena-dem.hf2) — Copernicus DEM GLO-30 elevation model of Saint Helena (0–812 m), a surface model including trees and buildings; sea = 0 m. 631×505 px, 1 arc-second (≈30 m) grid, WGS 84. HF2 format. (535.9 kB, EPSG:4326)

### Convert HF2 to other formats

- [HF2 to HFA](https://beta.mygeodata.cloud/converter/hf2-to-hfa)
- [HF2 to JPG](https://beta.mygeodata.cloud/converter/hf2-to-jpg)
- [HF2 to TIF](https://beta.mygeodata.cloud/converter/hf2-to-tif)
- [HF2 to BIL](https://beta.mygeodata.cloud/converter/hf2-to-bil)
- [HF2 to DEM](https://beta.mygeodata.cloud/converter/hf2-to-dem)
- [HF2 to GeoPDF raster](https://beta.mygeodata.cloud/converter/hf2-to-geopdf-raster)
- [HF2 to GRD](https://beta.mygeodata.cloud/converter/hf2-to-grd)
- [HF2 to JP2](https://beta.mygeodata.cloud/converter/hf2-to-jp2)
- [HF2 to KMZ raster](https://beta.mygeodata.cloud/converter/hf2-to-kmz-raster)
- [HF2 to MBTiles raster](https://beta.mygeodata.cloud/converter/hf2-to-mbtiles-raster)
- [HF2 to PNG](https://beta.mygeodata.cloud/converter/hf2-to-png)
- [HF2 to XYZ](https://beta.mygeodata.cloud/converter/hf2-to-xyz)
- [HF2 to AAIGrid](https://beta.mygeodata.cloud/converter/hf2-to-aaigrid)
- [HF2 to BMP](https://beta.mygeodata.cloud/converter/hf2-to-bmp)
- [HF2 to ENVI](https://beta.mygeodata.cloud/converter/hf2-to-envi)
- [HF2 to GIF](https://beta.mygeodata.cloud/converter/hf2-to-gif)
- [HF2 to GPKG raster](https://beta.mygeodata.cloud/converter/hf2-to-gpkg-raster)
- [HF2 to netCDF raster](https://beta.mygeodata.cloud/converter/hf2-to-netcdf-raster)

## Frequently asked questions

### What is the difference between HF2 and HFZ?

Both use the same internal structure. HFZ is simply an HF2 file wrapped in gzip compression, so it is smaller on disk and must be decompressed before some programs can read it.

### Why does my HF2 file have no coordinate system?

The coordinate reference system is stored only in optional extended header blocks. If the author did not include them, the file holds just a grid with horizontal scale, and you must assign the CRS manually after loading it.

### Does converting a DEM to HF2 lose accuracy?

Possibly. Each tile stores heights as integer steps scaled to the declared vertical precision, so values are rounded to that precision. A small precision value keeps more detail but results in a larger file.

### What is a HF2 file?

HF2 is a binary heightfield format designed by Bundysoft for terrain data exchange and is primarily associated with the L3DT terrain generation software. It stores digital elevation models for terrain modelling, game and simulation content, and visualisation. The .hfz extension denotes the same structure wrapped in gzip compression.

A file begins with a header containing the HF2 signature, grid dimensions, tile size, vertical precision and horizontal scale. Optional extended header blocks can carry georeferencing or projection information. The elevation grid is divided into square tiles. Each tile stores its own scale and offset, and heights are encoded as compact integer differences, so values are reconstructed as 32-bit floating point with quantisation limited to the declared vertical precision. This scheme makes files considerably smaller than raw floating-point grids. Only a single elevation band is supported, and coordinate reference system information is optional.

### How do I open a HF2 file?

HF2 files can be opened in L3DT, GDAL/OGR and QGIS. Without any software you can preview and convert them online in MyGeodata Cloud.

### What can I convert HF2 to?

Popular conversions are HFA, JPG, TIF, BIL, DEM and GeoPDF raster. In total the Converter writes HF2 data to 50 formats.

### How do I create a HF2 file?

Convert existing data to HF2 — for example from HFA, JPG, TIF, BIL and DEM. Upload the file, choose HF2 as output and download the result.

