← Back to Blog

How to Convert GeoJSON to Shapefile

March 3, 2026 · ConvertGeoData Team

How to Convert GeoJSON to Shapefile - Hero

GeoJSON has become one of the most popular formats for sharing geospatial data on the web. But when it comes time to load your data into desktop GIS software or submit it to an agency that requires Shapefiles, you need a reliable way to convert GeoJSON to Shapefile. This guide walks you through the process, highlights the quirks you should expect, and helps you avoid the most common mistakes.

Why Convert GeoJSON to Shapefile?

Despite being an older format, the Shapefile remains a standard in government agencies, environmental consulting firms, and many GIS workflows. If you receive data as GeoJSON from a web API or a colleague, you may need to convert GeoJSON to SHP before you can use it in ArcGIS, upload it to a regulatory portal, or archive it alongside legacy datasets.

The two formats handle geometry and attributes differently, so the conversion is not always as simple as changing a file extension. Understanding the differences will save you from frustrating surprises down the road.

Quick Conversion with ConvertGeoData

If you need a fast, browser-based GeoJSON Shapefile converter, ConvertGeoData lets you drag and drop your .geojson file and download a .shp bundle in seconds. No software installation required, and your data stays private.

For those who prefer command-line tools or need to handle batch conversions, we will also cover GDAL/OGR and Python-based approaches below.

Convert GeoJSON to Shapefile Using GDAL

GDAL's ogr2ogr utility is the go-to command-line tool for geospatial format conversion. To convert a GeoJSON file to Shapefile, open your terminal and run:

ogr2ogr -f "ESRI Shapefile" output.shp input.geojson

This produces the standard bundle of .shp, .shx, .dbf, and .prj files. If your GeoJSON uses a coordinate reference system other than WGS 84 (EPSG:4326), you can reproject on the fly with the -t_srs flag:

ogr2ogr -f "ESRI Shapefile" -t_srs EPSG:32617 output.shp input.geojson

Using ogr2ogr in the terminal to convert geospatial formats

Field Name Truncation

One of the biggest gotchas when converting GeoJSON to Shapefile is field name length. The dBASE (.dbf) format that stores Shapefile attributes limits field names to 10 characters. GeoJSON has no such restriction, so property names like building_category or population_density will be silently truncated.

For example, population_density might become population, and if you also have a field called population_count, both could be truncated to the same name, causing data loss. GDAL handles this by appending numbers to duplicates (e.g., populati_1, populati_2), but the resulting names are not intuitive.

Tip: Before converting, review your GeoJSON properties and shorten any names longer than 10 characters. This gives you control over the final field names instead of leaving it to the converter.

Multi-Geometry Handling

GeoJSON files can mix different geometry types in a single FeatureCollection. You might have Points, Lines, and Polygons all in one file. Shapefiles do not allow this. Each Shapefile can hold only one geometry type.

When you run ogr2ogr, it typically takes the geometry type of the first feature and ignores or skips features with different types. To avoid losing data, you can filter by geometry type:

ogr2ogr -f "ESRI Shapefile" -where "OGR_GEOMETRY='POLYGON'" polygons.shp input.geojson

Run the command once for each geometry type present in your data, and you will end up with separate Shapefiles for points, lines, and polygons.

Another subtlety involves MultiPolygon vs. Polygon. If your GeoJSON contains a mix of both, use the -nlt PROMOTE_TO_MULTI flag to ensure all features are stored as MultiPolygon, avoiding type conflicts.

Shapefiles require a single geometry type per file

Other Common Pitfalls

Beyond field names and geometry types, there are several other issues to watch for when converting GeoJSON to Shapefile:

File size limits. Individual Shapefile components (.shp, .dbf) are limited to 2 GB. Large GeoJSON files with millions of features may exceed this. If your data is that large, consider splitting it by region or category before conversion.

Null geometry features. GeoJSON allows features with null geometry. Shapefiles do not handle this well. Filter out null geometries before converting, or you may encounter errors.

Nested properties. GeoJSON properties can contain nested objects and arrays. The flat table structure of a .dbf file cannot represent these. Nested values will either be dropped or converted to a string representation, which is rarely useful. Flatten your properties before conversion for best results.

Character encoding. Shapefiles traditionally use ISO-8859-1 encoding, while GeoJSON is always UTF-8. If your data includes accented characters, CJK text, or other non-ASCII content, add a .cpg file set to UTF-8 alongside your Shapefile. GDAL does this automatically in recent versions, but older tools may not.

Converting with Python

If you prefer scripting, the geopandas library makes conversion straightforward:

import geopandas as gpd
gdf = gpd.read_file('input.geojson')
gdf.to_file('output.shp')

GeoPandas uses GDAL under the hood, so the same field name and geometry type considerations apply. The advantage of Python is that you can clean, filter, and transform your data in a few lines before exporting.

A Quick Conversion Checklist

Before you convert GeoJSON to SHP, run through this checklist to avoid common problems:

1. Check field names. Shorten any property names longer than 10 characters.
2. Check geometry types. If your file mixes types, plan to split into separate Shapefiles.
3. Flatten nested properties. Remove or restructure any nested objects or arrays.
4. Remove null geometries. Filter out features with no geometry.
5. Verify CRS. Confirm your coordinate reference system and reproject if needed.
6. Test the output. Open the resulting Shapefile in QGIS or another viewer to verify everything transferred correctly.

Wrapping Up

Converting GeoJSON to Shapefile is a common task in geospatial work, but the differences between the two formats mean you need to be mindful of field names, geometry types, and data structure. Whether you use a browser-based GeoJSON Shapefile converter, GDAL on the command line, or a Python script, a little preparation goes a long way toward a clean conversion.

Have a GeoJSON file ready to convert? Head over to ConvertGeoData.com and try it out. The tool handles the tricky parts for you, so you can focus on your analysis instead of debugging file format issues.

GeoJSON Shapefile format conversion GIS data geospatial