Drag and drop a zipped shapefile (.zip) here

Or select the .shp, .dbf and .prj files together. KML, KMZ and GPX files work here too.

Summary

Feature count, geometry types, bounding box and the detected coordinate system appear here after conversion.

Map preview

The converted features are drawn here, on a plain background. Switch the basemap on to see them over OpenStreetMap.

The basemap is off by default: switching it on loads tiles for the area you view from openstreetmap.org. Your file itself is never sent.

Open the result in:

Have a Google Earth file? Use the KML to GeoJSON converter. Have a GPS track? Use the GPX to GeoJSON converter.

How the Shapefile to GeoJSON Converter works, and what it assumes

The Esri shapefile is still the most common way GIS data changes hands. QGIS and ArcGIS export it by default, and census, cadastral, forestry and election boundaries on open-data portals usually come as a .zip of shapefile parts. It is not one file but several that only work together: the .shp holds the shapes, the .dbf the attribute table, the .prj the coordinate system and the optional .cpg the text encoding. The converter unzips the archive in your browser, reads each part, joins shapes to their attribute rows in order, and writes an RFC 7946 FeatureCollection. Outer rings and holes are sorted out from their winding order, so a parcel with a courtyard stays one polygon with a hole.

The .prj file and projections

Shapefiles are often projected: coordinates in metres on UTM, a national grid such as British National Grid, or Lambert-93. GeoJSON must be WGS 84 longitude and latitude (EPSG:4326), which is what Leaflet and every web map expect. The converter reads the WKT in the .prj, identifies the system by its datum and projection parameters rather than by its name, and reprojects every position. The summary names the EPSG code it found and how accurate the datum change is. A .prj that cannot be matched with certainty, or one in feet, is reported instead of being guessed at; check the code with the EPSG Lookup and enter it under Source coordinate system.

"My data shows up in the ocean"

This is the classic shapefile problem, and it always means the coordinates were read in the wrong system. An easting of 512,000 metres read as degrees is off the planet, and degrees read as Web Mercator metres land within a few hundred metres from 0, 0 in the Gulf of Guinea. A missing .prj is the usual cause. When every coordinate fits longitude and latitude the converter assumes WGS 84 and warns you; otherwise it stops and asks for the EPSG code. Our guide why your shapefile shows up in the wrong place walks through the causes and fixes.

How your data is handled

Cadastral, utility and client layers are often confidential, so nothing is uploaded: the archive is unpacked and converted by JavaScript on your device, in a background worker for files over about 10 MB. Converting something else? Use the KML to GeoJSON converter for Google Earth files or the GPX to GeoJSON converter for GPS tracks. Afterwards, reproject to another system with ST_Transform, check the polygons in the Geometry Validator, or check a single position with the Coordinate Converter.

Where this comes up in GIS work

  • Publishing a boundary layer from an open-data portal on a Leaflet or Mapbox map, which needs GeoJSON in WGS 84.
  • Turning a UTM survey or cadastral shapefile from a consultant into coordinates a JavaScript app can use.
  • Converting a single layer for an API or a test fixture without opening QGIS or running ogr2ogr.
  • Checking what coordinate system an unfamiliar shapefile is in before loading it into PostGIS.

A worked example

A parcel layer exported from QGIS in WGS 84 / UTM zone 43N. Its parcels.prj reads (shortened):

PROJCS["WGS_1984_UTM_Zone_43N",GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",…]],
  PROJECTION["Transverse_Mercator"],PARAMETER["False_Easting",500000.0],
  PARAMETER["Central_Meridian",75.0],PARAMETER["Scale_Factor",0.9996],…,UNIT["Meter",1.0]]

and one record has the point (500000, 1434000) in metres, with PARCEL_ID P-001 and AREA_M2 27500 in the .dbf. The summary reports EPSG:32643 WGS 84 / UTM zone 43N, matched by its datum and projection parameters, and the output is:

{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "properties": {
        "PARCEL_ID": "P-001",
        "AREA_M2": 27500
      },
      "geometry": {
        "type": "Point",
        "coordinates": [75, 12.971645]
      }
    }
  ]
}

An easting of exactly 500,000 m is the zone's central meridian, 75° E, and the northing becomes 12.971645° N. The number field stays a number, and the source easting and northing are gone, because GeoJSON has one coordinate system only.

Using the Shapefile to GeoJSON Converter

  1. Zip the shapefile's files together (.shp, .dbf, .shx and .prj, plus .cpg if there is one), or select them all at once with Ctrl or Cmd held down.
  2. Drop the .zip on the upload box or choose Choose file. Load example opens two land parcels in UTM zone 43N.
  3. Check Detected coordinate system in the summary. It names the EPSG code read from the .prj and says whether the layer was reprojected.
  4. If there is no .prj and the coordinates are not longitude and latitude, enter the EPSG code under Source coordinate system and press Enter.
  5. If the .zip holds several shapefiles, choose one under Layer.
  6. Copy or download the GeoJSON, or send it to the Geometry Validator to check the polygons.

When the output looks wrong

The shapefile has no .prj file, and its coordinates are not longitude and latitude
Without a .prj nothing says which projection the numbers are in. Ask whoever sent the data, or look at the values: a six-digit easting with a seven-digit northing is usually UTM. Enter the EPSG code, such as 32643 or 32644 for much of peninsular India, and the layer is reprojected.
The coordinate system in the .prj file could not be identified
The .prj names a datum or projection that is not in the offline set, or its units are feet. Enter the EPSG code yourself if the set holds it, or reproject to EPSG:4326 in QGIS (Export, Save Features As, CRS EPSG:4326) and convert the result.
The .zip has no .dbf file for roads.shp
A shapefile is several files that only work together, and the attributes live in the .dbf. Zip the .dbf with the .shp, using exactly the same name before the extension, and convert again.
Names show odd characters such as é instead of é
The .dbf text is in one code page and the .cpg names another, or there is no .cpg and the guess was wrong; the notes say which code page was used. Correct the .cpg file (for example UTF-8 or 1252), or export from QGIS with the encoding set to UTF-8.

Questions about the Shapefile to GeoJSON Converter

Which files does a shapefile need?

The .shp holds the shapes, the .dbf the attribute table and the .prj the coordinate system. The .shx is an index that this converter does not need, and a .cpg names the text encoding. Put them in one .zip, or select them together; files in a folder inside the .zip are found too.

Does it reproject shapefiles to WGS 84?

Yes. GeoJSON must be WGS 84 longitude and latitude (EPSG:4326), so a shapefile in UTM, British National Grid, Lambert-93 or another supported system is reprojected using the system its .prj describes. The summary names the EPSG code and states how accurate the datum change is.

Why does my converted shapefile show up in the ocean?

Projected metres were read as degrees, or the other way round. An easting of 512,000 read as a longitude is off the planet, and degree values read as Web Mercator metres land beside 0, 0 in the Gulf of Guinea. Here, the .prj decides; without one, enter the EPSG code rather than guessing.

Can I convert a shapefile with several layers?

Yes. When a .zip holds more than one shapefile, the first is converted and a Layer menu lists the others; choose one to convert it. Each layer becomes its own GeoJSON file, because a FeatureCollection holds one set of features.

Are polygon holes and multipart shapes handled?

Yes. Shapefile rings are sorted into outer rings and holes by their winding order and position, a record with several outer rings becomes a MultiPolygon, and every ring is rewound to RFC 7946's rule: outer rings counter-clockwise, holes clockwise. Z values are kept; M values are dropped.

Is my shapefile uploaded to a server?

No. The .zip is unpacked and converted in your browser, and files over about 10 MB are processed in a background worker on your own device. Nothing is sent to our server, which matters for cadastral, utility and client data.