Data & formats · 11 min read

Map File Formats Explained: Shapefile, GeoJSON, KML & More

What Shapefile, GeoJSON, KML/KMZ, GPX, CSV, Esri JSON and GeoPackage are, how they differ, and which to use for web maps, GIS, GPS and spreadsheets.

Updated · by the mapbow team

Geographic data comes in a confusing alphabet soup of formats. The good news: for almost every job, one or two are clearly the right choice. This guide explains the formats you will meet most often, what each is good and bad at, and which to pick.

Quick comparison

FormatExtensionGeometryStylingBest forIn mapbow
GeoJSON.geojson / .jsonMixed in one fileNo (data only)Web maps, apps, codeImport and export
Shapefile.shp + .shx + .dbf + .prjOne type per fileNoExchanging with desktop GISImport (zipped) and export
KML / KMZ.kml / .kmzMixedYesGoogle Earth, sharing styled placesImport and export
GPX.gpxPoints, tracks, routesNoGPS devices and fitness appsImport and export
CSV / TSV.csv / .tsv / .txtPoints (lat/lon) or WKT textNoSpreadsheets, databasesImport; export as CSV
Excel.xlsxPoints (lat/lon), addresses or WKT textNoLists kept in spreadsheetsImport
Esri JSON.jsonOne type per FeatureSetOptionalArcGIS tools and APIsExport
GeoPackage.gpkgMany layers, any typeOptionalModern desktop GIS, large dataNot supported – convert first

GeoJSON

GeoJSON is a plain-text JSON format for points, lines and polygons with attributes. It is the native language of web maps and most programming libraries.

  • Pros: one human-readable file; mixed geometry types; UTF-8 text with no field-name limits; supported everywhere.
  • Cons: larger than binary formats; no styling; always longitude/latitude (WGS 84).
  • Remember: coordinates are [longitude, latitude] – the reverse of how people usually say them.

Shapefile

The Esri Shapefile dates from the early 1990s and is still the most widely accepted GIS exchange format. A "shapefile" is really a set of files with the same name:

  • .shp – the geometry; .shx – an index; .dbf – the attribute table; .prj – the coordinate system; .cpg – the text encoding.
  • Pros: opens in virtually every GIS.
  • Cons: one geometry type per file; field names of 10 characters or fewer; text fields up to 254 characters; a 2 GB size limit; several files to keep together (so they are usually zipped).

KML and KMZ

KML (Keyhole Markup Language) is an XML format made popular by Google Earth. KMZ is simply a zipped KML, often with icons and images inside.

  • Pros: carries styling (colours, icons, popups); opens in Google Earth with a double-click.
  • Cons: verbose; weaker for attribute-heavy data; styling options vary between apps.

GPX

GPX (GPS Exchange Format) stores waypoints, tracks and routes. It is what GPS units, sports watches and hiking apps import and export.

  • Pros: universal for GPS; supports elevation and time per point.
  • Cons: no polygons; minimal attributes.

CSV and Excel

A spreadsheet of rows and columns. For points, include latitude and longitude columns; for lines and polygons, geometry can be written as WKT text (for example POLYGON((…))). Tab-separated files (.tsv or .txt) and Excel workbooks (.xlsx) work the same way – and for maps, a column of street addresses can stand in for coordinates, as long as the tool can geocode them.

  • Pros: opens in Excel and Google Sheets; easy to edit; perfect for addresses and point lists.
  • Cons: no standard for geometry beyond lat/lon; no coordinate system information.

Esri JSON

The JSON format used by ArcGIS services and APIs. A FeatureSet holds features of one geometry type with a spatial reference. Use it when feeding ArcGIS tools such as JSON To Features.

GeoPackage

GeoPackage is an open standard built on a single SQLite database file that can hold many vector layers, rasters and styles. It is the modern replacement for shapefiles in QGIS and is increasingly supported elsewhere. If your tool reads it, it avoids nearly every Shapefile limitation.

Which should I use?

I want to…Use
Put data on a web map or use it in codeGeoJSON
Send data to someone using ArcGIS or an older GISShapefile (zipped)
Work in QGIS with styling preservedQGIS project (or GeoPackage, if your tool writes it)
Open places in Google EarthKML / KMZ
Load a route onto a GPS or watchGPX
Edit attributes in a spreadsheetCSV (Excel .xlsx also imports)

Formats in mapbow

Importing

You can import CSV, TSV, TXT, Excel (.xlsx), GeoJSON (.geojson or .json), KML, KMZ, GPX and zipped Shapefiles (a .zip with the .shp and .dbf, in WGS 84 or Web Mercator) into any map for free – imports never use one of your data layer slots. Open Import in the studio and drop or choose the file, or drop it anywhere on the map. Spreadsheet rows can also be copied and pasted straight in, and a plain list of addresses can go in the Addresses box.

For spreadsheets, a dialog previews the first rows and asks where the locations are: Latitude & longitude (columns named lat/lng, latitude/longitude or x/y are found automatically), Addresses, or WKT geometry for a column of POINT, LINESTRING or POLYGON text. You also pick the name column and the layer name. The Excel and CSV import guide walks through it, and the plot locations tool is a quick way in.

The import dialog previewing an Excel file of coffee stores, with the latitude and longitude columns found automatically.
Import An Excel file read in the browser: the dialog previews the rows and finds the lat/lng columns.

GeoPackage, Esri JSON and other formats are not imported directly. Open them in QGIS and save the layer as GeoJSON or a zipped Shapefile first, reprojecting anything in a local coordinate system to WGS 84 at the same time.

Exporting

With any purchase you can export to PNG, PDF, CSV, GeoJSON, KML, KMZ, GPX, Shapefile, ArcGIS (Esri JSON), a QGIS project and a standalone web page (HTML). Press Export in the top bar and pick the format; the file is made in your browser from the visible layers on the map. See the export guide for opening the files in QGIS and ArcGIS.

The Export your map dialog listing PNG, PDF, CSV, GeoJSON, KML, KMZ, GPX, Shapefile, ArcGIS, QGIS project and web page formats.
Export Eleven formats in one dialog, from images and spreadsheets to Shapefile, ArcGIS and QGIS.

Import a file now

Coordinate systems in one minute

Every geographic file stores coordinates in some coordinate reference system (CRS). The most common is WGS 84 (EPSG:4326) – longitude and latitude in degrees, as used by GPS. Web maps display data in Web Mercator (EPSG:3857), and national mapping agencies use local projected systems in metres (such as UTM zones or national grids) for accurate measurement. GeoJSON is always WGS 84; Shapefiles describe their CRS in the .prj file; CSV files usually assume WGS 84 latitude/longitude but don't say so. mapbow reads zipped Shapefiles in WGS 84 or Web Mercator and writes every export in WGS 84.

Text encoding

Place names use every alphabet on earth. GeoJSON, KML and GPX are UTF-8 by default. Shapefiles store text in the .dbf, whose encoding is declared by the .cpg file – without it, accented and non-Latin names can turn into garbled characters. If you open a CSV in Excel and names look wrong, import it via Data → From Text/CSV and choose UTF-8.

File size and performance

FormatRelative sizeTypical use in practice
GeoJSONLarge (text)Fine in web maps up to hundreds of thousands of points
ShapefileMedium (binary)Desktop GIS; converted for the web
KMLVery large (verbose XML)Best for small, styled sets
GeoPackageCompact (database)Desktop GIS, large data
CSVSmall for pointsSpreadsheets and point lists

Compressing helps a lot: GeoJSON typically shrinks to a fifth of its size or less when zipped or gzipped.

Frequently asked questions

What is the difference between a shapefile and GeoJSON?

A shapefile is a set of binary files with one geometry type and short field names, accepted by almost every GIS. GeoJSON is a single text file that can mix geometry types and has no field-name limits; it is the standard for web maps.

Can I convert KML to shapefile?

Yes. Import the KML (or KMZ) into mapbow, then export as Shapefile (exports unlock with any purchase). QGIS can also convert between formats.

Can I put an Excel file on a map?

Yes. mapbow imports .xlsx files directly – no need to save as CSV first. Columns with latitude and longitude, addresses or WKT geometry all work.

Can mapbow open a GeoPackage?

Not directly. Open the .gpkg in QGIS, save the layer as GeoJSON or a zipped Shapefile in WGS 84, and import that.

Why does my shapefile have several files?

Geometry, index, attributes and projection are stored separately. Keep them together – zipping them is the easiest way.

What coordinate system should I use?

WGS 84 (EPSG:4326) longitude/latitude for exchange and web maps. Reproject to a local projected system for precise measurement in GIS.

Is GPX the same as KML?

No. GPX is for GPS waypoints and tracks; KML is a general, styled format for Google Earth and other viewers.

Keep reading

Free to start · no sign-up

Your map is two minutes away

Pick a country, add the places that matter, draw on it, and share it with the world - on any device.