GeoJSON Validator & Fixer
Validate GeoJSON and fix common issues like ring winding and invalid coordinates
GeoJSON Validator and Fixer Online
This is a free, browser-based GeoJSON validator and fixer that checks your .geojson files against the RFC 7946 specification, flags invalid geometries, and can automatically repair the most common problems. Drop a file in (or paste GeoJSON text), see a list of every issue, and download a corrected version. Whether you need to validate GeoJSON online before publishing it, or fix invalid GeoJSON that another tool refuses to read, this is the fastest path. Everything runs locally β your data never leaves the browser.
If you've ever had a GeoJSON file that loaded fine in QGIS but failed in Mapbox, or rendered correctly in Leaflet but threw an error in PostGIS, you've experienced the GeoJSON spec gap firsthand. Different libraries have different tolerance for malformed input, and silent acceptance can hide real bugs that surface later. A proper validator catches these issues before they reach production.
What Counts as Invalid GeoJSON?
The RFC 7946 specification defines GeoJSON strictly. Common ways to break it include:
- Wrong ring winding order β Outer rings of polygons must be counter-clockwise; holes must be clockwise. Many shapefile-derived GeoJSON files get this wrong.
- Unclosed rings β A polygon ring's first and last coordinates must be identical. A missing closing point is silently broken in some libraries.
- Coordinates out of bounds β Longitude must be in [-180, 180]; latitude in [-90, 90]. Out-of-range values usually mean a CRS confusion.
- Antimeridian crossing β A LineString or Polygon that crosses 180Β° longitude must be split or it will render as a giant artefact circling the globe.
- Self-intersecting polygons β A polygon ring that crosses itself is invalid even though it might render acceptably.
- Empty geometries β A Feature with
geometry: nullis technically valid; one withcoordinates: []is not. - Duplicate consecutive points β Vertices repeated back-to-back create zero-length segments.
- Wrong coordinate dimensions β Mixing 2D and 3D coordinates in the same geometry confuses parsers.
- Foreign CRS β RFC 7946 requires WGS84 (EPSG:4326). The deprecated
crsmember is technically allowed but causes interoperability problems. - Holes outside the outer ring β A polygon hole that isn't actually inside the outer ring is geometrically nonsensical.
How the Validator and Fixer Works
The tool parses your GeoJSON with a strict reader, walks every feature, and runs a battery of geometric checks. Each issue is logged with the feature index, geometry path, and a human-readable description. Where possible, the fixer applies a safe correction: rewinding rings, closing open rings, deduplicating points, and so on. More invasive fixes (splitting antimeridian crossings, repairing self-intersections) require user confirmation because they can change the meaning of the data.
Validation Categories
Issues are grouped into errors (the file violates the spec), warnings (it's spec-compliant but likely to misbehave), and info (style suggestions like coordinate precision). Errors block downstream consumers; warnings should be fixed before publishing; info items are optional polish.
Fixing Strategy
The fixer prioritises safe corrections β operations that can never change the meaning of the data, only its representation. Rewinding a ring is safe. Closing an open ring is safe. Splitting an antimeridian-crossing geometry is technically safe but visible, so it's flagged for review.
Practical Applications
Pre-Publication QA
Before publishing GeoJSON to a public web map, validate it. Catching a single antimeridian bug at this stage saves hours of debugging when users start reporting weird artefacts.
CI/CD for Map Pipelines
Teams running automated map-building pipelines can integrate validation as a gate that blocks bad GeoJSON from reaching production.
Open Data Auditing
Government open-data portals often publish GeoJSON without validating it. Researchers and integrators use a validator to flag broken datasets and request fixes from the publisher.
Format Conversion Cleanup
GeoJSON produced by converting from shapefile, KML, or GPX often inherits format-specific quirks. Validating after conversion catches them.
Geocoding Output Validation
Geocoders sometimes return slightly malformed GeoJSON (e.g., missing closing ring points). A quick validation pass repairs them before downstream tools choke.
Educational Use
Students learning the GeoJSON spec benefit from seeing concrete validation errors and watching the fixer normalise their input.
API Integration Testing
APIs that accept GeoJSON input (Mapbox uploads, Carto, OGC API Features endpoints) reject malformed payloads. Validate before sending.
Step-by-Step Workflow in gis.tools
- Open the GeoJSON Validator & Fixer page.
- Drag a
.geojsonfile or paste GeoJSON text into the input area. - Wait for the validator to scan the file (a few seconds for typical files).
- Review the issue list, grouped by severity.
- Click Apply Safe Fixes to rewind rings, close polygons, dedupe points, and similar.
- Manually review and approve any structural fixes (antimeridian splits, self-intersection repairs).
- Inspect the fixed geometry on the preview map.
- Download the corrected GeoJSON.
Worked Example
A developer downloads a state forest boundaries GeoJSON from a state agency portal. Mapbox's API rejects the upload. They drop the file into the validator, which reports 23 errors: 18 outer rings wound clockwise (shapefile convention), 3 unclosed rings, and 2 polygons crossing 180Β° longitude (the dataset includes Aleutian island territory). The validator applies safe fixes for the 21 ring issues automatically, and the developer reviews and approves the antimeridian splits. The corrected GeoJSON uploads to Mapbox without errors and renders correctly worldwide.
Common Pitfalls and Gotchas
- Wrong winding order from shapefile imports β Almost universal. Always rewind after converting from shapefile.
- Antimeridian artefacts β Geometries that cross 180Β° longitude render as giant horizontal bars across the world map. Splitting at the dateline is the only fix.
- Foreign CRS member β Old GeoJSON files include a
crsfield with a non-WGS84 reference. RFC 7946 deprecates this; reproject the data instead. - Mixed feature types β A FeatureCollection with both Points and Polygons is valid but breaks tools that assume one type.
- Coordinate precision overload β 15 decimal places of precision means sub-micron accuracy, way more than meaningful. Reduce with the Coordinate Precision Reducer.
- Empty FeatureCollections β Spec-valid but often a sign of upstream filter errors.
- Self-intersecting holes β A hole that crosses itself is invalid even if the outer ring is fine.
- NaN and Infinity values β Not allowed in JSON, let alone GeoJSON. Some converters silently produce them.
Tips for Best Results
- Run validation immediately after any format conversion.
- Use the validator as a CI gate before publishing.
- For batch validation, scriptify the same checks with
geojson-validator(Python) or@mapbox/geojsonhint(JavaScript). - Pair with the GeoJSON Simplifier to fix coordinate-precision issues.
- Use the CRS Metadata Inspector when out-of-range coordinates suggest a CRS problem.
- Always inspect the fixed result on the preview map before trusting it.
- Keep the original file as a backup so you can compare before/after.
Comparison with Other GIS Approaches
The Python geojson-validator package (chrieke) is the gold standard for batch validation; it's also what the gis.tools tool conceptually mirrors. @mapbox/geojsonhint is the canonical JavaScript validator. geojsonlint.com is a long-standing online viewer/validator. QGIS will load invalid GeoJSON silently and not flag the issues. PostGIS has ST_IsValid for individual geometries. The browser-based gis.tools validator is the most accessible option for non-developers, with a focus on visual feedback and one-click fixes.
Performance Considerations
Validation runs in O(n) on vertex count for most checks, with O(nΒ²) worst case for self-intersection detection on complex polygons. Files in the tens of megabytes validate in seconds. Hundreds of megabytes may take a minute or more on a desktop browser.
Data Privacy and Browser-Based Processing
GeoJSON files often contain sensitive coordinates: facility locations, customer addresses, research field sites. Everything in the validator runs locally β no uploads, no telemetry, no logs. You can validate confidential data without contractual or compliance concerns.
Related GIS Concepts
RFC 7946 β The IETF specification that standardised GeoJSON in 2016, requiring WGS84 and right-hand rule winding.
Right-Hand Rule β The polygon winding convention used by GeoJSON: outer rings counter-clockwise, holes clockwise.
OGC Simple Features Validity β A more rigorous geometric validity model used by PostGIS and JTS, including no self-intersections and properly nested holes.
Antimeridian β The 180Β° longitude line, the main source of geometry edge cases for global datasets.
Frequently Asked Questions
Can I validate GeoJSON without uploading it?
Yes β that's the point of this tool. Everything runs in your browser.
Will the fixer change my data?
Safe fixes (rewinding, closing rings, dedupe) preserve the geometry's meaning. Structural fixes (antimeridian splits) are flagged for review.
What about invalid topology β slivers and overlaps?
Those are spatial validity issues, not GeoJSON spec issues. See the Polygon Overlap Checker and Geometry Repair tools.
Can I validate a file with millions of features?
Up to a few million on a desktop browser. Larger files should be validated server-side.
Related Tools on gis.tools
Related Tools
View All ToolsLayer Packaging Tool
Package selected layers with style JSON into a downloadable ZIP
Import & ExportGeoJSON to TopoJSON Converter
Convert between TopoJSON and GeoJSON with topology preservation
Import & ExportGeoJSON, KML, Shapefile & GIS File Viewer
Drag-and-drop loader for GeoJSON, KML, GPX, CSV, Shapefile, and GeoTIFF files
Import & ExportMap Style Converter
Convert between Mapbox style JSON and simplified style schemas
Import & ExportCSV to Points Layer
Build a points layer from CSV with latitude/longitude columns
Import & ExportShapefile Viewer & Converter (to GeoJSON)
Convert Shapefile (.shp, .dbf, .prj) to GeoJSON format in your browser
Import & Export100% client-side processing - your data stays private and never leaves your device