Convert shapefile to GeoJSON
GeoPreview converts a shapefile to GeoJSON right in your browser. Drag in your .shp (or a .zip of the set), see it on the map, and download a clean .geojson file. It's free, needs no account, and there's nothing to install.
Convert a shapefile to GeoJSON in your browser
GeoPreview turns a shapefile into GeoJSON without any desktop GIS or command line. Drop your .shp (or the whole zipped set) onto the map, confirm it looks right, and export a single .geojson file. The conversion runs right in your browser, with no account and nothing to install.
Why convert a shapefile to GeoJSON
A shapefile is really a bundle of files (.shp, .shx, .dbf, .prj) that has to travel together. GeoJSON is one plain-text file instead, which is why it's the format of choice for the web:
- Web-friendly. GeoJSON drops straight into Leaflet, Mapbox, OpenLayers, deck.gl, and most mapping APIs.
- Human-readable. It's just JSON, so you can open it in any text editor and see the coordinates and properties.
- One file, not four. Nothing to keep zipped together or accidentally leave behind.
How to convert (3 steps)
- Add your shapefile. Drag the
.zipin, or drag the loose.shp,.dbf,.shx, and.prjfiles onto the page together. - Preview it. Your data renders on the map so you can confirm the shapes and attributes are correct before exporting.
- Export as GeoJSON. Choose GeoJSON from the export options and download the file.
What happens to attributes and projection
Both of the things people ask about are handled. Attributes carry through: each column in the .dbf becomes a property on the matching GeoJSON feature, with the same names and values. Projection is normalized too. The GeoJSON spec expects coordinates in WGS84 longitude/latitude, so if your shapefile uses a projected coordinate system (UTM, State Plane, or similar) declared in its .prj, GeoPreview reprojects the geometry to lon/lat during export. If there's no .prj, the coordinates are assumed to already be WGS84.
Is the conversion accurate?
The geometry and attributes convert faithfully: shapes, rings, and every data column come across intact. The one caveat is coordinate precision. Reprojecting from a projected system to lon/lat involves floating-point math, so values may differ in their final decimal places, which is far below any real-world mapping accuracy. If your source has no .prj, double-check that its coordinates really are in lon/lat before trusting the output, since there's no projection information to reproject from.
When you're ready, you can also send the same data out as CSV, a Shapefile ZIP, or FlatGeobuf from the same export menu.