$devtoolkit.sh/examples/json/geojson

Format a GeoJSON Feature Collection

GeoJSON is the standard format for geographic data in web maps and spatial APIs. This example shows a FeatureCollection with a Point and a Polygon, which are the two most common geometry types. Formatting makes it easy to spot misplaced brackets around coordinate arrays, which are the most frequent source of map rendering bugs. Validate before importing into Leaflet, Mapbox, or a PostGIS database.

Example
{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "geometry": { "type": "Point", "coordinates": [-73.9857, 40.7484] },
      "properties": { "name": "Empire State Building" }
    },
    {
      "type": "Feature",
      "geometry": {
        "type": "Polygon",
        "coordinates": [[[-74.0, 40.7], [-73.9, 40.7], [-73.9, 40.8], [-74.0, 40.8], [-74.0, 40.7]]]
      },
      "properties": { "name": "Manhattan Area" }
    }
  ]
}
[ open in JSON Formatter → ]

FAQ

What coordinate order does GeoJSON use?
GeoJSON always uses [longitude, latitude] order — the opposite of many mapping APIs. This is a frequent source of bugs where points appear in the wrong hemisphere.
How do I close a GeoJSON polygon?
The last coordinate in a Polygon ring must be identical to the first coordinate. This closes the ring; omitting it causes rendering issues in some parsers.
Can GeoJSON store custom properties?
Yes. Each Feature has a properties object where you can store any key-value data you want associated with that geometry.

Related Examples

/examples/json/geojsonv1.0.0