GeoJSON Bounding Box
Compute the bounding box [minLng, minLat, maxLng, maxLat] of any GeoJSON document — Feature, FeatureCollection, or raw Geometry. Optionally inject the result as the top-level bbox member per RFC 7946 §5. 100% in-browser.
GeoJSON Bounding Box
What this tool does
It computes the axis-aligned bounding box of any GeoJSON document — a Feature, a FeatureCollection, or a bare geometry — and hands you back a four-element array, [minX, minY, maxX, maxY], which is [west, south, east, north] in [lng, lat] order. That's the smallest rectangle that contains every coordinate in the file.
The intent it closes: "I have a GeoJSON file and I need its extent" — to set a map's initial view, to add the RFC 7946 bbox member, or to feed a spatial index. There are no options to set: you paste, you click, you get the box. It does not check whether the file is valid GeoJSON beyond being parseable JSON — for that, the Validator is the right tool.
How this tool works
One click runs the whole thing, entirely in your browser.
1. Parse
Your text goes through the browser's JSON parser. If it isn't valid JSON — a trailing comma, an unclosed bracket — the status bar shows JSON parse error. and nothing is bounded. A clean parse is the only requirement.
2. Walk every coordinate
The tool recurses through the document, descending into features, into each geometry's coordinates, and into nested GeometryCollections, until it reaches the raw [lng, lat] number pairs. As it visits each pair it tracks the running minimum and maximum longitude (X) and latitude (Y). It works the same way for a Point, a deeply nested MultiPolygon, or a mixed collection — every coordinate counts, none more than once.
3. Return the box
When the walk finishes, the four tracked values become [minX, minY, maxX, maxY] and appear in the output pane. The status bar reports the span and the count — for example bbox computed · width 48.44°, height 2.98° · 2 feature(s). — where width is the longitude span (maxX − minX) and height the latitude span. If the walk found no finite coordinates at all (an empty FeatureCollection, say), nothing is returned and the bar shows No coordinates found — nothing to bound.
Two ways to take the result
Copy bbox array gives you just the four numbers. Download with bbox re-emits your original document with the computed array inserted as a top-level bbox member — placed right after type for readability — and saves it as with-bbox.geojson (application/geo+json), following the RFC 7946 §5 bbox convention. You have to compute first; download before that and the bar reminds you with Compute the bbox first.
Example
Input:
{
"type": "FeatureCollection",
"features": [
{ "type": "Feature", "geometry": { "type": "Point", "coordinates": [-122.42, 37.77] }, "properties": {} },
{ "type": "Feature", "geometry": { "type": "Point", "coordinates": [-73.98, 40.75] }, "properties": {} }
]
}
Output bbox:
[-122.42, 37.77, -73.98, 40.75]
Tips & common pitfalls
- Order matters. RFC 7946 §5 specifies
[west, south, east, north], i.e.[minLng, minLat, maxLng, maxLat]. Some tools emit[lat, lng]order — this one does not. - Antimeridian crossings. A FeatureCollection that straddles 180°/−180° produces a bbox that wraps the long way around the world rather than two split boxes — the conservative behaviour most GIS libraries share. If you need the spec-compliant crossing form, post-process the array yourself.
- Empty input. A document with no geometries returns no bbox — there's nothing to bound, and the status bar says so.
- Z values are ignored. If your coordinates carry a third altitude entry, the box stays 2D and four-element. The spec allows a six-element 3D bbox, but it's rare and not emitted here.
Troubleshooting
I get a "JSON parse error." message.
The input isn't valid JSON. Check for missing quotes around keys, unclosed brackets, smart quotes, or a trailing comma after the last features entry. Once it parses cleanly, the bbox computes.
It says "No coordinates found — nothing to bound."
The document parsed, but the walk reached no [lng, lat] number pairs — usually an empty FeatureCollection, a feature with null geometry, or non-GeoJSON JSON. Add at least one geometry with coordinates.
"Download with bbox" did nothing and the bar says "Compute the bbox first."
The download re-uses the last computed box, so click Compute bbox before downloading. After a successful compute the button saves with-bbox.geojson.
FAQ
What format is the output?
A four-element JSON array: [minLng, minLat, maxLng, maxLat]. This matches the bbox member defined in RFC 7946 §5 and is what most GIS libraries (Turf, Leaflet, Mapbox GL) expect.
Does it modify my GeoJSON?
Only if you click Download with bbox. That re-emits the original document with a top-level bbox member added right after type (or replaced if one already existed). Copy bbox array just gives you the four numbers.
What do the width and height in the status bar mean?
They're the span of the box in degrees — width is the longitude range (maxX − minX) and height the latitude range (maxY − minY). They're a quick sanity check that the extent looks right for your data.
Is my data uploaded anywhere?
No. All the math happens in your browser. Your coordinates never leave the tab, and the page works offline once loaded. See the privacy policy for details.