IP geolocation
The server converts the visitor's IP into an approximate country, region and city.
In one line
Can guess your country, region and city from your IP address
The server converts the visitor's IP into an approximate country, region and city.
Commercial databases (MaxMind, IPinfo, IP2Location) map IPs to places. Vendors claim about 99.8% country accuracy, but city accuracy is much lower and mobile or VPN IPs often point to the carrier hub or exit.
What it can and can't do
What the user does: Nothing. It happens when your device connects to the site
It can
- Look up a likely country, region and city from your IP
- Show local content, prices and language
- Spot a mismatch with your time zone, such as when you use a VPN
It cannot
- Find your street or home; city guesses are much less exact than country
- Get it right on mobile and VPN connections, which often point to a carrier hub or exit
- Know your name or account from it
Browser support
| Browser | Status | First version | Released | Note |
|---|---|---|---|---|
| Chrome | Supported | 1 | 2008-12-11 | None |
| Edge | Supported | 79 | 2020-01-15 | None |
| Firefox | Supported | 1 | 2004-11-09 | None |
| Safari | Supported | 1 | 2003-06-23 | None |
| Safari on iPhone | Supported | 1 | 2007-06-29 | None |
| Chrome on Android | Supported | 1 | Not listed | None |
| Samsung Internet | Supported | 5.0 | 2016-12-15 | None |
How a site asks for it
| API | GeoIP lookup of the client IP (MaxMind GeoIP2, IPinfo) |
| How access is granted | none |
| What the user sees | Not listed |
| Needs a secure context (HTTPS) | No |
| Needs a user gesture | No |
| How long it lasts | Not listed |
| How to take it back | Not listed |
| Inside an iframe | Not listed |
Typical flow
- Read client IP
- Query a local or API database
- Return country, region, city, postal, lat and long
Data you get
What comes back: Country, region, city, lat and long with accuracy radius
Shape: object
| Field | Type | Unit | Range | Precision |
|---|---|---|---|---|
accuracy radius | integer | km | 5 to 1000 | city level in good cases, vendor reported |
country | string | None | ISO 3166 | about 99.8% vendor claim |
Technical limits
- City accuracy varies widely and is often wrong for mobile and VPN users
- Does not reveal street address
The story
What it is
A site turns your internet address into a guess of your country, region and city.
For you
You never have to allow anything. Sites guess your country and often your city from your internet address. It is right for countries most of the time, less for cities. A VPN changes the guess.
For makers
Makers use it for local prices, language, taxes and rights. Ads use it for regional targeting. Fraud teams compare it with your billing address and sign in history.
Where you see it
| Type | Example | Apps |
|---|---|---|
| games | A game site picks your server region and shows local store prices. | Roblox, Steam |
| games | A cloud gaming service uses it to see which data center is close to you and whether the game is licensed in your country. | GeForce NOW, Xbox Cloud Gaming |
| media | A streaming service uses it to show only the shows allowed in your country. | Netflix, BBC iPlayer |
| shopping | A store shows prices, taxes and delivery for your country. | Amazon, IKEA |
| ads | An ad network shows local ads for your city, such as nearby store offers. | None named |
| security | A bank flags a login from a country the customer has never visited. | None named |
| analytics | A site measures where its readers live without asking them. | Google Analytics |
Risks
- Reveals rough location
- Can be wrong
Good uses and abuse
Legitimate uses
- Content localization, tax and licensing, fraud rules
Known abuse
- Price discrimination, geoblocking, stalking via leaked city
Scores
| Score | Value | Meaning |
|---|---|---|
| Sensitivity | 2 of 5 | How revealing the data is |
| Utility | 5 of 5 | How useful it is to honest apps |
| Friction | 0 of 5 | How much the user has to do |
| Fingerprint bits | 3 | Rough identifying entropy, when known |
Related capabilities
Related
- Client IP address. Can see the public internet address your connection uses
- VPN, proxy and Tor detection. Can guess whether you are hiding behind a VPN, proxy or Tor, but not always correctly
Sources
How well checked: Based on official documentation.