Home / GIS and Open Map Data for Beginners

GeoJSON vs Shapefile: The Web Native Text Format Against the Desktop Veteran

Screen displaying COVID-19 cases and deaths statistics with map

Photo: Markus Spiske / Pexels

Every GIS beginner eventually stands at this fork: the data you downloaded is a shapefile, the tutorial you are following wants GeoJSON, and the two refuse to be interchangeable in ways nobody explained. They are both vector formats for points, lines, and polygons, but they come from different centuries of computing. The shapefile is Esri's early 1990s design, built for desktop software and floppy era constraints that still bind it today. GeoJSON is the web's answer, a JSON based format standardized as RFC 7946 in 2016. This comparison is about the structural differences that actually bite in projects, so you can choose per job instead of by habit.

Interactive map

Coordinate Explorer: X First, Then Y

Click any point and read its pair. On this map, as in GeoJSON, longitude behaves as x and latitude as y, longitude first. The order feels backwards to every map reader and is responsible for more misplaced data than any other single habit.

Decimal degrees40.689167, -74.044444
Latitude40.689167° N
Longitude74.044444° W
Degrees minutes seconds40° 41' 21.00" N, 74° 02' 40.00" W
Degrees decimal minutes40° 41.350' N, 74° 02.667' W
Plus code87G7MXQ4+M67

Map data © OpenStreetMap contributors. Coordinates are read from the map itself, in the WGS 84 system your phone uses.

The Shapefile: One Dataset, Many Files

The first surprise is that a "shapefile" is not a file. It is a bundle sharing one name: the .shp holds the geometry, the .shx is an index into it, and the .dbf holds the attribute table in an ancient database format. Delete or lose the .dbf and your shapes survive with no data attached; lose the .shx and most software refuses the set. A fourth file, .prj, records the coordinate system in plain text, and it is technically optional, which is why shapefiles so often arrive with their coordinate system unstated and their data silently misplaced by software that guesses. Zip the bundle to move it, always, and never rename one component without the rest.

Its limits are fossils of its era. Field names are capped at 10 characters, so "population_2020" becomes "population_" or worse, and two long names that share a ten character prefix collide. A shapefile holds at most 255 fields, one geometry type per file, points or lines or polygons, never mixed, and each component file has a 2 GB ceiling. Text fields truncate at 254 characters, dates carry no time, and there is no true null value, which corrupts empty numeric fields in ways that surface months later. It endures because everything reads it: three decades of government data, including most official boundary and infrastructure releases, exist as shapefiles, and fluency in its quirks remains a job skill. Our GeoJSON explainer covers the rival format's structure in depth, and open map data surveys where both formats are published.

GeoJSON: One File, Readable by Humans and Browsers

A GeoJSON file is a single text document you can open in any editor and read: a FeatureCollection of features, each with a geometry and a properties object of attributes. Properties accept any JSON values, nested objects and arrays included, with no field name length limit and no field count limit. The specification fixes the coordinate system as WGS 84, always, which removes the shapefile's guessing problem at the cost of flexibility: data in a local projected system must be reprojected to WGS 84 to be valid GeoJSON. Coordinates are written [longitude, latitude], longitude first, on x, y axis logic, the reverse of the order people speak, and the single most common GeoJSON bug is a swapped pair placing features in the ocean. The explorer above demonstrates the reading order on a live map: longitude behaves as x, latitude as y.

GeoJSON's costs are size and speed. Text is bulky; a dataset that is 50 MB as a shapefile can be several times larger as GeoJSON, and there is no built in spatial index, so software must read the whole file to find anything. For web maps, small open data releases, and APIs, those costs are trivial next to the convenience: a browser parses GeoJSON natively, and a developer can generate it from any database with a few lines of code. For continental scale data, the format strains, and the professionals reach for the third option below.

Head to Head

AxisShapefileGeoJSON
OriginEsri, early 1990sRFC 7946, 2016
Files per datasetThree or more (.shp, .shx, .dbf, .prj)One text file
Coordinate systemAny, recorded in .prj if presentWGS 84 only
Coordinate orderVaries by softwareLongitude, latitude
Field name limit10 charactersNone practical
Field count limit255None practical
Geometry types per fileOneMixed freely
Size ceiling2 GB per componentNone, but files get huge
Spatial indexSidecar index filesNone built in
Human readableNo, binaryYes, plain JSON text
Native web useNoYes

The Third Answer: GeoPackage

When a project outgrows both, the modern default is GeoPackage, an OGC standard that stores vector data in a single SQLite database file. It removes the shapefile's limits, unlimited field names, large sizes, mixed geometry, real nulls, and adds proper spatial indexes, while remaining one portable file like GeoJSON. QGIS, the free desktop GIS, now defaults to GeoPackage for new layers for exactly these reasons. The honest 2026 advice: receive data in whatever format it arrives, publish GeoJSON for the web and small releases, archive and work in GeoPackage, and keep shapefile literacy for the decades of official data that will keep arriving in it. Our QGIS tutorial for beginners starts you in the software where all three formats meet, and GIS for beginners maps the wider landscape these formats live in.

Which Should You Choose?

Choose GeoJSON when the destination is a web map, an API, a script, or a human who should be able to read the file, and the data is modest in size and already in WGS 84. Choose a shapefile when the destination is legacy desktop GIS, an official submission portal that demands it, or an archive of record in an organization built around it. Choose GeoPackage for your own working storage on any project bigger than a weekend. And whichever you choose, write the coordinate system and the coordinate order on the tin: most "format problems" in GIS are actually one of those two facts going missing in transit.

What Conversion Quietly Destroys

Formats convert into each other all day in GIS, and the round trips are where data goes to be damaged politely. Send a GeoJSON or GeoPackage layer out to shapefile and back, and three losses await. Field names longer than ten characters are truncated on the way into the shapefile and never recover on the way out, so "household_income_2020" returns as "household_" with its meaning amputated. Empty numeric fields, true nulls in the modern formats, become zeros in the shapefile's table, inventing data where there was an honest blank, a corruption that poisons averages downstream. And if the shapefile's .prj goes missing in a zip somewhere along the journey, the next conversion guesses the coordinate system, and a guessed system can move every feature by hundreds of meters without a single warning dialog. The professional habits follow directly: keep a master copy in a modern format and treat shapefiles as exports, never as the archive; check field names after every conversion; and open the converted layer on a map and compare it against the original before trusting it. Conversion is a photocopy, not a move, and data, like documents, should live in the original.

Sleek laptop showcasing data analytics and graphs on the screen in a bright room
Sleek laptop showcasing data analytics and graphs on the screen in a bright room

Conversion Damage, Continued: The Attribute Table Autopsy

If the general warning feels abstract, open any twice converted dataset and look at its table with these eyes. Sort a numeric column and watch the invented zeros from lost nulls gather at the top, silently dragging every average the project computes. Read the field names aloud and count how many end mid word, each one a small act of vandalism committed by a ten character limit from 1991. Check the record count against the original; format quirks around multipart geometries and null shapes have been quietly dropping features in conversions for decades, and nobody notices until a map looks thinner than the territory. None of this is an argument against the shapefile, which carried the world's geography on its back for thirty years and still arrives daily from agencies whose archives are built on it. It is an argument for the workflow this article recommends: originals in a modern format, shapefiles as honored guests rather than as the house.

A Decision in Thirty Seconds

When the fork arrives in a real project, three questions settle it faster than any comparison table. Where will the data be opened next: a browser, a phone, a web map library? Then GeoJSON, because those tools speak it natively and WGS 84 is their home system too. Who produced the data and in what form does it already live: an agency archive, a surveyor's export, a legacy system with a decade of shapefiles? Then receive it as it comes and convert deliberately, checking field names and coordinate systems after the move. And how long must the data live: a weekend visualization or a project's permanent record? Then GeoPackage for the record, whatever else it also becomes along the way. Formats are plumbing; these three questions are the water pressure, the building code, and the lease, and they have never yet failed to name the right pipe.

Related Guides

This guide does not stand alone. The GIS and open map data guides below take up the questions it leads into:

Frequently Asked Questions

Is a shapefile one file?

No. A shapefile dataset is a bundle of at least three files with the same base name: .shp for geometry, .shx as its index, and .dbf for attributes, usually plus a .prj recording the coordinate system. Losing any one breaks or guts the dataset, which is why shapefiles are shared as zip archives.

Why does GeoJSON write longitude before latitude?

Because GeoJSON follows the x, y axis convention of mathematics and screen coordinates: longitude is the horizontal x axis, latitude the vertical y. It is the reverse of the spoken "lat, long" order used by maps and GPS devices, and swapped coordinates are the most common GeoJSON error, typically landing features in the ocean.

What are the shapefile's hard limits?

Field names cap at 10 characters, a dataset holds at most 255 fields, only one geometry type per file, text fields truncate at 254 characters, there is no true null value, and each component file faces a 2 GB ceiling. These are 1990s database constraints that the format still enforces today.

Can GeoJSON store data in UTM or another projected system?

Not as valid GeoJSON. The RFC 7946 specification fixes the coordinate system as WGS 84 longitude and latitude. Data in a projected system such as UTM must be reprojected to WGS 84 to be correct GeoJSON; writing meter coordinates into a GeoJSON file produces data that every standard tool will misplace.

Which format is better for large datasets?

Neither is ideal. GeoJSON files balloon in size and have no spatial index, and shapefiles hit their 2 GB component ceilings. GeoPackage, a single SQLite based file with spatial indexes and no legacy limits, is the modern choice for large vector datasets, and QGIS defaults to it.

How do I convert between shapefile and GeoJSON?

In QGIS, load the layer, right click it, and use Export, then Save Features As, choosing the target format and, for GeoJSON, ensuring the coordinate system is WGS 84. Command line users use ogr2ogr from GDAL. Always verify the result on a map afterward: the conversion is exactly where coordinate order and missing .prj problems reveal themselves.

Photo credits: Markus Spiske (Pexels); Lukas Blazek (Pexels). Photos are served from this site; follow the credit to the library page for the original.