TC
data6 min read

What is an IP Address and How Does Geolocation Work?

Every device connected to the internet has an address — a unique number that lets data find its way to the right machine across billions of possible destinations. But what do those numbers actually mean, why are we running out of them, and how can a website guess your city just by seeing your connection? The answers start with how IP addresses work.


IPv4: the original internet address

An IPv4 address is a 32-bit number, written as four decimal numbers separated by dots. Each number (called an octet) ranges from 0 to 255, representing one byte of the address.

192.168.1.1

Each octet is 8 bits:
  192     .  168     .  1       .  1
  11000000   10101000   00000001   00000001

Total: 32 bits = 2^32 = 4,294,967,296 possible addresses

4.3 billion addresses seemed like an inexhaustible supply when the internet was designed in the 1980s. But with smartphones, IoT devices, and cloud servers, we blew through them. IANA allocated the last IPv4 blocks in 2011. We've been surviving on workarounds ever since.

IPv6: the long-term fix

IPv6 uses 128-bit addresses — four times the bits of IPv4. The number of possible IPv6 addresses is astronomical: 340 undecillion (3.4 × 1038). That's roughly 100 addresses for every atom on Earth's surface.

2001:0db8:85a3:0000:0000:8a2e:0370:7334

Written in eight groups of four hexadecimal digits.
Leading zeros can be omitted, consecutive zero groups
replaced with "::"

Shortened: 2001:db8:85a3::8a2e:370:7334
FeatureIPv4IPv6
Address size32 bits128 bits
FormatDecimal (192.168.1.1)Hex (2001:db8::1)
Total addresses4.3 billion340 undecillion
NAT requiredUsually yesNo (by design)
Adoption (2024)~60% of traffic~40% of traffic
Header complexityVariable lengthFixed 40 bytes

Public vs private IPs

Your laptop doesn't have a public IPv4 address. Neither does your phone, your smart TV, or your thermostat. They all share the same public IP — the one assigned to your router by your ISP. Inside your home network, each device gets a private IP (typically starting with 192.168. or 10.).

This sharing is called NAT (Network Address Translation). Your router translates between the private addresses on your local network and the single public address the internet sees. It's the reason IPv4 has survived past its expiration date — millions of devices hide behind a single public IP.

Reserved private ranges

10.0.0.0    – 10.255.255.255     (10/8 prefix)
172.16.0.0  – 172.31.255.255    (172.16/12 prefix)
192.168.0.0 – 192.168.255.255   (192.168/16 prefix)

These addresses never appear on the public internet.
If you see them, you're looking at a local network.

How IP geolocation works

Websites can estimate your physical location from your IP address alone, without GPS or browser permissions. How? Through geolocation databases that map IP ranges to geographic regions.

These databases are built from multiple sources:

  • Regional Internet Registries (RIRs) assign IP blocks to ISPs and record which country and organization received them
  • ISP data — Internet providers know which city their infrastructure serves
  • User-contributed data — GPS coordinates paired with IP addresses from mobile apps and Wi-Fi surveys
  • Traceroute analysis — Measuring network latency to known locations can triangulate an IP's physical position
Geolocation is approximate. Country-level accuracy is typically 95–99%. City-level accuracy drops to 50–80%. It can be completely wrong when ISPs route traffic through distant data centers, or when users connect through VPNs or proxies.

VPNs: changing your visible IP

A VPN (Virtual Private Network) encrypts your traffic and routes it through a server in another location. The websites you visit see the VPN server's IP address, not yours. This makes geolocation report the VPN server's location instead of your actual one.

This is why streaming services try to detect and block VPNs — users in one country can appear to be in another. It's also why checking “What's my IP?” while connected to a VPN shows a different address and location than your real one.

Your IP address is your return address on the internet. It tells servers where to send responses — and, roughly, where in the world you're connecting from.

Try it yourself

Put what you learned into practice with our What's My IP.