How to Convert Shapefile to GeoJSON Online
Feb. 21, 2026 · ConvertGeoData Team
If you work with geographic data, chances are you have encountered the need to convert Shapefile to GeoJSON at some point. Shapefiles remain one of the most widely used vector data formats in GIS, but GeoJSON has become the go-to format for web mapping, APIs, and modern geospatial workflows. With a reliable shapefile GeoJSON converter like ConvertGeoData, the process takes just a few clicks.
What Is a Shapefile?
The Shapefile format was introduced by Esri in the early 1990s and quickly became an industry standard. Despite its age, it remains deeply embedded in government agencies, utilities, and environmental organizations worldwide. A single "Shapefile" is actually a collection of files that work together. At minimum, you need three files: .shp (geometry), .shx (spatial index), and .dbf (attribute data). You may also encounter .prj (coordinate reference system), .cpg (character encoding), and several others.
This multi-file structure is one of the format's biggest drawbacks. Sharing a Shapefile means zipping up multiple files, and losing even one component can render the dataset unusable.
What Is GeoJSON?
GeoJSON is an open standard format based on JSON (JavaScript Object Notation) for encoding geographic data. It supports points, lines, polygons, and multi-part geometries, along with associated properties. Because it is plain text and human-readable, GeoJSON integrates seamlessly with web technologies, JavaScript libraries like Leaflet and Mapbox GL JS, and REST APIs.
Unlike Shapefiles, GeoJSON lives in a single file, uses UTF-8 encoding by default, and follows the WGS 84 (EPSG:4326) coordinate reference system as specified in RFC 7946. This simplicity makes it a popular choice for data exchange and visualization on the web.
Why Convert Shapefile to GeoJSON?
There are several practical reasons to convert SHP to GeoJSON:
- Web mapping: Most JavaScript mapping libraries expect GeoJSON as input. If you are building an interactive map with Leaflet, OpenLayers, or Mapbox, GeoJSON is the natural choice.
- Simpler file management: One file instead of five or more. Easier to store, version control with Git, and share via URL.
- API compatibility: Many geospatial APIs and databases (PostGIS, MongoDB, Elasticsearch) accept GeoJSON natively.
- Human readability: You can open a GeoJSON file in any text editor and inspect or edit features directly.
How to Convert SHP to GeoJSON Using ConvertGeoData
ConvertGeoData makes it straightforward to convert your Shapefiles to GeoJSON right in the browser. No software installation required. Here is the step-by-step process:
Step 1: Prepare your files. Gather all the component files of your Shapefile (.shp, .shx, .dbf, and ideally .prj and .cpg). Place them in a single ZIP archive. Most operating systems let you do this by selecting all the files, right-clicking, and choosing "Compress" or "Send to ZIP."
Step 2: Open the converter. Navigate to convertgeodata.com/convert/shapefile-to-geojson/ in your browser.
Step 3: Upload your ZIP file. Drag and drop your ZIP archive onto the upload area, or click to browse your files. ConvertGeoData will automatically detect the Shapefile components inside.
Step 4: Configure options. Before converting, review the available settings. You can specify the source coordinate reference system (if no .prj file is included), choose character encoding for attribute data, and set output preferences.
Step 5: Convert and download. Click the convert button. Within seconds, your GeoJSON file will be ready to download. For smaller datasets, you can also preview the results on an interactive map directly in the browser.
CRS Considerations When Converting Shapefile to GeoJSON
Coordinate Reference System (CRS) handling is one of the most important aspects of any geospatial conversion. Shapefiles can use virtually any projected or geographic CRS, from UTM zones to state plane coordinates. GeoJSON, according to the RFC 7946 specification, expects coordinates in WGS 84 (EPSG:4326) with longitude and latitude in decimal degrees.
ConvertGeoData handles reprojection automatically when a .prj file is present in your ZIP archive. The tool reads the source CRS definition and transforms all coordinates to WGS 84 during conversion. If your Shapefile lacks a .prj file, you can manually specify the source CRS using an EPSG code. Getting this wrong will result in features appearing in the wrong location, so double-check your source projection if you are unsure.
Attribute Preservation and Encoding
One concern when converting between formats is whether attribute data survives the process intact. The good news: ConvertGeoData preserves all attribute fields and values from your .dbf file. Field names, data types, and values carry over into the GeoJSON properties object for each feature.
Character encoding deserves special attention. The .dbf format predates Unicode, and many Shapefiles use legacy encodings like Latin-1, Windows-1252, or Shift-JIS for non-English text. If your Shapefile includes a .cpg file, it declares the encoding explicitly, and ConvertGeoData will use it. Without a .cpg file, the tool defaults to UTF-8 but allows you to override this setting. If you see garbled characters in your output, try specifying the correct source encoding manually.
Keep in mind that the .dbf format limits field names to 10 characters. Those truncated names will carry over into your GeoJSON. If you need cleaner property names, you can rename them after conversion using a text editor or a script.
Common Errors and How to Fix Them
Even with a straightforward tool, a few issues can trip you up:
- Missing .shx or .dbf file: The converter needs at least the .shp, .shx, and .dbf files. If any are missing from your ZIP, the conversion will fail. Make sure all required components are included.
- Incorrect CRS or missing .prj: If your output features are clustered near the equator at 0,0 or appear in an unexpected location, the source CRS was likely misidentified. Add a .prj file or specify the correct EPSG code.
- Garbled attribute text: This almost always indicates an encoding mismatch. Try common encodings like Latin-1 or Windows-1252 if UTF-8 produces unreadable characters.
- Large file sizes: GeoJSON is verbose compared to binary formats. For very large datasets, consider simplifying geometries before conversion or using a more compact format like FlatGeobuf for storage.
Tips for Working with Your GeoJSON Output
Once you have your GeoJSON file, here are a few tips to get the most out of it:
- Validate your output. Tools like geojson.io let you paste or upload GeoJSON to verify geometry and attributes visually.
- Minify for production. If you are serving GeoJSON over the web, remove unnecessary whitespace to reduce file size.
- Use version control. Because GeoJSON is plain text, it works well with Git. Track changes to your datasets just like you would with code.
- Consider TopoJSON. For datasets with shared boundaries (like administrative regions), TopoJSON can reduce file size significantly by encoding topology.
Wrapping Up
Converting Shapefile to GeoJSON does not have to be complicated. With ConvertGeoData, you can convert SHP to GeoJSON in seconds, right from your browser, with full control over CRS reprojection, character encoding, and attribute preservation. Whether you are preparing data for a web map, feeding an API, or simply moving away from multi-file formats, GeoJSON is a versatile and developer-friendly choice.
Ready to convert your Shapefiles? Head over to ConvertGeoData's Shapefile to GeoJSON converter and get started.