Utilia

Bounding Box Calculator

Calculate the bounding box of coordinates, GeoJSON or WKT as minLon,minLat,maxLon,maxLat, WKT, Overpass or Leaflet, with padding and antimeridian support.

Build the box

How to calculate a bounding box

  1. Under Build the box, keep From coordinates or GeoJSON and paste your data into Coordinates, GeoJSON or WKT, or drop a file. You can paste: - one point per line, such as 45.5017, -73.5673 (commas, spaces, semicolons or tabs all work, and header lines without numbers are skipped); - a GeoJSON Feature, FeatureCollection or geometry; - WKT such as LINESTRING (2.35 48.85, 4.83 45.76); - a JSON array of pairs like [[45.5, -73.6], [46.8, -71.2]].
  2. For plain number pairs, set Order of plain number pairs to Latitude, longitude or Longitude, latitude. GeoJSON and WKT are always longitude first. Hemisphere letters (45.5N 73.6W) override the order.
  3. Optionally add Padding as a percentage of the box size or in kilometres, and choose the number of Decimals.
  4. Click Calculate (results also update as you type). Use the Copy button next to the format you need.

To build a box around a place instead, choose From a center and a size and enter the center latitude and longitude with a Width (km) and Height (km).

Output formats

The box is described by four numbers: west (minimum longitude), south (minimum latitude), east (maximum longitude) and north (maximum latitude). Different tools expect them in different orders, which is a classic source of bugs:

  • GeoJSON bbox [minLon, minLat, maxLon, maxLat], the order of RFC 7946, also used by the OpenStreetMap API, Mapbox and many web APIs (the comma list).
  • Overpass south,west,north,east, the order of Overpass QL (bbox) filters.
  • Leaflet [[south, west], [north, east]], ready for fitBounds.
  • WKT polygon and GeoJSON geometry, a closed rectangle with counter-clockwise corners, for PostGIS, QGIS or a spatial database.

The results also show the center, the width measured along the center’s parallel, the height along a meridian and the area on a sphere of radius 6,371 km, computed exactly as R²·Δλ·(sin φnorth − sin φsouth).

Crossing the antimeridian

Points near ±180° longitude, for example in Fiji, the Aleutians or eastern Russia, are a trap: a naive minimum and maximum of 178° and −179° gives a box almost 360° wide. With Smallest box across ±180° checked, the tool sorts the longitudes, finds the largest empty gap around the globe and keeps the complement, so that box is only 3° wide. RFC 7946 expresses this with west greater than east ([178, -18, -179, -16.5]). Since many tools, Overpass included, cannot read such a box, the tool also gives two boxes split at ±180°, and the WKT and GeoJSON shapes become MultiPolygons. Uncheck the option to get a plain minimum and maximum instead.

Padding

A percentage adds that fraction of the width to the west and east sides and of the height to the south and north sides. A distance in kilometres adds the same distance on every side: 1° of latitude is about 111.2 km, and a degree of longitude shrinks with the cosine of the latitude, so the tool uses the latitude closest to a pole to be sure every point is covered. Latitudes are capped at ±90°. A single point has no size, so use kilometres to pad it.

Frequently asked questions

In which order are the coordinates of a bounding box?

In GeoJSON and most web APIs: minimum longitude, minimum latitude, maximum longitude, maximum latitude (west, south, east, north). Overpass uses south, west, north, east. The tool gives both, labelled.

Why does my box span almost the whole world?

Your points probably straddle the ±180° meridian. Keep Smallest box across ±180° checked to get the short way around.

Can I use degrees, minutes and seconds?

Enter decimal degrees. Hemisphere letters are understood (48.85N 2.35E), but minutes and seconds are not; convert them first.

How accurate are the width, height and area?

They use a spherical Earth, which is within about 0.5% of the WGS 84 ellipsoid. That is fine for sizing a map view or a query area, not for surveying.

Is my data uploaded?

No. The calculation runs in your browser and the coordinates you paste or drop never leave your device.