Buffer radius bounding box calculator for latitude and longitude
A 1000 m buffer around 51.5074, −0.1278 becomes the four limits of the smallest latitude and longitude rectangle that encloses it, with flags for the antimeridian and the poles. It works as a fast prefilter before the exact distance test. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Latitude
- 51.5074
- Longitude
- -0.1278
- Radius m
- 1,000
- Min lat
- 51.4984067964
- Min lon
- -0.1422489201
- Max lat
- 51.5163932036
- Max lon
- -0.1133510799
This buffer radius bounding box calculator converts a center latitude, center longitude, and radius in meters into the smallest latitude-longitude rectangle that encloses the corresponding circular buffer on a spherical Earth. The result supplies minimum and maximum coordinates plus flags that identify antimeridian crossings and full-longitude coverage. It is useful when a database, map service, or spatial index needs a fast rectangular prefilter before applying a more precise distance test.
Enter a center and radius with clear units
Latitude must remain between -90 and 90, longitude between -180 and 180, and the radius cannot be negative. A zero radius is valid and produces a degenerate box whose four coordinate limits identify the original point. The calculation uses the IUGG mean Earth radius of 6,371,008.8 meters, a practical spherical model for search regions, map previews, and database prefilters.
Because the Earth is not a perfect sphere, this rectangle should not be presented as a survey-grade boundary. Its job is to enclose a circular geodesic search area reliably under the stated model. Use the same coordinate reference assumptions throughout your workflow, and keep the radius in meters rather than silently passing kilometers, miles, or degrees.
Read ordinary and antimeridian-crossing results
In an ordinary result, each minimum is numerically below its corresponding maximum, so the rectangle can be used directly in a conventional range query. Longitude needs special treatment around 180 degrees. Do not reorder those values, because doing so would select the large complementary region instead of the narrow box surrounding the center.
The latitude interval remains a single ordinary range. For a robust candidate search, first filter records with this box and then calculate their actual great-circle distance from the center; rectangle membership alone includes corner points lying outside the circular buffer.
What you can do with it
Prefilter a nearby-place query
Create index-friendly latitude and longitude ranges before running an exact distance comparison on the smaller candidate set.
Choose an initial map viewport
Derive geographic limits that contain a radius around a selected location, including safe behavior near poles and the antimeridian.
Partition geospatial work
Turn point-and-radius jobs into deterministic rectangular extents for cache keys, tiles, queues, or downstream spatial operations.
FAQ
How much does a request cost?
The calculation also runs in the browser for supported web use.
Which Earth model is used?
The calculation uses a sphere with the IUGG mean Earth radius of 6,371,008.8 meters.
Does every point inside the box fall within the radius?
No. The box encloses the circular buffer, so its corners can be farther from the center. Apply an exact distance test when necessary.
How do I query a box that crosses the antimeridian?
Split the longitude into two ranges: from the minimum longitude up to 180, and from −180 up to the maximum. When the crossing flag is on, the minimum is numerically greater than the maximum on purpose, so do not swap them.
What happens when the buffer reaches a pole?
The longitudes become −180 and 180 and the all-longitudes flag turns on, because every meridian meets at the pole. Filter by the latitude limits only and skip the longitude filter in that case.
Related tools
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/geo/buffer-bbox \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"lat":51.5074,"lon":-0.1278,"radius_m":1000}'const res = await fetch("https://api.kit.forhosting.com/geo/buffer-bbox", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"lat": 51.5074,
"lon": -0.1278,
"radius_m": 1000
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/geo/buffer-bbox",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"lat": 51.5074,
"lon": -0.1278,
"radius_m": 1000
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/geo/buffer-bbox", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"lat":51.5074,"lon":-0.1278,"radius_m":1000}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"lat":51.5074,"lon":-0.1278,"radius_m":1000}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/geo/buffer-bbox", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"lat": 51.5074,
"lon": -0.1278,
"radius_m": 1000
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "geo.buffer_bbox",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
Enter a center and radius with clear units
Provide the center as decimal-degree lat and lon values, then provide radius_m in meters.
Read ordinary and antimeridian-crossing results
The four primary values are min_lat, min_lon, max_lat, and max_lon. If the circular buffer crosses the antimeridian, longitudes wrap from positive values to negative values and crosses_antimeridian becomes true. In that case, min_lon is numerically greater than max_lon by design. Query the longitude as two ranges: min_lon through 180, and -180 through max_lon.
Handle polar buffers and global radii
A buffer that reaches either geographic pole cannot be represented by a narrow longitude interval: every meridian meets at that pole. The same full-world longitude result applies when the radius reaches half the spherical circumference, because a larger circular neighborhood covers the entire globe. The algorithm is deterministic, uses no network calls or stored data, and makes no time-dependent decisions. Remember that a bounding box is an efficient enclosure, not a polygon tracing the circular edge, so a final distance check remains appropriate whenever exact inclusion matters. For that reason, the calculator returns min_lon of -180 and max_lon of 180 and sets covers_all_longitudes to true whenever the latitude span reaches a pole. In full-longitude cases, crosses_antimeridian is false because splitting the interval would add no information. Consumers should use the latitude limits and skip longitude filtering when covers_all_longitudes is true. This behavior avoids unstable division near the poles and prevents a deceptively narrow box from excluding valid points.
Technical questions
Why can min_lon be greater than max_lon?
That ordering indicates an antimeridian crossing. Treat the result as two longitude ranges rather than swapping its edges.
What happens when the buffer reaches a pole?
The longitude range becomes -180 through 180 and covers_all_longitudes is true because all meridians meet at a pole.