GeoJSON to Shapefile Converter: Web Data into GIS

All tools
Report

Heading to the field? Install this site from your browser menu and this tool works with no signal. See how

Converter

Nothing is uploaded. The file is converted on your own device, so it works with no signal.

Drop a file here or

Nothing leaves your device.

No file to hand?

Waiting for a file.

Features in this file

NameTypeFolderVerticesLengthArea

A list of what GeoJSON allows that a shapefile cannot hold. Nested objects and arrays in properties are flattened to text. A different set of fields on every feature becomes one fixed schema with blanks. Points, lines and areas in one collection cannot be one shapefile and must be split. Property names of any length are capped at ten characters with duplicates given a digit. Any JSON value type becomes text or number, decided per column. Coordinates and geometry are carried across exactly. A band explains that the mixed collection is the only one that stops the conversion, while the others degrade quietly.
Five of these six rows happen silently. Only the mixed collection stops the conversion, because there is no valid shapefile it could become.

How to use this tool

Drop a .geojson or .json file above. A FeatureCollection, a single Feature, a bare geometry or a plain array all work. Check the map, then Convert to shapefile gives you a zip holding the .shp, .shx, .dbf and .prj.

If you only need to look at the file, the GeoJSON Viewer draws it without producing a download.

This direction is a narrowing

GeoJSON is a permissive format and a shapefile is a rigid one, so going this way loses things. None of it produces a warning in most software, which is why it is worth knowing in advance.

Properties can hold nested objects and arrays in GeoJSON. A .dbf column holds one flat value, so anything nested is written as text. It is still readable, it is no longer structured.

Every feature can carry a different set of fields in GeoJSON. A .dbf has one fixed schema for the whole file, so the columns become the union of everything seen and features that lacked a field get a blank.

Property names can be any length. A .dbf caps them at ten characters, and two names that shorten to the same ten get a digit appended to the second so they stay unique.

The one that stops the conversion

A GeoJSON FeatureCollection can hold points, lines and polygons together. A shapefile writes its shape type once in the file header and applies it to every record, so there is no valid shapefile that holds a mixture.

Rather than writing a file containing only whichever type it met first, this tool refuses and says so. Split the collection by geometry type and convert each part separately, which gives you three shapefiles and twelve files in total.

Any converter that silently accepts mixed input and hands back one shapefile has discarded most of your data.

A worked check you can repeat on paper

Before converting, count what you are about to send, because the count is the thing that goes wrong quietly.

  • Open the GeoJSON in a text editor and search for the word Feature. Every feature has a type of Feature, so the count of occurrences, minus one for the FeatureCollection itself, is your feature count.
  • Search for Point, LineString and Polygon separately. If more than one of those returns a hit, the collection is mixed and cannot become a single shapefile.
  • Convert here and compare the feature count reported above the map against your count.

They should match exactly. If they do not, something was dropped, and the usual casualty is a feature with a null geometry, which GeoJSON allows and a shapefile has no room for.

Mistakes that catch people out

Expecting the property names to survive intact. Ten characters, and the limit comes from dBase in 1983 rather than from anything modern.

Sending only the .shp afterwards. The output is a zip for a reason. All four files have to travel together.

Assuming a crs member will be honoured. GeoJSON is defined as WGS84 and the crs member is deprecated. This tool writes a WGS84 .prj to match.

Converting a file with mixed geometry and being surprised it stops. It is the format, not the tool.

Losing numeric types. A property written as a quoted string in the JSON is text, and it will become a text column. Check the quoting before converting if you intend to do arithmetic afterwards.

Related Calculators and Reference

Getting web data into GIS usually starts here.