"How accurate is IP geolocation?" is the first question every team asks — and the honest answer is "it depends on what you need." This article breaks accuracy down by granularity so you can set realistic expectations and design around them.
Accuracy by level
- Country: typically 95-99% correct. Safe for compliance, currency and broad routing.
- Region/state: good but not perfect; expect occasional neighbors.
- City: highly variable — anywhere from very good in dense urban ISPs to "nearest major hub" for mobile and corporate networks.
- Lat/long: an approximation, often the centroid of a city or region — never treat it as GPS.
What degrades accuracy
Several real-world factors pull the estimate away from the user:
- Mobile carriers route subscribers through regional gateways, so the IP can be hundreds of kilometers off.
- Corporate VPNs place remote employees at HQ.
- Consumer VPNs and proxies deliberately relocate the apparent location — detect these explicitly (see how VPN detection works).
- CGNAT shares one IP among many subscribers.
- Recently reallocated blocks may briefly map to an old location.
Designing for imperfect data
Build with the grain of the data, not against it:
- Use country for hard rules (compliance, currency); use city only for soft personalization.
- Always pair geolocation with a VPN/proxy flag so a masked location doesn't silently pass.
- Let users correct their location when it matters (checkout, shipping).
- Combine signals — IP + fingerprint + behavior — for fraud decisions instead of trusting location alone.
How detectip.ai handles confidence
When city-level data isn't reliable, detectip.ai falls back to region or country rather than guessing precisely, and it returns network type (residential, mobile, hosting) so you know how much to trust the location. Combined with the threat verdict, you get a decision you can defend. See the API fields.
FAQ
Can any provider give exact city accuracy? No provider is exact everywhere; be skeptical of "99% city" claims.
Should I block by city? Rarely — block by country, personalize by city.
How do I test accuracy? Sample known IPs across regions and networks; measure country, region and city separately.