How IP geolocation works, and why it's often wrong

Websites don't read your location from your device; they look your IP up in a database. Where that data comes from, when it's wrong, and how to check it.

Popo
On this page

When a website shows your location from your IP, it isn't reading anything from your phone or computer. All it has is your IP address, which it looks up in an IP geolocation database that says roughly which country, region and city the address is in. Those locations are inferred: the country is usually right, the region mostly right, the city often off, and a street address is out of reach entirely.

Your device
Only the IP travels
Website203.0.113.45
Looks it up
IP geolocation databaseLocation of each block, inferred
London, United Kingdom51.51, -0.13 is a point in the city, not you
All a website gets is your IP address; the location comes from a database lookup. The coordinates in the result are just a reference point in the city.

Where the location comes from

An IP address carries no location of its own. IP geolocation databases are maintained by specialist companies that map every block of addresses to a place, using a few kinds of evidence:

  • Registration records: which country a block is registered in and which organization holds it. That only says where the holder is, and the addresses may be used in another country, as Native and cross-border IPs explains. Registration is just a starting point.
  • Locations published by networks: many cloud providers and ISPs publish a list in the RFC 8805 format (a geofeed) saying which country, region and city each of their blocks is in, and databases read it regularly; Native and cross-border IPs shows an example. It's only as accurate as the network that fills it in.
  • Network measurements: servers at known locations send packets to an address and time the replies. Light travels about 200 km per millisecond in fiber, so an address that answers within a 1 ms round trip can't be more than about 100 km away. Router names along a traceroute also often contain city or airport codes.
  • Usage data: some apps and websites know a device's approximate location with the user's permission. Put together, that shows which city most users of a block are in. Corrections submitted by users feed in too.

Each database has its own sources, methods and update schedule, so the same IP can show different cities on different websites.

Narrowing it down with latency

Network measurement is the easiest to see. Below is a real measurement: probes in 8 cities ping the same address, a RIPE Atlas measurement anchor in IIJ's Tokyo data center, and each probe keeps its fastest round trip.

Ping from 8 cities to one address in Tokyo

Round tripAt most
Tokyo
2.2 ms
220 km
Osaka
9 ms
900 km
Taipei
33 ms
3,300 km
Seoul
36 ms
3,600 km
Hong Kong
50 ms
5,000 km
Los Angeles
120 ms
—
Singapore
181 ms
—
Frankfurt
238 ms
—
Measured with Globalping on 25 November 2026, 4 packets per probe, fastest kept. “At most” is the round trip in milliseconds times 100 km; for probes too far away the range tells you nothing, shown as “—”.

The Tokyo probe got a reply in 2.2 ms, so the address is no more than about 220 km from it. Osaka took 9 ms: no more than about 900 km. Overlap the ranges from several probes and you can draw a circle around where the address must be.

Latency only gives an upper bound, though. Singapore is much closer to Tokyo than Los Angeles is, yet its reply took 60 ms longer, because that route takes a long detour. Measurement rules out places the address can't be; to pin down a city, you need a probe close enough to the target.

How accurate it gets

  • Country: almost always right for home broadband and datacenter addresses. Mistakes mostly come from mobile networks, cross-border IPs and satellite internet, covered below.
  • Region or state: mostly reliable.
  • City: often lands on a neighboring city or the nearest big one. Big cities are more accurate than small towns, and home broadband more accurate than mobile.
  • Street address: not possible. IP geolocation can't find your house.

For cities, there are the vendors' own numbers. MaxMind checks IP addresses of users with known locations against its database and counts how often the city it gives is within 50 km of the real place:

How often the city is right

  • Within 50 km
  • A city, but over 50 km off
  • No city at all
  1. China67%22%11%
  2. United States62%31%
  3. Japan52%41%
  4. South Korea75%12%12%
  5. Germany73%26%
  6. United Kingdom70%21%9%
  7. India65%33%
  8. Brazil86%14%
Data from MaxMind's published city accuracy (copied on 25 November 2026; broadband and mobile, IPv4 and IPv6 combined). In Japan, four in ten addresses only get a country.

The coordinates in a lookup aren't your location either, just a reference point for the area: a point in the city when the city is known, or somewhere in the middle of the country when only the country is. In the US this once went badly wrong. MaxMind put every US address it couldn't narrow down to a city on a default point near the center of the country, which happened to be a farm in Kansas. About 600 million addresses "located" to that one household, and for years police and angry strangers showed up at the door looking for whoever was behind an IP. When the story came out in 2016, MaxMind moved its default point to the middle of a nearby reservoir.

Before 201638.0000, −97.0000A farm near Potwin, Kansas
Moved after the story broke
Today37.751, −97.822The middle of Cheney Reservoir
The default point isn't anyone's location. It only means “somewhere in the US”.

You can still find that point. The US Army's 6.0.0.0/8 has no city data, and in MaxMind's free GeoLite database 99.97% of it sits on the lake's coordinates:

Terminal
curl -s "https://stat.ripe.net/data/maxmind-geo-lite/data.json?resource=6.0.0.0/8" \  | jq -r '.data.located_resources[].locations[] | select(.covered_percentage > 1)           | "\(.country) \(.latitude) \(.longitude) \(.covered_percentage)%"'US 37.751 -97.822 99.97%

When it's wrong

SituationLocation shown
Mobile dataThe city of the carrier's gateway, often a hub
Roaming abroadUsually your home country
Office network or corporate VPNThe headquarters or network exit
Proxy or VPNThe exit server
Satellite internetThe ground station, which can be hundreds of km away
Block recently movedIts old location, until databases catch up
Anycast addressNo single location; each user reaches a nearby node

The most common cases:

Mobile networks. Phone traffic reaches the internet through the carrier's gateways, which sit in a handful of big cities. Websites see an address handed out by the gateway, so the location is the gateway's (see Mobile IPs). When you travel, and especially when you roam abroad, traffic often goes back through a gateway in your home region or country first, so your IP still shows where you came from.

You, traveling in TokyoUK SIM on mobile data
Japanese carrier’s tower
Traffic goes home first
Your UK carrier’s gatewayYour IP comes from here
Websites and appsLocation: United Kingdom
When you roam abroad, traffic usually goes back to your home carrier's gateway before reaching the internet. That's the default for roaming, so your IP still shows your home country.

Office networks. Office networks and corporate VPNs often send all internet traffic out through the headquarters or a cloud exit, so someone working in another city shows up where the exit is.

Proxies and VPNs. Websites see the exit server, so the location is the server's. Apple's iCloud Private Relay is an exception: by default it picks an exit in your general area, so the location websites see doesn't stray too far.

Moved addresses. ISPs move address blocks between cities, and IPv4 addresses are bought, sold and leased. After a block moves, databases can take weeks or months to catch up, and until then they show the old location.

Some databases also have less data for IPv6 than for IPv4 (see IPv4 vs IPv6). On a network with both, the two addresses can be placed in different cities, so different websites see you in different places.

How to see and check an IP's location

The CKIP home page shows where the IP you're using right now is located. The Location row gives the country, region and city, with the registration country on the right, and the time zone and coordinates row and the map give the reference point. CKIP's location also comes from IP geolocation data, so everything above applies to it too.

To find out where a server really is, use global ping, which measures latency from probes around the world; the closer a probe is to the server, the faster it gets a reply. From the fastest probe, CKIP works out roughly how far away the target can be, compares that with the IP's listed location and tells you whether they agree. This works for servers. Home broadband and mobile addresses often don't answer pings, or the reply comes from the carrier's equipment.

If your home connection keeps showing the wrong city, there's nothing to change on your side: each website chooses its own geolocation database. The major databases accept correction requests, but websites use different databases and update on different schedules, so fixing one doesn't change what every site shows.