GeoJSON Validator & RFC 7946 Checker
What Does a GeoJSON Validator Check?
GeoJSON (RFC 7946) is the standard format for encoding geographic geometry on the web. This validator checks your GeoJSON for common errors that break web map rendering and GIS data exchange.
- JSON Syntax: Ensures valid JSON structure (missing commas, unclosed brackets, trailing commas).
- Coordinate Order: GeoJSON mandates
[longitude, latitude]order. Many beginners accidentally swap these, placing lat before lon. This tool flags coordinates where latitude values appear in the longitude position. - Geometry Type: Validates that the
typefield matches a known geometry type (Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon, GeometryCollection). - Polygon Ring Closure: Polygon rings must have matching first and last coordinate pairs. Open rings cause rendering failures in Leaflet, Mapbox, and OpenLayers.
- Feature / FeatureCollection Wrapper: Confirms proper wrapping structure when using
propertiesandgeometryfields.
Interactive GeoJSON Validator
Paste your GeoJSON below. The validator parses JSON syntax, checks coordinate ordering, validates polygon ring closure, and reports all findings.
How GeoJSON Coordinate Order Works
One of the most frequent errors in GeoJSON data is swapped coordinate order. Unlike Google Maps and many GPS devices that display latitude first (e.g., 35.6895, 139.6917 for Tokyo), GeoJSON follows the mathematical convention of [x, y], which means [longitude, latitude].
This tool checks whether your latitude values (second position) fall within the valid range of -90 to +90. If a value exceeds that range, the coordinates are likely reversed.
Polygon Ring Closure Rules
According to RFC 7946 Section 3.1.6, a polygon exterior ring must:
- Contain at least four coordinate positions.
- Have the first and last positions be identical (the ring must close).
- Follow the right-hand rule for exterior rings (counterclockwise winding).
Unclosed rings will silently fail in many web mapping libraries. Mapbox GL JS, for instance, simply drops the polygon. Leaflet may render unexpected triangles.
Practical Use: Checking GeoJSON Before API Submission
Before sending GeoJSON payloads to endpoints like the Mapbox Datasets API, Google Maps Data Layer, or your own PostGIS-backed REST service, validating client-side prevents 400 Bad Request errors and saves debugging time. Paste your payload here first.
FAQ
Q: Does GeoJSON support altitude / elevation?
Yes. Coordinates can include an optional third value: [lon, lat, altitude]. Altitude is in meters above the WGS84 ellipsoid. Many web map renderers ignore this value for 2D display.
Q: What is the maximum file size for GeoJSON?
There is no specification limit. However, browser memory limits practical client-side parsing to roughly 50-200 MB depending on the device. For larger datasets, consider GeoPackage or streaming formats like GeoJSON-LD.
Q: How do I convert Shapefile to GeoJSON?
Use ogr2ogr -f GeoJSON output.geojson input.shp from the GDAL/OGR command line. In QGIS, right-click the layer and select Export > Save Features As > GeoJSON.