# Convert DEM to HF2

> To convert DEM (USGS ASCII DEM (and CDED)) to HF2 (HF2/HFZ Heightfield), upload the DEM data to the MyGeodata Cloud Converter, select HF2 as the output format and download the result — online, without installing GIS software.

- Page: https://beta.mygeodata.cloud/converter/dem-to-hf2
- Open the Converter: https://beta.mygeodata.cloud/tools/converter/?format=hf2
- Input: USGS ASCII DEM (and CDED) (DEM, .dem)
- Output: HF2/HFZ Heightfield (HF2, .hf2, .hfz)

## What happens when you convert DEM to HF2

- **Keep or change the coordinate system** — The coordinate system of your DEM data is detected automatically. Keep it, or reproject the HF2 output to any of 11,000+ coordinate systems (EPSG, ESRI, IGNF).
- **Pixel types in HF2** — HF2 supports 32-bit float (scaled). Values that do not fit the output type are reported before the conversion.
- **Bands** — Single-band elevation.
- **Compression** — HF2 uses: None, gzip (.hfz).
- **Reprojection with resampling** — When you change the coordinate system, the raster is warped and resampled; the original pixels stay untouched if you keep it.

## Convert DEM to HF2 in 4 steps

1. **Upload your DEM data** — Drag and drop your DEM file into the Converter — or several files at once.
2. **Check the input** — The Converter detects layers, attributes and the coordinate system and shows an overview. If the coordinate system is missing, you can assign it.
3. **Choose HF2 and options** — Select HF2 as the output format. Keep the coordinate system or pick another one. Optional settings let you pick layers, attributes and HF2-specific options.
4. **Download the result** — See the price in credits before you start, run the conversion and download the HF2 result.

## DEM vs. HF2 — technical comparison

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

## What is DEM?

The USGS ASCII DEM format was developed by the U.S. Geological Survey to distribute digital elevation models, most commonly 7.5-minute quadrangles in UTM coordinates and 1-degree blocks in geographic coordinates. Natural Resources Canada distributed Canadian Digital Elevation Data (CDED) in the same format. Although these products have largely been superseded by newer elevation datasets, the format is still encountered in archives and older projects.

A file is organised into logical records stored in fixed-length blocks. Record A is a header describing the quadrangle, projection, horizontal datum, units, ground resolution and elevation scaling. Type B records hold the elevations as profiles running from south to north, and an optional Record C reports accuracy statistics. Elevations are stored as integers that are scaled by a header factor, and the units can be metres or feet. The format holds a single band. It is plain ASCII but uses Fortran-style numeric formatting, which makes it awkward to edit by hand.

## What is HF2?

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.

## Free sample DEM files

- [Elevation (30 m, UTM)](https://beta.mygeodata.cloud/static/landing/samples/v1/usgsdem/st-helena-dem.dem) — Copernicus DEM GLO-30 elevation model of Saint Helena (0–812 m), a surface model including trees and buildings; sea = 0 m. Resampled to 30 m in UTM zone 30S (604×508 px). USGS DEM (ASCII, Int16). (2.4 MB)

## Frequently asked questions

### How do I convert DEM to HF2?

Open the Converter, drop your DEM files, check the detected layers and coordinate system, choose HF2 as the output and download the result. Everything runs in your browser — there is no software to install.

### Is the DEM to HF2 conversion free?

Everyone gets 3 free credits every 30 days and a small conversion costs from 1 credits, so occasional conversions are free. Bigger or frequent jobs are paid with credit packs (from $2.00) or a monthly plan (from $10.00).

### Can I change the coordinate system during the conversion?

Yes. Keep the original coordinate system or choose another one — the Converter supports 11,000+ coordinate systems, including national grids such as S-JTSK, British National Grid or RD New.

### How large can my DEM files be?

Without an account you can upload up to 2 GB per file. Signed-in users with a verified e-mail can upload much larger datasets; big jobs run on scalable cloud workers.

### Is my data safe?

Files are transferred over HTTPS and processed in an isolated cloud environment. Without an account they are stored only temporarily and deleted automatically; with an account they stay in your private Data workspace until you delete them.

### Can I automate the DEM to HF2 conversion?

Yes. The same conversion is available through the GeoCzech API — send the DEM files with the output format "hf2" and download the HF2 result from a script or an ETL pipeline. API access is part of the Basic, Standard and Premium plans.

## Related conversions

- [DEM to TIF](https://beta.mygeodata.cloud/converter/dem-to-tif)
- [DEM to JPG](https://beta.mygeodata.cloud/converter/dem-to-jpg)
- [DEM to PNG](https://beta.mygeodata.cloud/converter/dem-to-png)
- [DEM to KMZ raster](https://beta.mygeodata.cloud/converter/dem-to-kmz-raster)
- [DEM to HFA](https://beta.mygeodata.cloud/converter/dem-to-hfa)
- [DEM to XYZ](https://beta.mygeodata.cloud/converter/dem-to-xyz)
- [DEM to GRD](https://beta.mygeodata.cloud/converter/dem-to-grd)
- [DEM to MBTiles raster](https://beta.mygeodata.cloud/converter/dem-to-mbtiles-raster)
- [DEM to GeoPDF raster](https://beta.mygeodata.cloud/converter/dem-to-geopdf-raster)
- [DEM to JP2](https://beta.mygeodata.cloud/converter/dem-to-jp2)
- [DEM to BIL](https://beta.mygeodata.cloud/converter/dem-to-bil)
- [DEM to netCDF raster](https://beta.mygeodata.cloud/converter/dem-to-netcdf-raster)
- [HFA to HF2](https://beta.mygeodata.cloud/converter/hfa-to-hf2)
- [JPG to HF2](https://beta.mygeodata.cloud/converter/jpg-to-hf2)
- [TIF to HF2](https://beta.mygeodata.cloud/converter/tif-to-hf2)
- [BIL to HF2](https://beta.mygeodata.cloud/converter/bil-to-hf2)
- [GeoPDF raster to HF2](https://beta.mygeodata.cloud/converter/geopdf-raster-to-hf2)
- [GRD to HF2](https://beta.mygeodata.cloud/converter/grd-to-hf2)
- [HGT to HF2](https://beta.mygeodata.cloud/converter/hgt-to-hf2)
- [JP2 to HF2](https://beta.mygeodata.cloud/converter/jp2-to-hf2)
- [KMZ raster to HF2](https://beta.mygeodata.cloud/converter/kmz-raster-to-hf2)
- [MBTiles raster to HF2](https://beta.mygeodata.cloud/converter/mbtiles-raster-to-hf2)
- [PNG to HF2](https://beta.mygeodata.cloud/converter/png-to-hf2)
- [XYZ to HF2](https://beta.mygeodata.cloud/converter/xyz-to-hf2)

