GeoJSON vs KML vs WKT vs Shapefile: Which Format Should You Use?
Compare the four most common vector GIS formats — GeoJSON, KML, WKT and Shapefile — and learn which to pick for web maps, Google Earth, databases and data exchange.
GeoJSON — the web default
GeoJSON is plain JSON with a spatial schema. Every mapping library reads it, it diffs cleanly in Git, and it is trivially readable by humans and scripts alike.
By specification GeoJSON uses WGS84 longitude/latitude order. Keep it that way: writing projected coordinates into a GeoJSON file is the single most common cause of broken web maps.
- Best for: web maps, APIs, version-controlled datasets
- Weak at: very large datasets (file size), styling metadata
KML — presentation and Google Earth
KML is XML designed around presentation: folders, styles, icons, descriptions, time spans and 3D altitude. If the deliverable is something a stakeholder opens in Google Earth and clicks through, KML is the right answer.
KMZ is simply a zipped KML, often bundling icons and overlays.
- Best for: sharing with non-GIS users, styled presentation, Google Earth
- Weak at: analysis pipelines, compact storage
WKT — geometry as text
Well-Known Text encodes a single geometry as a compact string, e.g. POINT (77.21 28.61) or POLYGON ((...)). It carries no attributes and no styling, which is exactly why databases love it.
You will meet WKT most often when pasting geometry into PostGIS, BigQuery, Snowflake or a spatial SQL console.
- Best for: databases, SQL, quick copy-paste of one geometry
- Weak at: whole datasets, attributes, styling
Shapefile — the stubborn standard
A Shapefile is not one file: .shp, .shx and .dbf are mandatory, and .prj carries the coordinate system. Miss the .prj and nobody knows where your data is.
It remains the lingua franca of government and consultancy data exchange despite real limits: 2 GB per file, 10-character field names, and no support for mixed geometry types.
- Best for: exchanging data with agencies and legacy desktop GIS
- Weak at: web use, long field names, single-file delivery
A quick decision rule
Publishing to the web → GeoJSON. Sending to a colleague who will open Google Earth → KML. Pasting into a database → WKT. Satisfying a formal data-submission requirement → Shapefile (with the .prj).
Whichever you start from, convert in the browser rather than emailing files around: the Format Converter handles GeoJSON, KML and WKT in both directions.