Convert Shapefile to GeoJSON
Free, private and fast: everything runs in your browser and your Shapefile files are never uploaded.
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
- Drop a .zip with your shapefile, or select the .shp, .shx, .dbf and .prj files together.
- Check the preview on the map and the detected coordinate system.
- 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, the coordinates cannot be placed correctly, and 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. If it is missing and names show up with odd characters, the original file was probably saved in an older Windows 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. Upload 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?
No. Without the .dbf there are no attributes and without the .shx most readers refuse the file. Zip the folder and upload the .zip, or select all files with the same name at once.
What if my zip contains several shapefiles?
Each shapefile is converted to its own GeoJSON file and you download them together as a .zip.
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.