More games at WuGames.ioSponsoredDiscover free browser games — play instantly, no download, no sign-up.Play

GeoJSON Validator & Repair

Free RFC 7946 GeoJSON validator and repair tool. Check syntax, fix polygon winding order (right-hand rule), close rings, validate WGS84 bounds, and reduce coordinate precision.

clearClearpastePaste
Upload
Drag and drop GeoJSON file here
or click to browse
Decimal places (6 ≈ 0.11 m at the equator)

What is GeoJSON Validator & Repair?

The GeoJSON Validator & Repair is a free online tool that validates GeoJSON files, detects common errors, and automatically fixes issues. It ensures your GeoJSON data is standards-compliant and ready for use in mapping applications.

GeoJSON validation is crucial for web mapping applications. Invalid GeoJSON can cause rendering errors, application crashes, or unexpected behavior in libraries like Leaflet, Mapbox, and OpenLayers.

This tool not only validates your GeoJSON but also provides automatic repair capabilities, fixing common issues like duplicate coordinates, incorrect winding order, and malformed geometries.

Common GeoJSON Errors

This validator detects and fixes the following issues:

  • Missing or invalid 'type' property
  • Incorrect coordinate format or order
  • Coordinates out of valid bounds (-180 to 180, -90 to 90)
  • Duplicate or redundant coordinates
  • Unclosed polygon rings
  • Incorrect polygon winding order (RFC 7946 right-hand rule: exterior ring counter-clockwise, holes clockwise)
  • Empty or null properties
  • Invalid Feature or FeatureCollection structure

How to Use GeoJSON Validator

Using the validator is straightforward:

  • Paste your GeoJSON data or upload a .geojson file
  • Click Validate to check for errors
  • Review the validation results and detected issues
  • Select repair options to automatically fix issues
  • Click Repair & Validate to generate corrected GeoJSON
  • Download the repaired GeoJSON or copy it for use

The tool provides detailed error messages showing exactly what's wrong and where the issue occurs in your GeoJSON structure.

Repair Capabilities

The repair function can automatically fix:

  • Remove duplicate consecutive coordinates in LineStrings and Polygons
  • Clean redundant coordinates using Turf.js cleanCoords
  • Fix polygon winding order to follow the RFC 7946 right-hand rule (exterior ring counter-clockwise, interior rings (holes) clockwise)
  • Remove empty properties objects or null values
  • Reduce coordinate precision to a chosen number of decimal places to cut file size
  • Report a live input-vs-output byte size comparison after each repair

After repair, the tool re-validates the GeoJSON to ensure all issues have been resolved.

Applications and Use Cases

This validator is useful for:

  • Validating GeoJSON before using in production applications
  • Debugging GeoJSON generation from databases or APIs
  • Cleaning user-uploaded GeoJSON files
  • Ensuring GeoJSON compatibility across different mapping libraries
  • Reducing excessive coordinate precision to shrink file size and redundant points
  • Preparing GeoJSON for efficient storage and transmission to Leaflet/Mapbox tiles

GeoJSON Validation Standards

This tool validates against the official GeoJSON specification (RFC 7946):

  • Correct geometry types: Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon, GeometryCollection
  • Valid coordinate format: [longitude, latitude] or [longitude, latitude, elevation]
  • Coordinate bounds: longitude [-180, 180], latitude [-90, 90]
  • Polygon rings: first and last coordinates must be identical (closed ring)
  • Winding order: exterior ring counter-clockwise, interior rings (holes) clockwise (RFC 7946 right-hand rule)
  • Feature properties: must be an object (can be empty or null)

Following these standards ensures your GeoJSON works correctly across all compliant implementations.

About GeoJSON Validator & Repair

GeoJSON Validator & Repair checks any GeoJSON document for spec compliance (RFC 7946), flags structural errors, geometry issues, and out-of-range or non-numeric coordinates, and then auto-repairs the most common ones - redundant and duplicate coordinates, empty Feature properties, and polygon winding order via the right-hand rule (exterior ring counter-clockwise, holes clockwise). It also reduces excessive coordinate precision and shows a before-and-after byte size readout, the standard pre-deploy step to shrink Mapbox and Leaflet tile payloads. Built for GIS analysts cleaning field-collected data, web-map developers debugging tile sources, data engineers wiring up spatial pipelines, and anyone exporting from QGIS, ArcGIS, or custom scripts who needs the file to load cleanly in Leaflet, Mapbox, or Turf.js without surprises. Try also our Address Geocoder and Geohash Encoder Decoder.

Frequently Asked Questions

It validates your input against RFC 7946 (the GeoJSON specification), checking that the root object is a FeatureCollection, Feature, or Geometry; that every geometry has exactly the structure required for its declared type (Point coordinates of length 2 or 3, LineString of at least 2 positions, Polygon rings closed with at least 4 positions); and that coordinates are numbers falling within valid WGS84 ranges (longitude ±180, latitude ±90). It also confirms that each Feature carries a geometry member (which may be explicitly null, an unlocated Feature) and that properties are an object or null.

Available repairs are: cleaning redundant and duplicate consecutive coordinates with Turf.js cleanCoords; correcting polygon winding order to the RFC 7946 right-hand rule (exterior ring counter-clockwise, holes clockwise); converting empty Feature property objects to null; and reducing coordinate precision to a chosen number of decimal places to shrink file size. Each repair only counts when it actually changes the document, and after repair the tool re-validates and shows a before-and-after byte size comparison so you can measure the result.

RFC 7946 requires that exterior rings of Polygons be wound counter-clockwise when viewed from above (the right-hand rule, the same convention used by OGC Simple Features) and that interior rings (holes) be wound clockwise. This convention matters because point-in-polygon algorithms and some renderers (notably Mapbox GL and deck.gl) rely on it to decide which side is the interior. If your data was exported by a tool that uses the opposite convention (some older ESRI shapefiles), holes can render as solid and the polygon's interior can render as transparent. The repair tool reorients all rings to RFC-compliant order.

The antimeridian is the longitude line at ±180 degrees, where the eastern and western hemispheres meet. A LineString or Polygon that crosses it can be encoded two ways: as a single feature whose longitude jumps from +179 to -179 (which most renderers will draw as a line wrapping the entire globe), or as a MultiLineString/MultiPolygon with the geometry split at the antimeridian. RFC 7946 recommends the split form to avoid wraparound rendering. This tool does not automatically split antimeridian-crossing geometries; for that step run ogr2ogr with -wrapdateline or a dedicated antimeridian-cutting library before validating here.

The tool follows RFC 7946 (June 2016), the current GeoJSON standard. Older drafts and variants such as the 2008 specification, GeoJSON-T (time extension), and GeoJSON-LD (linked-data extension) parse as ordinary JSON: foreign members are preserved and passed through unchanged rather than rejected, so your extra fields survive the round trip. The 2008 draft allowed a crs member that RFC 7946 drops; if your file still carries one it is preserved in the output, so remove it manually if a strict consumer rejects it. For TopoJSON (a related but distinct format), use a dedicated TopoJSON converter.

Common causes: (1) latitude and longitude swapped, which is harmless geometrically but renders to the wrong country; (2) coordinates in a projected CRS like UTM (typically values in the millions) that were never reprojected to WGS84; (3) DMS values not converted to decimal degrees; (4) altitudes mistakenly placed where longitude or latitude should be. The validator shows each out-of-range value with its feature index and property path so you can fix the source data. After fixing, re-run the validator until you see zero errors before deploying the file to a production map.

Everything runs in your browser, so capacity depends on your device's memory. Files up to a few megabytes validate and repair within seconds. Tens of megabytes will work on a desktop with several gigabytes of free RAM but may feel slow because the whole document is parsed into memory at once (JSON.parse, no streaming). For very large exports, split the file by region or run a server-side validator, or use ogr2ogr -f GeoJSON -t_srs EPSG:4326 to validate and reproject in one pass. Reducing coordinate precision here first can meaningfully shrink an oversized file before downstream processing.

Six decimal places of longitude/latitude resolve to about 0.11 metres at the equator, which already exceeds consumer GPS accuracy; seven places (about 1 cm) covers survey-grade data. Anything beyond that is meaningless GPS noise. QGIS, ArcGIS, and PostGIS exports routinely emit 14 to 15 decimals, inflating file size two to five times for no visible benefit and bloating Mapbox and Leaflet tile payloads. Enable Reduce coordinate precision, pick 6 (web maps) or 7 (precise field data), and the tool reports the byte size before and after so you can confirm the saving. For a strict CI gate, run the same check with the open-source @placemarkio/check-geojson or geojson-validation npm package and fail the build on any error.
GeoJSON Validator & Repair — Free RFC 7946 GeoJSON validator and repair tool. Check syntax, fix polygon winding order (right-hand rule), close rings,
GeoJSON Validator & Repair