GeoJSON Bounding Box

Get the bounding box, centre, area and length of any GeoJSON — in both coordinate orders, measured on the sphere.

GeoJSON Bounding Box runs entirely in your browser. The GeoJSON you paste is parsed and measured on your device and is never uploaded.

Open the GeoJSON Viewer

About GeoJSON Bounding Box

GeoJSON Bounding Box reads any GeoJSON — a Feature, a FeatureCollection, a bare geometry, a GeometryCollection or even a raw coordinate array — and reports the four numbers that enclose it. Those numbers get emitted twice on purpose. RFC 7946 defines the GeoJSON bbox order as west, south, east, north, longitude first, while Leaflet and many mapping APIs want south, west, north, east, latitude first. Mixing them up is one of the more common ways to end up looking at the wrong hemisphere. Polygon area and line length are computed on the sphere rather than on the flat latitude/longitude plane, because treating degrees as a grid overstates area badly away from the equator.

Features

How to use the GeoJSON Bounding Box

  1. Paste your GeoJSON, or load the sample to see the shape of the output
  2. Read the west, south, east and north bounds
  3. Copy the bbox in whichever coordinate order your library expects
  4. Use the polygon output if you want to draw the box on a map

Example

Input

{"type":"Polygon","coordinates":[[[-0.1757,51.5073],[-0.1502,51.5073],[-0.1502,51.5122],[-0.1757,51.5122],[-0.1757,51.5073]]]}

Output

[-0.1757, 51.5073, -0.1502, 51.5122]

GeoJSON order puts longitude first — the opposite of the lat/lng order most mapping libraries take.

Common errors & troubleshooting

Frequently asked questions

What coordinate order does a GeoJSON bbox use?
West, south, east, north — that is, minimum longitude, minimum latitude, maximum longitude, maximum latitude. GeoJSON puts longitude before latitude throughout, which is the reverse of the convention most people say out loud.
Why does my mapping library want the bbox in a different order?
Leaflet, Google Maps and several others take latitude first because that is how coordinates are conventionally spoken and written. GeoJSON follows the x-then-y convention of geometry instead. Both orderings are emitted here so you can copy whichever fits.
How is the polygon area calculated?
With the spherical excess formula on a sphere of mean Earth radius, which accounts for longitude lines converging toward the poles. Interior rings are subtracted, so a polygon with holes reports its net area.
Can this handle a FeatureCollection with mixed geometry types?
Yes. Every coordinate in the input contributes to the bounding box regardless of geometry type, while area sums only across polygons and length only across lines.
Is my GeoJSON uploaded to be measured?
No. The document is parsed and measured in your browser, so location data that may be sensitive never crosses the network.

Related tools

All ArrayKit tools