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

GeoJSON Validator & Repair

Free GeoJSON validator and repair tool. Validate GeoJSON syntax, detect errors, and automatically fix common issues like duplicate coordinates and empty properties.

clearClearpastePaste
Upload
Drag and drop GeoJSON file here
or click to browse

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 (right-hand rule)
  • 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 right-hand rule (exterior clockwise, holes counter-clockwise)
  • Remove empty properties objects or null values
  • Clamp coordinates to valid bounds (-180 to 180 longitude, -90 to 90 latitude)
  • Close unclosed polygon rings automatically

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
  • Fixing coordinate precision issues and redundant points
  • Preparing GeoJSON for efficient storage and transmission

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 clockwise, interior rings counter-clockwise
  • 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 metadata problems, and then auto-repairs the most common ones - duplicate consecutive coordinates, empty Feature properties, unclosed polygon rings, mixed coordinate orders, and stray null geometries. 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 and oriented correctly); and that coordinates fall within valid WGS84 ranges (longitude ±180, latitude ±90). It also checks that property names are strings, that bbox fields are arrays of length 4 or 6, and that crs members are absent (RFC 7946 forbids them; only EPSG:4326 is allowed).

Common automatic repairs include: closing Polygon rings whose first and last coordinates do not match; reversing reversed outer rings (RFC 7946 requires outer rings counter-clockwise and holes clockwise); winding order correction with the right-hand rule; coercing string coordinates to numbers; removing extra or trailing properties not allowed by the spec; flattening single-element MultiPoint/MultiLineString/MultiPolygon to their non-multi equivalents; and stripping disallowed crs members. Each repair is reported with the path of the affected element so you can review the change before accepting it.

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. The validator flags any feature whose bounding box spans more than 180 degrees of longitude, and the repair can either split the geometry at the antimeridian or leave it unchanged with a warning.

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) are partially supported through loose-mode parsing: features with foreign members are accepted but flagged with a warning, and time properties are passed through unchanged. CRS members from the 2008 draft are accepted but reported as invalid per RFC 7946, with the option to strip them automatically. For TopoJSON (a related but distinct format), use the 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.

For files under 50 MB, validation and repair complete within seconds. Between 50 and 200 MB, expect 10 to 60 seconds and noticeable memory usage on devices below 4 GB of RAM. Above 200 MB, you should split the file by region or run a server-side validator like jsonschema with the GeoJSON schema, or use ogr2ogr -f GeoJSON -t_srs EPSG:4326 to validate and reproject in one pass. The browser-based validator uses Streaming JSON parsing where possible (around 30 percent faster than full DOM parsing on large files), but heap pressure is still the limiting factor on consumer hardware.

Yes. The tool can export the validation report as a JSON document with one entry per error or warning, including JSON-pointer paths to the offending element. You can wire this into a CI pipeline by running the same validation library (the open-source @placemarkio/check-geojson or geojson-validation npm package) and failing the build when any error is found. For production maps, we recommend a two-stage policy: warnings tolerated but logged, errors blocking deploy. This catches drift introduced by upstream data exports, especially when third-party providers update their schemas without notice.
GeoJSON Validator & Repair — Free GeoJSON validator and repair tool. Validate GeoJSON syntax, detect errors, and automatically fix common issues like
GeoJSON Validator & Repair