Convert Shapefile to GeoJSON

This converter turns a shapefile, as a .zip or as its separate .shp, .shx, .dbf and .prj files, into a GeoJSON file reprojected to WGS84 for web maps and APIs. The conversion happens in your browser, so nothing is uploaded. You need at least the .shp, .shx and .dbf, a missing .prj may mean entering the EPSG code, and the GeoJSON is usually larger than the shapefile.

Did a file not convert correctly? E-mail [email protected], ideally with a small sample file, and it will be fixed.

Key facts

Shapefile to GeoJSON: why convert

Shapefiles are the standard exchange format in desktop GIS, but web maps, JavaScript and most APIs want GeoJSON. This converter reads your shapefile, reprojects it to WGS84 as the GeoJSON standard requires, and gives you a single .geojson file ready for Leaflet, MapLibre, Mapbox, D3 or GitHub. Upload the shapefile as a .zip or select all its files at once. The conversion runs in your browser with GDAL, so the data never leaves your computer.

How to convert Shapefile to GeoJSON

  1. Drop a .zip with your shapefile, or select the .shp, .shx, .dbf and .prj files together.
  2. Check the preview on the map and the detected coordinate system.
  3. Click Convert and download your GeoJSON file.

What changes when you convert

You need the .prj file

GeoJSON must be in WGS84 longitude and latitude, so the converter reprojects your data. It reads the source coordinate system from the .prj file. Without it, coordinates that look like longitude and latitude are taken as WGS84; otherwise you are asked to enter the EPSG code, for example EPSG:27700 for the British National Grid or EPSG:32633 for UTM zone 33N.

Upload all the parts

A shapefile is several files. The .shp, .shx and .dbf files are required, .prj and .cpg are strongly recommended. Selecting only the .shp file is the most common reason a conversion fails.

Encoding of special characters

The .cpg file tells which text encoding the attribute table uses. Without it, the converter reads valid UTF-8 as UTF-8 and otherwise uses the code page in the .dbf header. When the header names none, or only "ANSI", it picks the code page the text reads most naturally in (Windows-1252, Shift_JIS, GBK, Big5, EUC-KR or Windows-1250, 1251, 1253 or 1254) and names it in the status line. If names still show odd characters, add a .cpg with the right encoding.

The file gets bigger

GeoJSON is text, so it is often several times larger than the shapefile. Coordinates are written with 7 decimals (about 1 cm), which keeps the size down without visible loss.

Dates and numbers

Date fields become text in the form YYYY-MM-DD. Numbers stay numbers. Empty numeric fields in the .dbf may come out as 0 or null depending on how the shapefile was written.

About the formats

Shapefile

The Esri Shapefile is the most widely used GIS vector format. A single "shapefile" is really a set of files with the same name: .shp holds the geometry, .shx an index, .dbf the attribute table, and the optional .prj the coordinate system and .cpg the text encoding.

  • Needs at least .shp, .shx and .dbf. Select them together or as one .zip.
  • Field names are limited to 10 characters and text values to 254 characters.
  • Each shapefile holds one geometry type only: points, lines or polygons.
  • Without a .prj file the coordinate system is unknown.

GeoJSON

GeoJSON is a plain-text JSON format for geographic features, standardized as RFC 7946 in 2016. It is the native format of web maps such as Leaflet, MapLibre and Mapbox, and of many APIs.

  • Coordinates are WGS84 longitude, latitude (in that order).
  • Points, lines and polygons can be mixed in one file.
  • Properties can be any JSON value, with no limit on field name length.

Frequently asked questions

Can I upload just the .shp file?

Yes, but only the shapes come through. The converter rebuilds a missing .shx index from the .shp, but the attributes live only in the .dbf and cannot be recreated, and without the .prj you have to enter the coordinate system. Select all files with the same name at once, or zip the folder and upload the .zip.

What if my zip contains several shapefiles?

Each shapefile is converted to its own GeoJSON file and you download them together as a .zip.

My folder also has .sbn, .sbx, .shp.xml and other files. Is that a problem?

No. Drop the whole folder or zip it as it is. Only the .shp, .shx, .dbf, .prj and .cpg files are read; spatial indexes, metadata, style and lock files from ArcGIS or QGIS are ignored.

Why are my coordinates different in the GeoJSON?

They have been reprojected from your shapefile's coordinate system to WGS84 longitude and latitude, as the GeoJSON standard (RFC 7946) requires. The features are in the same place on the map.

Is my data uploaded?

No. Your browser does the conversion. Nothing leaves your computer.

Step-by-step guides