On IP Geolocation Accuracy: A Comparative Study
Live Data: The statistics on this page are fetched dynamically from the ipapi.is geolocation accuracy measurement system. Data is updated as new ground truth measurements are collected.
This article presents an empirical analysis of IP geolocation accuracy across five major geolocation API providers. Ground truth coordinates were collected from real website visitors using the browser's JavaScript Geolocation API, enabling a direct comparison between GPS-level accuracy and IP-based geolocation estimates.
Abstract
IP geolocation—the process of determining a user's physical location based on their IP address—is fundamental to numerous applications including content localization, fraud detection, and regulatory compliance. However, the accuracy of commercial IP geolocation services varies significantly. This study evaluates five prominent IP geolocation providers by comparing their estimates against ground truth GPS coordinates collected with user consent. After filtering non-residential IP addresses (datacenters, VPNs, proxies), the analysis reveals measurable differences in accuracy across providers, with median deviations ranging from approximately 8 km to 18 km.
Introduction
IP geolocation services attempt to map IP addresses to physical locations. These services are widely used for geo-targeting advertisements, enforcing regional content restrictions, detecting fraud, and complying with data sovereignty regulations. Despite their ubiquity, independent accuracy assessments remain scarce due to the difficulty of obtaining reliable ground truth data.
Traditional accuracy evaluations often rely on self-reported user locations or administrative databases, both of which introduce significant uncertainty. This study addresses this limitation by leveraging the browser's HTML5 Geolocation API, which can provide GPS-level accuracy on mobile devices and WiFi-based triangulation on desktop systems.
Methodology
Data Collection Infrastructure
A data collection system was implemented on the ipapi.is website. When visitors navigate to the site, a permission dialog requests access to their device's geolocation capabilities. The dialog explains that data is collected anonymously and temporarily to verify IP geolocation accuracy.
Upon consent, the following data points are recorded:
- GPS Coordinates: Latitude and longitude from the browser's Geolocation API
- Accuracy Radius: The browser-reported accuracy in meters
- Timestamp: UTC timestamp of the collection event
- IP Address: The visitor's public IP address (IPv4 or IPv6)
- Timezone: The browser's reported timezone (e.g.,
Europe/Berlin) - Metadata: Platform, screen dimensions, language preferences, and connection type
IP Classification and Filtering
A critical aspect of this study is the exclusion of non-residential IP addresses from the accuracy calculations. IP addresses belonging to datacenters, VPNs, proxies, Tor exit nodes, and known abusers are filtered out because:
- Datacenters: Traffic from cloud providers and hosting services does not represent typical end-user behavior. The physical location of a datacenter server bears no relationship to the user's actual location.
- VPNs and Proxies: These services intentionally obscure the user's true location by routing traffic through intermediate servers. Geolocation APIs correctly identify the VPN/proxy endpoint, not the user's location.
- Tor Exit Nodes: Similar to VPNs, Tor traffic exits from nodes that are geographically unrelated to the user's position.
- Known Abusers: IP addresses flagged across multiple blocklists may exhibit anomalous behavior.
- Satellite Connections: Satellite internet can serve users across vast geographic areas from a single ground station.
- Crawlers: Automated traffic from bots and crawlers does not represent human users.
Classification was performed using the ipapi.is database, which maintains real-time flags for each of these
categories. Only IP addresses where all classification flags (is_datacenter, is_vpn,
is_proxy, is_tor, is_abuser, is_satellite, is_crawler)
are false were included in the final analysis.
Evaluated Providers
Five IP geolocation providers were evaluated:
- ipapi.is — The subject of this study, which maintains its own geolocation database derived from multiple data sources including geofeeds, WHOIS data, and user submissions.
- ipinfo.io — A widely-used commercial IP intelligence provider.
- ipdata.co — An IP geolocation and threat data provider.
- ip-api.com — A free IP geolocation service with commercial tiers.
- iplocate.io — An IP geolocation API service.
Distance Calculation
Deviation is measured as the Haversine distance between the ground truth GPS coordinates and the coordinates returned by each geolocation provider. The Haversine formula calculates the great-circle distance between two points on a sphere, accounting for Earth's curvature:
function haversine(lat1, lon1, lat2, lon2) {
const R = 6371000; // Earth's radius in meters
const φ1 = lat1 * Math.PI / 180;
const φ2 = lat2 * Math.PI / 180;
const Δφ = (lat2 - lat1) * Math.PI / 180;
const Δλ = (lon2 - lon1) * Math.PI / 180;
const a = Math.sin(Δφ/2) * Math.sin(Δφ/2) +
Math.cos(φ1) * Math.cos(φ2) *
Math.sin(Δλ/2) * Math.sin(Δλ/2);
const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a));
return R * c; // Distance in meters
}
Results
Dataset Overview
Loading dataset statistics...
Accuracy Statistics by Provider
The following table presents the deviation statistics for each provider based on clean residential IP addresses. All distances are reported in kilometers.
Loading provider statistics...
Statistical Interpretation
Loading analysis...
Sample Comparison
The following table shows individual IP lookups to illustrate how accuracy varies across providers and geographic regions:
Loading sample data...
Note: Green indicates superior accuracy (<10 km), red indicates significant deviation (>500 km).
Discussion
Limitations
Several limitations should be considered when interpreting these results:
- Sample Size: The sample is relatively small. Statistical significance of differences between providers is limited, and results may not generalize to all geographic regions or network types.
- Geographic Bias: The sample is derived from visitors to ipapi.is, which may skew toward certain regions (e.g., Europe, North America) where the service is better known.
- Ground Truth Accuracy: Browser geolocation accuracy varies by device and connection type. Desktop browsers using WiFi triangulation may report positions with 35–100m uncertainty, while some entries show very large accuracy radii (e.g., 50,000m for IP-based fallback).
- Temporal Factors: IP geolocation databases are updated at different frequencies. Results represent a snapshot in time and may differ at other points.
Why Filtering Matters
The decision to exclude datacenter, VPN, proxy, and other non-residential traffic is critical for a fair evaluation. Without this filtering, providers that correctly identify VPN endpoints would appear to have "wrong" geolocation when compared against the user's true GPS position—even though the provider is correctly reporting where the traffic is actually originating from (the VPN server).
For example, a user in Berlin connecting through a VPN server in Amsterdam would show a "deviation" of ~650 km if the geolocation provider correctly identifies the Amsterdam VPN endpoint. This is not an error—it's the expected and correct behavior for geolocation of VPN traffic.
Outlier Analysis
Maximum deviations of approximately 15,000+ km (nearly half of Earth's circumference) warrant investigation. Such extreme errors typically occur with:
- Mobile carrier IPs that are geolocated to carrier headquarters rather than the user's location
- CGNAT (Carrier-Grade NAT) addresses shared among users across wide geographic areas
- IPv6 addresses with limited historical geolocation data
- Recently reallocated IP ranges with stale geolocation records
Conclusion
Loading conclusions...
These findings underscore that while IP geolocation can provide reasonable estimates for many use cases, applications requiring high precision should implement additional verification mechanisms or fallback to browser-based geolocation where available.
Future Work
The data collection infrastructure will continue to gather ground truth coordinates to expand the sample size. Future analyses may include:
- Regional accuracy breakdowns (Europe vs. Asia vs. North America)
- IPv4 vs. IPv6 accuracy comparisons
- Mobile carrier vs. residential ISP accuracy
- Temporal analysis of how accuracy changes as databases are updated
The methodology and results presented here aim to provide transparency into IP geolocation accuracy and inform both providers and users of these services about realistic performance expectations.