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 displayed visually as a dashed rectangle on the map so you can verify it matches the expected extent. This is particularly useful for catching data issues — if the bounding box is unexpectedly large, you may have an outlier point or a swapped coordinate pulling the extent to an unintended area.
Bounding Box Format
The output follows the standard GeoJSON bbox format as defined in RFC 7946 Section 5:
JSON{
"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
Programmatic Equivalent
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.