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.
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.