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
- Reads Features, FeatureCollections, geometries and bare coordinate arrays
- Emits the bbox in both GeoJSON and lat/lng orderings
- Bounding box also produced as a ready-to-paste GeoJSON Feature
- Centre point of the box in latitude and longitude
- Box width and height as real ground distances
- Spherical polygon area with holes subtracted
- Line length across LineString and MultiLineString geometries
- Reports geometry types and coordinate count found
How to use the GeoJSON Bounding Box
- Paste your GeoJSON, or load the sample to see the shape of the output
- Read the west, south, east and north bounds
- Copy the bbox in whichever coordinate order your library expects
- 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
- A map draws the box in the wrong place. — You have almost certainly used the wrong coordinate order. Leaflet's fitBounds wants latitude first; the GeoJSON bbox property wants longitude first. Both orderings are shown separately here for that reason.
- The area is much smaller than a planar calculation suggested. — The spherical figure is the correct one. A degree of longitude is 111 km at the equator but only 78 km in London, so treating degrees as a uniform grid inflates area at higher latitudes.
- The JSON parses but no coordinates are found. — The structure has no coordinates array anywhere in it. Check that features have a geometry object rather than only properties, which happens when an export loses its geometry column.
- Polygon area comes out as zero. — A ring needs at least three distinct positions. A two-point ring, or one where every coordinate is the same, encloses nothing.
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
- GeoJSON Viewer & Validator — Paste or drop GeoJSON to validate it and see its features on a map, with feature counts and a bounding box.
- GeoJSON to CSV — Convert a GeoJSON FeatureCollection to CSV and back — Point features become latitude/longitude columns with their properties.
- Distance Between Coordinates — Measure the great-circle distance between two latitude/longitude points in km, miles and nautical miles, with bearing and a map.
- WKT to GeoJSON — Convert WKT (Well-Known Text) to GeoJSON and back, in your browser.
- KML to GeoJSON — Convert KML ⇄ GeoJSON — turn Google Earth KML into GeoJSON for web maps, or GeoJSON back into KML.
- Coordinate Converter (DMS & Decimal) — Convert coordinates between decimal degrees, DMS and degrees-decimal-minutes, both ways, in your browser.
All ArrayKit tools