Glossary · Location

What is geolocation?

Geolocation is finding where a device is in the real world, as coordinates, a city or a country. Phones use GPS, Wi-Fi and cell towers. A website can ask the browser, which needs the visitor's permission, or look up the visitor's IP address on the server, which needs no permission and reaches a city or region at most.

Sources
GPS, Wi-Fi, cell towers, IP address
Returns
Coordinates, city, country, time zone
In a browser
Asks permission, HTTPS only
From an IP
No prompt, city or region at most

Last reviewed November 20, 2026

How close each geolocation source gets Four circles around one device. GPS is the smallest circle, then Wi-Fi, then cell towers. The IP address circle is the largest and covers a whole city. Illustration, not to scale. IP ADDRESS CELL TOWERS WI-FI GPS

IP address. Your server looks it up in an IP geolocation database. No permission prompt. Reaches a city or region at most, and some addresses only a country.

Illustration, not to scale.
Four sources

How a device's location is found

Each source trades precision for convenience. The ones on the device are the most precise but need the person's permission. The IP address is always available to your server but only reaches a city or region.

SourceHow it worksPermissionHow close it gets
GPS The device reads signals from navigation satellites Needed The most precise of the four, best outdoors
Wi-Fi Nearby Wi-Fi networks are matched to a map of where those networks are Needed Depends on how many known networks are nearby
Cell towers The phone's position is estimated from the towers it can reach Needed The area those towers cover
IP address Your server looks up the visitor's IP address in an IP geolocation database None A city or region at most; some addresses only to a country
On a website

Browser or IP address

A website has two ways to find a visitor's location. A site can use both: the IP address for a default, and the browser when the person wants something near them.

Runs in the visitor's browser

Browser Geolocation API

navigator.geolocation.getCurrentPosition(
  pos => console.log(
    pos.coords.latitude,
    pos.coords.longitude,
    pos.coords.accuracy  // meters
  )
);
Permission
The browser asks the visitor first, and works only on HTTPS pages
Source
The best source the device has, for example GPS
Good for
"Stores near me", maps, delivery tracking
Limit
Nothing comes back if the visitor says no
Runs on your server

IP geolocation

GET https://api.sthan.io/IpGeolocation/8.8.8.8

{ "city": "Mountain View",
  "region": "California",
  "postalCode": "94043",
  "timezone": "America/Los_Angeles",
  "isp": "Google LLC",
  "isHosting": true }
Permission
None; every request already carries an IP address
Source
An IP geolocation database
Good for
Language, currency and region defaults, fraud checks, analytics
Limit
A VPN or proxy shows where its server is

The response above is a real lookup on the sthan.io API on November 20, 2026, shortened. 8.8.8.8 is Google's public DNS, so isHosting is true. The location belongs to the network and says nothing about a person. Every field explained.

Often mixed up

Geolocation, geocoding and reverse geocoding

Geolocation

A device or IPWhere it is

8.8.8.8 is in Mountain View, CA

Geocoding

A street addressCoordinates

1355 Market St, San Francisco to its latitude and longitude

Reverse geocoding

CoordinatesThe nearest address

A phone's GPS position to a street address

Questions

Frequently asked questions

What does geolocation mean?
Geolocation means finding where a device is in the real world, as coordinates, a city or a country. The location comes from GPS, Wi-Fi networks, cell towers or the device's IP address.
What is the difference between geolocation and IP geolocation?
IP geolocation is one kind of geolocation. It uses only the IP address, so it works on a server with no permission prompt, but it reaches a city or region at most. GPS and Wi-Fi geolocation run on the device, are more precise and need the person's permission.
Does geolocation need the user's permission?
In a browser, yes. The Geolocation API asks the visitor for permission before it shares a location, and it works only on HTTPS pages. IP geolocation needs no prompt, because every request to your server already carries the visitor's IP address. Privacy laws such as GDPR still apply to how you use it.
How accurate is geolocation?
It depends on the source. The browser reports its own accuracy as a radius in meters with each position. IP geolocation reaches a city or region at most, and some IP addresses only to a country; a VPN or proxy shows where its server is.
What is the difference between geolocation and geocoding?
Geolocation finds where a device is. Geocoding turns a street address someone typed into latitude and longitude. Reverse geocoding goes the other way, from coordinates to the nearest address.
Is there a free geolocation API?
Yes. The browser Geolocation API is built into modern browsers at no cost. For IP geolocation, sthan.io includes 50,000 free lookups a month with no credit card, and paid plans start at $4.50 a month for 100,000.

Related terms

Find where your visitors are

50,000 free IP lookups a month. No credit card.