GIS File Formats Explained — SHP, GeoJSON, KML, GPKG and GeoTIFF
Work in GIS for a week and the same dataset will reach you as .shp, .geojson, .kml and .gpkg in turn. Knowing which to use, and what gets dropped when you convert, prevents a whole category of avoidable mistakes. This guide covers only the formats you actually meet in practice — how they differ, where each belongs, and what conversion costs.
The one-page version
GIS files split into vector (point/line/polygon geometry plus an attribute table) and raster (a grid of pixel values). Knowing which one you were handed solves half the problem.
| Extension | Kind | In one line |
|---|---|---|
.shp(+.shx .dbf .prj) | Vector | Most widely used, but a file set with real limits |
.gpkg | Vector + raster | The recommended format — one file, UTF-8, many layers |
.geojson .json | Vector | Plain text, easy to handle, bulky, CRS is fixed |
.kml .kmz | Vector | For Google Earth — lat/lon only, carries styling |
.csv | Vector (points) | Needs coordinate columns to become a map |
.dxf .dwg | Vector (CAD) | Drawings — usually no CRS and no attributes |
.tif .tiff | Raster | GeoTIFF — the standard for imagery and DEMs |
.asc | Raster | Text grid — DEM exchange, very bulky |
Vector formats — what to use when
Shapefile (.shp)
A 1990s format that is still the de facto standard for public data distribution. It is not one file but a set of at least four — .shp .shx .dbf .prj — so copying only the .shp gets you nothing. The structure and the mangled-text problem are covered separately in how to open a SHP file.
Three limits are worth remembering: attribute names cap at 10 characters (which is why public datasets are full of cryptic abbreviations), 2 GB per file, and one geometry type per file. On top of that the .dbf does not record its own text encoding, so non-ASCII attributes break easily.
GeoPackage (.gpkg) — use this for anything new
An OGC standard that is a SQLite database inside. None of the Shapefile limits apply.
- One file — nothing to zip before sending
- Always UTF-8 — the encoding problem cannot occur by construction
- Many layers in one file, and vector and raster can coexist
- No practical limit on attribute name length or file size
The only drawback: older software and some delivery specifications still accept Shapefile only. So a common pattern is work in GeoPackage, deliver as Shapefile.
GeoJSON (.geojson)
Plain JSON text, so it opens in any editor and dominates web maps and APIs. It also diffs well, which makes it pleasant to keep in git.
EPSG:4326. Writing projected coordinates straight into GeoJSON produces an out-of-spec file that other tools will place in the wrong part of the world. Reproject to lat/lon before exporting GeoJSON.Being text also makes it large. Each coordinate costs a dozen or so characters, so a detailed national boundary set can run into hundreds of megabytes. GeoPackage is the better choice at that size.
KML and KMZ (.kml .kmz)
Google Earth's format. A .kmz is simply a zipped .kml — rename it to .zip and you will find the .kml and its icon images inside.
Like GeoJSON it is lat/lon only, but unlike it, KML carries styling — line colours, fills, icons — inside the file. That makes it convenient for showing results and awkward for analysis, since the attribute table is not really a table. If you need to analyse data you received as KML, convert it to GeoPackage or Shapefile first.
CSV — check for coordinate columns first
A spreadsheet export is not a map file on its own. It needs longitude and latitude (or X and Y) columns before it can be plotted. Three common traps:
- Swapped columns — putting latitude where longitude belongs moves everything to the wrong hemisphere. Compare the ranges: latitude never exceeds 90, longitude goes to 180.
- Degrees-minutes-seconds — values written as degrees, minutes and seconds must be converted to decimal degrees.
- Encoding — if non-ASCII text is garbled, try UTF-8 and the local legacy codepage in turn.
DXF and DWG — CAD drawings
These arrive from surveyors and designers. The usual blocker is that they carry no CRS and no attributes. A line in a drawing is just "a line on some layer"; what it represents is often a separate floating text object rather than a field.
So working with a DXF normally means filtering by layer name and assigning the CRS by hand. .dwg is AutoCAD's proprietary format, so ask for .dxf when requesting an exchange file.
Raster formats
GeoTIFF (.tif)
Nearly all satellite imagery, drone orthomosaics and DEMs use this. It is an ordinary TIFF with georeferencing stored in tags, which is why a basic image viewer will still show the picture (and silently ignore the position).
Three things to check: band count (3 for RGB, more for multispectral), data type (integer or floating point — results like NDVI must be float), and the NoData value (how empty areas are marked — get this wrong and blank margins enter your statistics as zeros).
COG — for large imagery
A Cloud Optimized GeoTIFF is a GeoTIFF with internal tiling and reduced-resolution overviews. It is still a valid GeoTIFF, so anything can open it, but readers can fetch just the part they need — which means a multi-gigabyte scene can be displayed without downloading all of it. If imagery will be served over the web, build it as COG.
.asc and world files
.asc (ASCII Grid) writes grid values out as plain numbers. It shows up in DEM exchange and is several times larger than the same data as GeoTIFF; convert on arrival.
If a JPG or PNG sits next to a small .jgw, .pgw or .wld file, that is a world file. The image itself has no coordinates, so the position lives in the sidecar — move both together or the georeferencing is lost.
What disappears when you convert
Change format and anything the target cannot represent is dropped without warning. The losses you will actually hit:
| Converting | What is lost |
|---|---|
| GeoPackage → Shapefile | Attribute names over 10 characters (truncated), multiple layers (split into files), date/time precision |
| Anything → GeoJSON | The original CRS (becomes lat/lon), styling |
| Anything → KML | Attribute table structure (collapsed into a description field) |
| GeoTIFF → JPG/PNG | CRS (without a world file), decimal values (crushed to integers), NoData distinction |
| Vector → raster | Exact boundaries (stair-stepped to the cell size), all attributes but one |
So which one
- Working and archiving → GeoPackage (
.gpkg). The fewest things to think about. - Handing off to web or API → GeoJSON, after reprojecting to lat/lon.
- Formal delivery → exactly what the specification says. Usually Shapefile, often with a mandated CRS.
- Showing someone a result → KMZ, or an image or PDF.
- Imagery and DEMs → GeoTIFF; COG if large.
Formats cause fewer accidents than coordinate systems do. Get the format right and the CRS wrong, and every position and area is still off. Read the CRS guide and the area calculation guide alongside this one.