GeoIP (short for "geolocation by IP address") is the practice of estimating a device's physical location from its public IP address, without needing GPS, Wi-Fi positioning, or any input from the device itself. It's the technology behind things like currency auto-selection on shopping sites, regional content restrictions, and the "location" column in a server's access logs.
Where the data actually comes from
IP addresses aren't inherently tied to a location. An IP is just a numeric identifier assigned to a network interface. GeoIP databases build their location estimates by combining several data sources:
- Regional Internet Registry (RIR) records. Organizations like ARIN, RIPE NCC, APNIC, LACNIC, and AFRINIC allocate blocks of IP addresses to ISPs and companies, and publish (roughly) which country or region each block was allocated to.
- ISP and network operator data. Larger ISPs allocate sub-blocks of their address space to specific regions or points of presence, which GeoIP providers map where that data is available.
- Routing and latency measurements. Some providers infer location by measuring network latency and routing paths from many vantage points, narrowing down where a block of addresses is likely to be physically connected.
- Crowdsourced and inferred signals. Some databases incorporate anonymized location data from apps or browsers that voluntarily report GPS/Wi-Fi location alongside their public IP, which helps correct or refine the RIR-based estimate.
What GeoIP can tell you
A typical GeoIP lookup returns a mix of the following, though not every field is available for every IP:
- Country, region/state, and city (accuracy decreases in that order)
- Latitude/longitude: usually the centroid of the city or ISP node, not the actual device
- ISP and organization name
- ASN (Autonomous System Number): see our ASN vs ISP guide for what this means
- Timezone
- In more advanced datasets: whether the IP belongs to a known proxy, VPN, hosting provider, or Tor exit node
Why it's an estimate, not a fact
Country-level accuracy for GeoIP is generally very high, well above 95% for most databases, since RIR allocation records are authoritative at that level. City-level accuracy is much lower, commonly cited in the 50-80% range depending on the region and how mobile the address space is. A few things routinely throw off city-level accuracy:
- Mobile carrier networks often route traffic through a small number of centralized gateways, so every phone in an entire state can appear to be in one city.
- VPNs and proxies deliberately place you at their server's location, not yours.
- Corporate networks sometimes route all outbound traffic through a head office, so a branch office's IP resolves to headquarters' city.
- IP address reassignment happens constantly; a database that hasn't refreshed recently may show stale data.
For most practical uses (fraud screening, log forensics, content localization, abuse investigation), country and ISP-level accuracy is what actually matters, and that's where GeoIP is genuinely reliable.
Common use cases
- Security and abuse investigation: spotting where suspicious login attempts or scraper traffic is really coming from.
- Log forensics: turning a wall of raw IPs in a server log into a readable picture of who's hitting your infrastructure.
- Content and pricing localization: showing the right currency, language, or regional catalog.
- Compliance: restricting access to content or services by jurisdiction where required by law.