How Does IP Geolocation Work?
IP & Networking

How Does IP Geolocation Work?

IP geolocation maps your IP address to an approximate physical location. Learn how it works, how accurate it is, and why your IP might show the wrong city.

5 min readΒ·

IP geolocation is the process of determining the physical location of a device based on its IP address. It is used by websites to show you local content, enforce regional restrictions, and detect fraud. You can see what your IP reveals about your location right now on whatsmy.fyi.

How Does IP Geolocation Work?

IP addresses are allocated to organisations (ISPs, companies, universities) in geographic blocks. These allocations are recorded in public databases maintained by regional internet registries like RIPE (Europe), ARIN (North America), and APNIC (Asia-Pacific). IP geolocation databases cross-reference these registries with additional data sources to map IP ranges to cities, regions, and countries.

Data sources used to build geolocation databases include:

  • Regional internet registry (RIR) allocation records
  • BGP routing tables (which show which ISP announces which IP block)
  • Wi-Fi probe data and GPS correlations from mobile networks
  • User-submitted location corrections
  • Active network measurements and traceroutes

whatsmy.fyi does not use a third-party geolocation API. Instead, it reads location data directly from the Cloudflare request object (cf.city, cf.country, cf.region), which is derived from Cloudflare's own continuously updated geolocation data. This approach has near-zero latency and no external dependency.

How Accurate Is IP Geolocation?

Accuracy varies significantly depending on the type of connection:

  • Country level: Very accurate (95–99% correct). Almost all geolocation services correctly identify the country.
  • City level: Moderately accurate (50–80% correct to within 25 miles for fixed broadband). Can be significantly off for mobile connections, satellite internet, or corporate VPNs.
  • Street address: Not provided and not possible. IP geolocation cannot determine your street address.

Why Can IP Geolocation Be Wrong?

Several factors cause IP geolocation to show the wrong city or region:

  • ISP routing: Your ISP may route your traffic through a hub city far from your actual location. A user in a rural area may appear to be in the nearest large city.
  • VPN or proxy: If you use a VPN, your IP address belongs to the VPN server, not your physical location. Geolocation will show the VPN server's location.
  • Corporate networks: Employees connecting through corporate VPNs often appear to be at the company's headquarters.
  • Mobile networks: Mobile IP addresses are assigned by the carrier and may correspond to a data center rather than the cell tower you are connected to.
  • Stale database entries: IP address blocks are regularly reassigned between organisations. Databases that are not frequently updated may contain outdated location mappings.

What Information Is Included in IP Geolocation?

A complete IP geolocation lookup typically returns:

  • Country and country code (e.g., US, DE)
  • Region/state (e.g., California, Bavaria)
  • City (e.g., San Francisco, Munich)
  • Postal code (accuracy varies widely)
  • Latitude and longitude (typically city-level, not street-level)
  • Timezone (e.g., America/Los_Angeles)
  • ISP and ASN (Autonomous System Number)
  • Whether the IP is within the European Union

Who Uses IP Geolocation?

IP geolocation is used across many industries:

  • Content localization: Netflix, Spotify, and other streaming services use it to enforce regional licensing agreements.
  • Fraud detection: Banks flag logins from unexpected countries as potentially fraudulent.
  • Advertising: Ad networks use location data to serve relevant local ads.
  • Analytics: Website analytics platforms aggregate visitor locations to provide geographic breakdowns.
  • Legal compliance: Online gambling and financial services restrict access based on jurisdiction.

Frequently Asked Questions

Can websites see my exact home address from my IP?

No. Websites can only determine your approximate city and ISP from your IP address. Your exact street address requires data that only your ISP holds, and they are legally required to keep it private.

Why does whatsmy.fyi show the wrong city?

This is a known limitation of IP geolocation. If your ISP routes traffic through a hub city, or if you are on a mobile network, the shown city may differ from your actual location. Using a VPN will show the VPN server's location instead of yours.

Does IP geolocation comply with GDPR?

Under GDPR, IP addresses are considered personal data. Processing them requires a legal basis. Most services that use IP geolocation for content localization rely on legitimate interest (Article 6(1)(f)). whatsmy.fyi processes your IP solely to display it to you and stores nothing.

Check your IP address, location, and privacy score β€” instantly.

Zero logs. Zero tracking. Zero external APIs.

Run the check now β†’

Related articles

How Does IP Geolocation Work? | whatsmy.fyi