GIS File Formats: Shapefile, GeoJSON, GeoPackage, GeoTIFF, KML
Published
A GIS file format is a standard way to store geographic data, either geometric shapes or a grid of pixels plus the coordinates that place them on Earth, in a file other software can read. When we exported the same 3,403 building polygons of Annecy, France to five common vector formats, the output ranged from 1.74 MB in a single CSV file to 4.05 MB in KML, with the classic shapefile landing at 2.58 MB across five separate files.
Every format falls into one of two families, as our vector vs raster guide explains in detail. Vector formats store points, lines and polygons alongside a table of attributes, which makes them right for boundaries, roads and building footprints. Raster formats store a grid of cells, such as satellite imagery or an elevation model. Choosing the right format decides whether your colleague can open the file, whether column names get cut in half, and how fast the map draws.
2.58MB in 5 files
Shapefile for 3,403 buildings
2 GB limit per component file, 10-character field names
2.37MB in 1 file
GeoJSON for the same layer
Plain text, locked to WGS 84 longitude and latitude
1.85MB in 1 file
GeoPackage for the same layer
SQLite database, default format in QGIS

GIS file formats compared
Before looking at how each file is built inside, here is how the six formats you will meet most often when you start working with GIS compare on structure, coordinate systems and limits.
| Format | Extension | Type | Files per layer | CRS support | Documented size limit | Best for |
|---|---|---|---|---|---|---|
| Shapefile | .shp, .shx, .dbf (+ .prj, .cpg) | Vector | 3 to 7+ | Any (stored in .prj) | 2 GB per component file | Legacy software and public data portals |
| GeoJSON | .geojson, .json | Vector | 1 | WGS 84 (CRS84, lon/lat) | None in spec | Web maps and web APIs |
| GeoPackage | .gpkg | Vector and raster | 1 (holds many layers) | Any | 140 TB in spec (4 GB on FAT32 drives) | Desktop GIS work and file exchange |
| GeoTIFF | .tif, .tiff | Raster | 1 | Any (stored in TIFF tags) | 4 GB for classic TIFF, more with BigTIFF | Aerial imagery, elevation models, raster analysis |
| KML / KMZ | .kml, .kmz | Vector (can bundle images) | 1 | WGS 84 (lon/lat) | None in spec | Viewing in Google Earth |
| CSV with coordinates | .csv (+ optional .prj) | Vector (mostly points) | 1 | Any (not stored inside the CSV) | None in spec | Spreadsheets of points, geocoding inputs |
How we measured the file sizes. On 16 November 2026, using GDAL 3.12.4 through pyogrio 0.13.0 with default options, we wrote the same layer of 3,403 building polygons in Annecy, France (from IGN's BD TOPO, 8 attributes, 34,076 vertices) to each vector format. Using 1,048,576 bytes per MB, the outputs measured:
- KML (WGS 84): 4,251,540 bytes (4.05 MB) in 1 file.
- Shapefile (Lambert-93): 2,700,826 bytes (2.58 MB) across 5 files.
- GeoJSON (RFC 7946, WGS 84): 2,484,798 bytes (2.37 MB) in 1 file.
- GeoPackage (Lambert-93): 1,941,504 bytes (1.85 MB) in 1 file.
- CSV with WKT (WGS 84): 1,821,443 bytes (1.74 MB) in 1 file.
The order reflects how each format stores text and numbers. KML wraps XML tags around every coordinate list. The shapefile's .dbf table uses fixed-width records: GDAL gave each text field 80 characters, padding short words with spaces so every building row took 473 bytes, and BD TOPO buildings carry a height on every vertex, making the geometry PolygonZ. For the raster test, we exported a 640 by 400 cell elevation grid of the same Annecy area (5 m resolution, 32-bit floats): an uncompressed GeoTIFF took 1,025,166 bytes (0.98 MB), while DEFLATE compression shrank it to 428,433 bytes (0.41 MB) with no loss of precision. Sizes always depend on your data and export options, so treat this ranking as a typical result rather than a fixed law.
What is a shapefile (.shp, .shx, .dbf, .prj)?
A shapefile is an Esri vector format, documented in the ESRI Shapefile Technical Description (July 1998). Despite its singular name, a shapefile is never one file. It is a set of at least three required files that share the same base name, plus optional companion files.

On our 3,403 Annecy buildings, GDAL wrote five files totaling 2,700,826 bytes:
.shp(required, 1,063,136 bytes): stores the feature geometries. Under the 1998 specification, all non-null shapes in one shapefile must share the same shape type, so you cannot mix points, lines and polygons in one.shp..shx(required, 27,324 bytes): the positional index that lets software seek directly to any feature in the.shp. Its size is exact math: a 100-byte header plus 8 bytes for each of the 3,403 shapes..dbf(required, 1,609,909 bytes): a dBASE table holding the attributes, with one record per shape in the same order as the.shp..prj(optional, 452 bytes): stores the coordinate reference system as a Well-Known Text (WKT) string, here Lambert-93..cpg(optional, 5 bytes): declares the text encoding of the.dbffile. Ours contains the five-character stringUTF-8, which GDAL's shapefile driver reads to decode accented letters properly.- Other optional files: Esri software also writes
.sbnand.sbxfor spatial indexing and.xmlfor metadata.
Because its attribute table is a dBASE file, the shapefile carries strict limits documented in Esri's geoprocessing considerations for shapefile output:
- 10-character field names: any column name longer than 10 characters is cut off on export. On our Annecy BD TOPO export, GDAL cut four names:
nombre_d_etagesbecamenombre_d_e,altitude_minimale_solbecamealtitude_m,methode_d_acquisition_planimetriquebecamemethode_d_, anddate_modificationbecamedate_modif. When two long names share their first 10 characters, they collide, and GDAL renames one of them, for example by adding a number. - 2 GB size cap: Esri documents a 2 GB maximum for any component file, which holds roughly 70 million point features. GDAL notes that the format's 32-bit offsets could address more in theory, but advises staying under 2 GB for compatibility across software.
- Attribute limits: at most 255 fields; text fields hold at most 254 characters; date fields store the calendar date with no time of day; numbers are stored as character strings, so decimals can round; and there is no support for
NULLvalues (nulls are replaced, for example by0or a blank).
What is GeoJSON (.geojson)?
GeoJSON is a plain-text vector format built on JSON and standardized by the Internet Engineering Task Force in RFC 7946 (August 2016), following an earlier 2008 community specification. Everything lives in one .geojson or .json file that you can open in a text editor, compare in Git, or drop into our GeoJSON viewer.
Inside the file, a FeatureCollection holds an array of Feature objects, each pairing a properties dictionary with a geometry of type Point, LineString, Polygon, their Multi equivalents, or a GeometryCollection.
RFC 7946 locks the coordinate reference system of every compliant GeoJSON file to WGS 84 longitude and latitude in decimal degrees (OGC:CRS84), written in that exact order: longitude first, latitude second, with an optional third number for elevation in metres. That rule eliminates the missing-projection problem of shapefiles, and it makes GeoJSON the native language of web mapping libraries (MapLibre, Leaflet, OpenLayers) and web APIs.
The tradeoff is size and speed. Numbers are spelled out as characters and the file has no built-in spatial index, so software must parse the entire file from top to bottom, which gets slow on large datasets. To move between desktop and web workflows, use our shapefile to GeoJSON or GeoJSON to shapefile converters.
What is a GeoPackage (.gpkg)?
A GeoPackage is an open format defined by the OGC GeoPackage Encoding Standard (version 1.4.0) that stores spatial data inside a single SQLite database file ending in .gpkg. QGIS uses GeoPackage as its default format whenever you create or export a new vector layer.
Unlike a shapefile, one .gpkg file can hold many vector layers, raster tile pyramids and plain attribute tables at the same time, each with its own coordinate reference system and optional spatial index. Because it is built on SQLite, it has none of the dBASE flaws:
- Column names can be as long and descriptive as you want (
methode_d_acquisition_planimetriquestays intact). - Text fields exceed 254 characters, real
NULLvalues and timestamps work properly, and numbers are stored in binary without string rounding. - The specification supports files up to about 140 TB, though saving onto a FAT32-formatted USB stick or memory card still caps any individual file at 4 GB.
When to switch from shapefile to GeoPackage
Move your workflow to GeoPackage when any of these happen:
- A
.shpor.dbffile grows near the 2 GB limit. - Truncated 10-character field names break your scripts or make tables unreadable.
- You need real
NULLvalues, date-time fields, Unicode text without.cpgheadaches, or strings longer than 254 characters. - You want to bundle all the layers of a project (roads, parcels, buildings, lookup tables) into one file that cannot lose its
.shxor.prjin an email attachment.
Keep exporting a shapefile only when a client contract, a legacy CAD program, or a government upload portal explicitly demands .shp.
What is a GeoTIFF (.tif)?
A GeoTIFF is a raster file format standardized in the OGC GeoTIFF Standard 1.1 (2019). It is a standard .tif or .tiff image file with embedded metadata tags that tell GIS software the coordinate reference system, the ground size of each pixel, and the coordinates of the image corner.
Because a GeoTIFF stores raw numeric bands rather than just screen colors, it handles aerial photographs (RGB and near-infrared), digital elevation models (32-bit floating-point heights in metres), and land-cover grids alike. Classic TIFF uses 32-bit file offsets and hits a hard ceiling at 4 GB; the BigTIFF variant, which GDAL reads and writes, goes beyond 4 GB.
Two variants matter in practice:
- Lossless compression: enabling
DEFLATEorLZWcompression shrinks the file on disk without changing a single pixel value. On our 640 by 400 Annecy elevation grid,DEFLATEcut the file from 1,025,166 bytes to 428,433 bytes (58% smaller). - Cloud Optimized GeoTIFF (COG): a standard GeoTIFF organized so a client can read only the part it needs over the web. A web map or QGIS can then request just the area a user is looking at over HTTP, without downloading the whole image first.
KML, KMZ and CSV with coordinates
KML and KMZ. KML (Keyhole Markup Language), submitted by Google and adopted as the OGC KML 2.2 standard in April 2008, is an XML vector format built for displaying points, lines, polygons, 3D models and pop-up descriptions in Google Earth. A .kmz file is simply a zipped .kml that can bundle custom icon images alongside the geometry. Like GeoJSON, KML always uses WGS 84 longitude, latitude and optional altitude. Because XML repeats opening and closing tags around every feature, KML was the largest file in our Annecy benchmark at 4.05 MB. Read more in what a KML file is, preview files in the KML viewer, or convert them with KML to shapefile, shapefile to KML and KMZ to KML.
CSV with coordinates. A comma-separated values (.csv) file or Excel spreadsheet becomes a GIS layer when it includes two columns for longitude and latitude (or X and Y in metres), or a single column holding a Well-Known Text geometry such as POINT (6.1258 45.8988). On our Annecy polygons, a CSV with a WKT column was the smallest file of all at 1.74 MB, because it stores each building as one line of text with very little markup. However, a CSV carries no spatial index and no internal CRS definition. GDAL's CSV driver can read X/Y or WKT columns and write an accompanying .prj file, or you can convert point tables directly with CSV to shapefile and CSV to GeoJSON.
Other GIS formats you will meet
Beyond the main six, specialized domains rely on eight other formats:
- GPX (
.gpx): an XML schema for GPS waypoints, routes and recorded tracks from handheld receivers and sports watches. - FlatGeobuf (
.fgb): a compact binary vector format with a built-in spatial index designed for streaming large vector layers over the web. - GeoParquet (
.parquet): a columnar vector format built on Apache Parquet for cloud data warehouses and multi-gigabyte spatial analytics. - Esri File Geodatabase (
.gdb): a folder of binary files used as Esri's native format in ArcGIS Pro, readable in QGIS via GDAL. - NetCDF (
.nc): a multidimensional array format used in climate science and oceanography for grids that vary across space, depth and time. - JPEG 2000 (
.jp2): a wavelet-compressed raster format used to distribute Copernicus Sentinel-2 satellite bands. - DXF and DWG (
.dxf,.dwg): CAD drawing formats from AutoCAD, often lacking a declared CRS and holding lines on named layers rather than GIS feature tables. - LAS and LAZ (
.las,.laz): the standard binary format (and its compressed twin) for 3D LiDAR point clouds.
Which GIS format should you use?
Pick the format that matches where the data is going next:
| Your task | Format to pick | Why |
|---|---|---|
| Save and share layers in desktop GIS | GeoPackage (.gpkg) | One file, no 10-character truncation, holds multiple layers, fast spatial index |
| Build a web map or send data to an API | GeoJSON (.geojson) | Native to JavaScript and browsers, fixed to WGS 84 |
Deliver to a client or portal asking for .shp | Shapefile (.shp zip) | Universal backward compatibility with older GIS and CAD tools |
| Show placemarks and styles in Google Earth | KML or KMZ (.kml, .kmz) | Carries folder trees, icons, camera tilts and HTML pop-ups |
| Geocode addresses or share a table of points | CSV (.csv) | Opens in Excel, Python and every database |
| Store orthophotos, DEMs or raster outputs | GeoTIFF (.tif) or COG | Preserves exact pixel values, CRS tags and lossless compression |
How to open and convert GIS file formats
You do not need a commercial license to inspect or convert any of these files.
Open or convert in your browser
For a quick check without installing software, drop your file into our free shapefile viewer, GeoJSON viewer or KML viewer. To switch formats on the spot, use shapefile to GeoJSON, KML to shapefile or CSV to GeoJSON.
Drag and drop into QGIS
Open QGIS and drag a
.gpkg,.geojson,.tif,.kml, or the.shpfile from an unzipped shapefile folder directly onto the map canvas. Right-click the layer and choose Export > Save Features As... (or Save Raster Layer As...) to convert it to any other format and reproject it at the same time. If a shapefile arrived without its.prjfile and lands in the wrong place, check what a CRS is and find the right code in our CRS lookup.Batch-convert on the command line with ogr2ogr
When you have a hundred files to convert or want to automate a pipeline, GDAL's
ogr2ogrutility converts between vector formats in one command (for example,ogr2ogr -f GPKG buildings.gpkg buildings.shp). Use our ogr2ogr command builder to generate the exact flags for reprojection, filtering and layer naming.
Inside QGIS, AI Agent, the plugin we build, can also load, reproject and export layers between these formats from a plain sentence, such as asking it to merge a folder of shapefiles into a single GeoPackage in your national CRS.
Read nextVector vs Raster Data in GIS: Differences, Formats, When to Use
Questions people ask
For vector data, the Esri shapefile (.shp, .shx, .dbf) is still widely used to exchange data, while GeoPackage (.gpkg) is the default format in modern desktop GIS such as QGIS and GeoJSON (.geojson) is the standard for web maps. For raster data like satellite imagery and elevation models, GeoTIFF (.tif) is the universal standard.
Every shapefile requires three files sharing the same name in the same folder: .shp for the feature geometries, .shx for the positional index, and .dbf for the dBASE attribute table. Many shapefiles also include an optional .prj file that defines the coordinate reference system and a .cpg file that declares the text encoding such as UTF-8.
A shapefile is a multi-file binary vector format from Esri that supports any coordinate reference system but caps component files at 2 GB and cuts field names to 10 characters. GeoJSON (RFC 7946) is a single plain-text JSON file fixed to WGS 84 longitude and latitude (CRS84), with no field-name limit, designed for web maps and APIs. On our 3,403-building test layer, the shapefile took 2.58 MB across 5 files and the GeoJSON took 2.37 MB in 1 file.
For nearly all desktop GIS work, yes. A GeoPackage (.gpkg) stores multiple vector and raster layers inside a single SQLite file, keeps full column names instead of cutting them at 10 characters, supports real NULL values and timestamps, and scales up to 140 TB instead of 2 GB. Use a shapefile only when older receiving software cannot read .gpkg.
A GeoTIFF (.tif or .tiff) is a raster image file that embeds georeferencing tags, including the coordinate reference system, pixel resolution and ground coordinates, inside a standard TIFF header. GIS software uses GeoTIFFs for aerial imagery, satellite bands and digital elevation grids, and lossless compression like DEFLATE shrinks them without changing any pixel value: in our test, an elevation grid dropped to 42% of its uncompressed size.
Yes. You can drag the .shp file (alongside its .shx and .dbf files) into QGIS, which is free and open-source on Windows, macOS and Linux, or open the zipped shapefile directly in your browser with our free shapefile viewer.
The .prj file is optional: Esri's documentation lists only the .shp, .shx and .dbf as required, so older exports or CAD conversions sometimes leave it out. Without .prj, GIS software knows the coordinate numbers in the .shp file but does not know which coordinate reference system they belong to, so you must assign the layer's original CRS in QGIS before it will line up with a basemap.
Do it in QGIS by asking for it
AI Agent carries out the task you describe, in your own QGIS project. Free, no card.


