If you’re working with spatial data, you’ve probably come across both shapefiles and GeoJSON.
They’re two of the most common formats used to store and share geographic data.
But which one is better?
That depends on what you’re doing. Let’s break it down.
Feature | Shapefile | GeoJSON |
---|---|---|
Format type | Binary (multiple files) | Plain text (single file) |
File extension(s) | .shp , .shx , .dbf , .prj | .geojson or .json |
Easy to open/edit | No (needs GIS software) | Yes (any text editor or browser) |
Web compatibility | Low | High |
Coordinate system | Varies, defined in .prj file | WGS84 only (EPSG:4326) |
Nested data | Not supported | Fully supported |
Unicode (UTF-8) support | Limited | Full |
Field name length | Max 10 characters | No limit |
Sharing convenience | Requires zipping | One file, easy to share |
Readability | Not human-readable | Fully human-readable |
File size | Smaller for large data | Larger due to text format |
Legacy use | Widely used in traditional GIS | Preferred for modern workflows |
What is a shapefile?
A shapefile is an older GIS format.
It was created by Esri in the 1990s. It’s still used a lot today, especially in desktop GIS tools like QGIS or ArcGIS.
But a shapefile isn’t actually a single file.
It’s a group of files:
.shp
holds the geometry.shx
is an index.dbf
stores the attributes.prj
(optional) defines the coordinate system
You need at least the first three for the shapefile to work.
What is GeoJSON?
GeoJSON is a newer format. It’s based on JSON, the same format used in most APIs and web apps.
It stores geometry and attributes together in one file.
It’s just text.
That makes it easy to read, easy to edit, and easy to share.
Web maps love GeoJSON.
Comparing the two
Let’s compare shapefile and GeoJSON on a few important things.
1. Ease of use
GeoJSON wins here.
Since it’s just a text file, you can open it in any text editor. You don’t need special software.
You can even copy and paste a GeoJSON feature into a browser tool like Atlas and it will just work.
Shapefiles, on the other hand, need GIS software to view and edit. You also need to make sure all the required files are together.
If you’re missing one, it won’t load properly.
2. Compatibility
Shapefiles are more widely supported in traditional GIS software. Tools like QGIS, ArcGIS, and others can all open shapefiles with no problem.
GeoJSON is better for web-based tools and APIs. If you’re building a map with Leaflet, Mapbox, or using a tool like Atlas, GeoJSON is often the default.
If your workflow is mostly in the browser, GeoJSON is the better choice.
3. File size
Shapefiles are binary. That means they’re smaller in size compared to GeoJSON, especially for large datasets.
GeoJSON can get bulky. Because it’s plain text, it repeats a lot of words like "type", "coordinates", "properties". That adds up.
If you’re dealing with very large datasets, shapefiles might be more efficient.
That said, you can compress GeoJSON files using gzip and still use them in many tools.
4. Data limits
Shapefiles have some weird limits. For example:
- Field names must be 10 characters or less
- It doesn’t support UTF-8 out of the box
- It can only handle 2GB per file
- It doesn't support nested properties
GeoJSON doesn’t have these issues. It can store long field names, Unicode characters, and nested data structures.
This makes it more flexible for modern applications.
5. Coordinate system
Shapefiles can use many coordinate systems. The .prj
file defines which one.
But that means you have to check and make sure it’s right.
GeoJSON expects coordinates in WGS84 (EPSG:4326). This is a global standard used by GPS and most web maps.
This makes GeoJSON easier to use across different platforms without worrying about projection errors.
6. Sharing and publishing
GeoJSON is easier to share.
You can drop a GeoJSON file into GitHub and it renders a map. You can paste it into a web tool like Atlas and it works instantly.
Shapefiles have to be zipped up before you send them. And the person on the other end needs to unzip them and use GIS software to open them.
So for quick sharing or publishing on the web, GeoJSON is better.
When to use shapefile
Use shapefile if:
- You work mostly in desktop GIS tools
- You need small file sizes for large datasets
- You’re dealing with older systems or tools
- You need to support government or institutional workflows
Shapefile is reliable. It’s been around a long time. But it’s outdated in many ways.
When to use GeoJSON
Use GeoJSON if:
- You’re building web maps or apps
- You want something human-readable
- You need to share or publish data online
- You want to use Atlas or other browser tools
GeoJSON is modern, simple, and flexible. It works especially well in workflows that involve code or the web.
Convert between the two
If you have shapefiles and need GeoJSON, or vice versa, it’s easy to convert.
You can use Atlas’s free converter. Just upload your shapefile (as a zip), and it gives you a clean GeoJSON.
No install needed. Works in your browser.