[ learn ]

How accurate is IP geolocation?

Updated · 5 min read

Short answer

IP geolocation is very accurate for the country, typically around 95–99%, but much less reliable for the city: depending on the country and the type of network, a city guess can be right most of the time or off by tens or hundreds of kilometres. An IP address never reveals a street address or identifies a person; it shows roughly where the network using that address is.

Accuracy by level

LevelTypical accuracyNotes
CountryAbout 95–99%Errors mostly from VPNs, satellite and international corporate networks
Region / stateOften 60–85%Better on fixed broadband, worse on mobile
CityVery variable, roughly 40–80%Good for home broadband in dense countries, poor for mobile and rural areas
Postal codeLowTreat as a hint only
CoordinatesAn area, not a pointUsually the centre of a city or region

These are typical industry ranges, not guarantees. Accuracy depends heavily on the country, the ISP and whether the connection is fixed or mobile.

Where the location comes from

No IP address carries a location inside it. Geolocation databases build one from several sources (covered in more depth in what is IP geolocation):

  • Registry records: who an address block is registered to, and in which country. That is where the organisation is, not necessarily where the addresses are used.
  • ISP geofeeds: many networks publish which city each of their prefixes serves (RFC 8805).
  • Network measurements: latency from known points, traceroutes and router hostnames, which often contain city or airport codes.
  • Consent-based data: some providers combine anonymous location reports from apps and services with the IP they came from.

dklyIPdatabase combines data from established geolocation databases and caches the results. It does not track visitors to build locations.

Why results go wrong

  • Central gateways. Some ISPs route all customers in a region, or the whole country, through a few hubs. Users then appear in the hub city, often the capital.
  • Mobile networks and CGNAT. Phones share public addresses through a handful of carrier-grade NAT gateways, which can be hundreds of kilometres away. Mobile city results are the least reliable.
  • VPNs, proxies and Tor. The location is that of the VPN or proxy exit server, by design. Privacy relays such as iCloud Private Relay deliberately show only an approximate region. See how VPN detection works.
  • Satellite internet. Users appear at the provider's ground station or point of presence, sometimes in a neighbouring country.
  • Corporate networks and cloud. Employees on a company VPN appear at the head office or a cloud region, not their desk.
  • Moved and traded blocks. IPv4 addresses are sold and reassigned; databases can take weeks to catch up.

What it can never tell you

IP geolocation cannot give a street address, a building or the identity of a person. Only the ISP knows which customer used an address at a given time, and it shares that only under legal process. The coordinates in a result are the centre of an area, which is why results include a city or an accuracy radius rather than a house.

Treating those coordinates as an exact spot causes real harm. In a widely reported 2016 case, a farm in Kansas received years of unwanted visits because millions of US addresses with no known city had been mapped to a default point near the centre of the country.

Using geolocation responsibly

IP location works well for defaults and aggregates: choosing a language, currency or country in a form, regional analytics, or as one of several fraud signals. It does not work as proof of where someone is, for emergency location, or to find an individual.

  • Use the country for decisions and the city as a hint.
  • Let users correct their location.
  • Combine it with other signals, such as the browser time zone or billing address.
  • Check the security fields: a VPN flag explains a surprising country.

The use cases page shows these patterns with code.

Test it on yourself

Open What is my IP? and compare the result with where you are. Then try it on mobile data instead of Wi-Fi, or with a VPN switched on: you will usually see the city, and sometimes the country, change. To compare any other address, use the IP lookup.

[ FAQ ]

Frequently asked questions

Can someone find my home address from my IP address?

No. An IP address only points to the network area your ISP serves, usually a city or region. Linking an address to a customer needs the ISP's records, which are normally released only to authorities under legal process.

Why does my IP address show the wrong city?

Common reasons are that your ISP routes traffic through a gateway in another city, you are on mobile data behind carrier-grade NAT, you use a VPN or privacy relay, or your address block was recently reassigned and the databases have not caught up.

How can I get my IP location corrected?

Location data comes from ISPs and geolocation databases. Ask your ISP to publish or fix its geofeed, or report the error to the major database providers. This site uses upstream data, so corrections appear here after those sources update.

Is IP country detection good enough for blocking or compliance?

It is a strong signal, right for the large majority of visitors, but VPNs and proxies can get around it. For stricter needs, combine the country with the security flags such as is_anonymous and with other checks.

Last updated · All articles · API docs