📐

Bounding Box Calculator

Calculate a geographic bounding box from a center point and radius

POST 1 credit /v1/geo/bounding-box
curl -X POST "https://geo.toolkitapi.io/v1/geo/bounding-box" \
  -H "Content-Type: application/json" \
  -d '{
    "center": {"lat": 51.5074, "lon": -0.1278},
    "radius": 10,
    "unit": "km"
  }'
import httpx

resp = httpx.post(
    "https://geo.toolkitapi.io/v1/geo/bounding-box",
    json={
    "center": {"lat": 51.5074, "lon": -0.1278},
    "radius": 10,
    "unit": "km"
  },
)
print(resp.json())
const resp = await fetch("https://geo.toolkitapi.io/v1/geo/bounding-box", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "center": {"lat": 51.5074, "lon": -0.1278},
    "radius": 10,
    "unit": "km"
  }),
});
const data = await resp.json();
console.log(data);
# See curl example
Response 200 OK
{
  "min_lat": 51.417522,
  "max_lat": 51.597278,
  "min_lon": -0.270384,
  "max_lon": 0.014784,
  "center": {"lat": 51.5074, "lon": -0.1278},
  "radius": 10,
  "unit": "km"
}

Try It Live

Live Demo

Description

Calculate a geographic bounding box from a center point and radius

How to Use

1

1. Provide the center point as a `center` object with `lat` and `lon` fields.

2

2. Set the `radius` value and optionally specify the `unit` (`km` or `mi`, default: `km`).

3

3. Send a POST request and use `min_lat`, `max_lat`, `min_lon`, `max_lon` in your spatial query.

About This Tool

Use the Bounding Box Calculator to compute the minimum and maximum latitude/longitude coordinates that form a rectangle enclosing a circular area around a center point. This is a common operation for spatial database queries where you need to find all records within a certain radius.

By pre-filtering with a bounding box, you can dramatically reduce the number of candidates before applying a more expensive exact-distance calculation.

Why Use This Tool

Frequently Asked Questions

How does this handle the poles?
If the bounding box extends past a pole, the latitude is clamped to ±90° and the longitude span extends to the full ±180° range.
What is the maximum radius?
The maximum radius is 20,000 km (or the equivalent in miles), which is roughly half the Earth's circumference.
Can I use this with SQL spatial queries?
Yes. Use the output as a `WHERE lat BETWEEN min_lat AND max_lat AND lon BETWEEN min_lon AND max_lon` filter before applying a Haversine distance check.

Start using Bounding Box Calculator now

Get your free API key and make your first request in under a minute.