What Is a Bounding Box?
A bounding box (bbox) is the smallest axis-aligned rectangle that completely encloses a set of geometries. It is defined by four values: the minimum longitude (west), minimum latitude (south), maximum longitude (east), and maximum latitude (north). In GeoJSON, bounding boxes are represented as an array: [west, south, east, north].
The RFC 7946 specification allows an optional bbox member on any GeoJSON object. Including it helps applications quickly determine the spatial extent of the data without parsing every coordinate. Many mapping libraries use the bbox to set the initial map viewport.
How to Use the Bounding Box Calculator
Paste your GeoJSON into the input panel and the tool will calculate the bounding box across all geometries in the data. The result includes the four corner values plus a ready-to-use array format you can copy directly into your code.
The bounding box is also drawn as a dashed rectangle on the map so you can check it against the extent you expected. That makes it a quick data check in its own right: an unexpectedly large box usually means an outlier point or a swapped coordinate pair is dragging the extent somewhere it should not reach.
The tool flags one case explicitly. An envelope wider than 180 degrees of longitude is almost always data straddling the 180th meridian, where an axis-aligned box computed from minimum and maximum ordinates wraps the wrong way around the globe. The box is still returned, with a warning, because the correct fix depends on your data: usually splitting the geometry at the date line into two parts.
Bounding Box Format
The output follows the standard GeoJSON bbox format as defined in RFC 7946 Section 5:
JSON (excerpt){
"type": "FeatureCollection",
"bbox": [-73.99, 40.70, -73.95, 40.80],
"features": [...]
}The four values are always in the order [minLng, minLat, maxLng, maxLat]. For 3D coordinates, the bbox extends to six values: [minLng, minLat, minAlt, maxLng, maxLat, maxAlt]. This tool currently outputs the 2D four-value format.
Common Uses for Bounding Boxes
- Setting the initial map viewport to fit all features with
map.fitBounds() - Filtering spatial queries in PostGIS using
ST_MakeEnvelope - Requesting map tiles for a specific region from tile servers
- Validating that data falls within an expected geographic area
- Adding
bboxto GeoJSON responses for API consumers - Clipping data to a region using the clip tool
Deriving a bbox in Code
In JavaScript with Turf.js:
JavaScriptconst bbox = turf.bbox(featureCollection);
// [minLng, minLat, maxLng, maxLat]
// Use with Leaflet:
map.fitBounds([[bbox[1], bbox[0]], [bbox[3], bbox[2]]]);In Python with Shapely:
Pythonfrom shapely.geometry import shape, box
polygon = shape(geojson_geometry)
minx, miny, maxx, maxy = polygon.bounds
bbox_polygon = box(minx, miny, maxx, maxy)Related tools: centroid calculator for finding the center point, area calculator for measuring polygon area.