Skip to content

Convert Shapefile to GeoJSON

Drop the zip or the .shp, .dbf and .prj together. WGS 84 out, every attribute kept, and nothing leaves your browser.

or drop the .zip, or the .shp, .dbf and .prj together

How the conversion works

  1. 1

    Choose the shapefile as one .zip, or select the .shp, .dbf and .prj files together (the .shx and .cpg are welcome too).

  2. 2

    The page reads the geometries from the .shp, the attributes from the .dbf in the encoding the .cpg names, and the coordinate system from the .prj. Coordinates are reprojected to WGS 84 on the way, which GeoJSON requires.

  3. 3

    Download the .geojson. A zip holding several shapefiles gives one FeatureCollection with a layer property saying which file each feature came from.

What each sidecar file gives

A shapefile is at least three files. Without the .prj the coordinates are passed through unchanged and a notice says so.

FileWhat the page reads from it
.shpThe geometries: Point, MultiPoint, PolyLine and Polygon, with Z and M values dropped. Polygon rings are sorted into outer rings and holes by orientation.
.dbfOne property per field. Numeric fields become numbers, logical fields booleans, dates ISO strings.
.prjThe coordinate system in WKT. Read with proj4, so UTM, Lambert, State Plane and national grids all reproject to WGS 84.
.cpgThe text encoding of the .dbf. Without it, UTF-8 is tried, then Latin-1.
.shxThe record index. Not needed to read the file; ignored if present.

What it does not do

  • Files up to 50 MB together. A national dataset belongs in ogr2ogr, not a browser tab.
  • A .prj the page cannot parse leaves the coordinates as they are, with a notice. Check the result on a map.
  • Z and M values are dropped: GeoJSON positions carry longitude, latitude and at most an altitude.
  • Multipatch shapefiles, the 3D type, are not supported.

Questions people ask

Does my shapefile get uploaded?
No. The .shp, .dbf and .prj are read in your browser tab with JavaScript, and nothing is sent. Open the network panel to check.
Can I drop just the .shp?
Yes, and you get geometries with no attributes and no reprojection. Add the .dbf for attributes and the .prj so the coordinates come out in WGS 84.
My accented characters are wrong.
The .dbf encoding was guessed. Add the .cpg file from the same folder; it names the code page and the text comes out right.
Why are my coordinates now decimals near 2 and 48 instead of large metres?
That is the reprojection. GeoJSON is defined in WGS 84 degrees, so metres in UTM or Lambert are converted. The shapes are in the same place on a map.
The zip had several shapefiles. Where did they go?
All into one FeatureCollection, each feature carrying a layer property with the shapefile name. Filter on it in QGIS or split it with a script.

Next, open it in QGIS

Every one of these files loads in QGIS in one dialog. Once the points or polygons sit on your imagery, the two TerraLab plugins take over: AI Segmentation detects the objects the file is missing, AI Edit renders a project on the map.