Every SAGA GIS grid on disk is actually three files wearing one name. If you have ever tried to open a SAGA grid in another program and watched it fail — or opened it and got a blank — you have met the triplet: .sgrd, .sdat and .mgrd. This guide explains what each file does, which one each program wants, and how to move SAGA grids into GeoTIFF and the wider GIS world without breaking them.
The triplet, file by file
The .sgrd file is the header — a small text descriptor that records the grid’s dimensions, cell size, position, data type, no-data value and where the actual numbers live. This is the file you open inside SAGA itself: SAGA reads the header, follows it to the data, and presents the grid. It is tiny because it contains no elevation or raster values at all.
The .sdat file is the data — the binary payload holding every cell value, in the order and type the header describes. It is the big file, and it is the one the rest of the geospatial world reads: GDAL, and therefore QGIS and most other software that can open SAGA grids at all, opens the .sdat file, using the header alongside it to interpret the bytes.
The .mgrd file is the metadata — a companion that records the grid’s history and description: where the grid came from and what has been done to it. SAGA maintains it automatically. Losing it is not fatal to the data, but it erases provenance you may later want, so treat it as part of the grid.
The classic confusion
The single most common SAGA file problem is also the simplest: opening the .sgrd file in software that is not SAGA. A colleague sends you “the DEM”, you point QGIS or a script at the .sgrd, and you get an error or an empty layer — because the header contains no data to display. The fix is not a conversion; it is choosing the right sibling. In other software, open the .sdat. Inside SAGA, open the .sgrd. Same grid, two doors, each labelled for a different visitor.
The confusion echoes in the QGIS world, where SAGA tools run through the NextGen provider write their results natively — and users go looking for the output in the wrong file of the pair. Our hub on SAGA GIS in QGIS and the troubleshooting page on the NextGen provider not working both return to this point: check whether you are holding the header or the data before you conclude a file is broken.
Rule one: keep the three together
Because the header points at the data by name, a SAGA grid survives only as a set. Copy, move, rename, back up or email a grid, and all three files travel together, with the same base name. Rename the .sdat on its own and the header will look for a data file that no longer exists; send a collaborator only the .sgrd and you have sent them a table of contents with no book. The same discipline applies to SAGA projects (.sprj files), which reference grids rather than containing them.
Converting a SAGA grid to GeoTIFF
GeoTIFF is the lingua franca for sharing grids, and there are two straightforward routes out of the native format. The first stays inside SAGA: load the grid (via its .sgrd), then use SAGA’s grid export — SAGA imports and exports grids through GDAL, so a loaded grid can be written out to a GeoTIFF file that any GIS can read directly. Choose this route when you are already working in SAGA and want the export to be one step in a documented session.
The second route goes through QGIS: open the grid’s .sdat file as a raster layer — QGIS reads it through GDAL — check that it displays with the right extent and value range, and then use the layer’s export (“Save Raster As…” style export) to write a GeoTIFF. This route is convenient when the grid is headed for a QGIS project anyway. Whichever route you take, verify the result the same way: open the GeoTIFF fresh, confirm the dimensions, cell size, coordinate system and a few spot values against the source grid. The value range is the quickest smoke test — an export whose maximum and minimum match the original has almost certainly carried the data across intact.
Going the other way — a GeoTIFF into SAGA — is equally ordinary: import the file through SAGA’s GDAL-based grid import, and SAGA creates its own native triplet for the working copy. Nothing about the triplet is a lock-in; it is simply SAGA’s house style, and converting in and out is a normal, lossless part of mixed-software workflows such as those in our beginner’s guided tour.
Quick reference
- Open in SAGA: the
.sgrdfile. - Open in QGIS / GDAL / other software: the
.sdatfile. - Provenance and history: the
.mgrdfile — keep it with the pair. - Moving or sharing a grid: all three files, same base name, same folder.
- Sharing outside the SAGA world: export a GeoTIFF and verify extents and value range.
Once the triplet stops looking like three mysterious files and starts reading as header, data and history, SAGA’s file handling becomes predictable — and the “corrupt grid” that brought many users to this page turns out to be a healthy grid opened by the wrong door.
