On this page
ipstack resolves a public IP to country, region and city in one call. The free plan is 100 requests a month.
Get a free API keyA private IP address is an address from a range reserved for use inside local networks and never routed on the public internet. IPv4 has three private ranges, defined by RFC 1918: 10.0.0.0/8 (10.0.0.0–10.255.255.255), 172.16.0.0/12 (172.16.0.0–172.31.255.255) and 192.168.0.0/16 (192.168.0.0–192.168.255.255). Home routers almost always hand out addresses from 192.168.0.0/16. Devices on these ranges reach the internet through Network Address Translation (NAT), which swaps the private address for the router's single public IP. Because the same private ranges are reused on millions of separate networks, a private IP identifies a device only within its own network — it cannot be geolocated or reached from outside.
X-Forwarded-For header before calling a geolocation API.| Range (CIDR) | First to last address | Addresses | Defined by | What it is used for |
|---|---|---|---|---|
| 10.0.0.0/8 | 10.0.0.0 to 10.255.255.255 | 16,777,216 | RFC 1918 | Large enterprise, data-centre and cloud VPC networks |
| 172.16.0.0/12 | 172.16.0.0 to 172.31.255.255 | 1,048,576 | RFC 1918 | Mid-size corporate networks; Docker’s default bridge sits here |
| 192.168.0.0/16 | 192.168.0.0 to 192.168.255.255 | 65,536 | RFC 1918 | Home and small-office routers, the range most people see |
| 100.64.0.0/10 | 100.64.0.0 to 100.127.255.255 | 4,194,304 | RFC 6598 | Carrier-grade NAT (CGNAT) between an ISP and your router |
| 169.254.0.0/16 | 169.254.0.0 to 169.254.255.255 | 65,536 | RFC 3927 | Link-local / APIPA, self-assigned when no DHCP server answers |
| 127.0.0.0/8 | 127.0.0.0 to 127.255.255.255 | 16,777,216 | RFC 1122 | Loopback, traffic to your own machine (localhost) |
| fc00::/7 | fc00:: to fdff:ffff…ffff | Vast | RFC 4193 | IPv6 Unique Local Addresses; in practice always fd00::/8 |
| fe80::/10 | fe80:: to febf:ffff…ffff | Vast | RFC 4291 | IPv6 link-local, auto-configured on every IPv6 interface |
Nothing in the table matches that filter.
Only the first three are “private” in the strict RFC 1918 sense. The rest are reserved and non-routable on the public internet, which is why they behave like private addresses in day-to-day troubleshooting — and why any code that classifies IP addresses needs to handle all of them.
172.32.0.0 and above is public (the private block stops at 172.31.255.255), and 100.64.0.0/10 is Shared Address Space owned by ISPs, not by you — if your router's WAN address starts with 100.64–100.127, you are behind carrier-grade NAT and cannot host inbound services without your ISP's help.
If you are reading this, you may have quite a few devices connected to the internet, but have you ever stopped to wonder how your laptop, smartphone, or even smart fridge connects to the internet? It all comes down to something called an IP address. IP addresses are at the very core of how the internet works. They’re the digital equivalent of a return address, making sure information gets to the right place.
Not all IP addresses are the same. There’s a whole ecosystem of IP addresses out there, each with its own unique job. Understanding the basics can be surprisingly helpful — whether you’re troubleshooting your home Wi-Fi or setting up a new server for your business.
An IP address is a string of numbers (and sometimes letters) that acts like a label for your device on a network. Think of it as the name tag your device wears to identify itself when it’s online. There are two main kinds you will encounter:
fc00::/7) and link-local (fe80::/10) ranges.Both identify devices and ensure data gets to the right place. The difference is mainly capacity. Private IP addresses come into play when devices need to talk to each other within a private network — your home Wi-Fi or an office LAN — without those addresses being routed on the public internet. For example, when your laptop connects to your printer, it uses a private IP address.
A private IP address is an address drawn from one of the ranges the IETF reserved for internal use. Routers on the public internet are configured to drop traffic to and from these ranges, so a private address is only meaningful inside the network it belongs to.
More precisely: private addresses are fully routable within a private network — they are simply never routed across the public internet.
Private IP addresses are used to establish a network connection in enterprises, offices, or residents. All devices such as smartphones, printers, computers, or tablets connected to an internet network have a private IP address. A private IP address helps routers and devices identify each other, and router identification is one of the primary reasons private IP addresses were established.
The reason these ranges exist is address scarcity. IPv4 has only about 4.3 billion addresses, and there are far more connected devices than that. Reserving three blocks that every network can reuse independently means a home with 30 devices consumes exactly one public address instead of 30 — the mechanism that has kept IPv4 workable for three decades.
People still search for private IP ranges by class, so it is worth being precise about what the labels mean. Classful addressing was replaced by CIDR (Classless Inter-Domain Routing) in 1993 — no modern router, firewall or cloud console uses classes to make decisions. The A/B/C names survive as informal shorthand for the three RFC 1918 blocks, but the mapping is looser than most articles suggest:
| Informal name | Actual RFC 1918 block | Network / host bits | In classful terms | Typical use |
|---|---|---|---|---|
| "Class A" private | 10.0.0.0/8 | 8 network / 24 host | Exactly 1 Class A network | Enterprise cores, AWS/Azure/GCP VPCs, Kubernetes clusters |
| "Class B" private | 172.16.0.0/12 | 12 network / 20 host | 16 Class B networks, not one | Mid-size corporate LANs, Docker default bridge (172.17.0.0/16) |
| "Class C" private | 192.168.0.0/16 | 16 network / 16 host | 256 Class C networks, not one | Home and small-office routers |
Class A private addresses range between 10.0.0.0 to 10.255.255.255 (10.0.0.0/8). With 16,777,216 usable addresses it is the largest private block, which is why cloud providers default to it for VPCs and why almost every large corporate network is built on 10.x.
Class B private addresses range between 172.16.0.0 to 172.31.255.255 (172.16.0.0/12). It provides 1,048,576 addresses using 12 network bits and 20 host bits. Note the boundary carefully: the block ends at 172.31.255.255. Anything from 172.32.0.0 upward is public address space — one of the most common mistakes in firewall rules and allow-lists.
Class C private addresses range between 192.168.0.0 to 192.168.255.255 (192.168.0.0/16). It provides 65,536 addresses using 16 network bits and 16 host bits, and it is the range you will see on virtually every home router — typically as a /24 subnet such as 192.168.0.0/24 or 192.168.1.0/24, with the router itself at 192.168.0.1 or 192.168.1.1.
Private IP address ranges are limited as they are reprocessed on various private networks. That’s not the case with public IP addresses, as they are identifiable.
| Private IP address | Public IP address | |
|---|---|---|
| Assigned by | Your router, via DHCP | Your ISP, from space allocated by a regional internet registry |
| Routable on the internet | No, dropped by internet routers | Yes |
| Unique | Only within its own network | Globally unique at any moment in time |
| Example | 192.168.1.14, 10.0.4.22 | 203.0.113.45 (RFC 5737 documentation address) |
| Cost | Free and unlimited | Scarce; static addresses usually cost extra |
| Can be geolocated | No | Yes, to country, region and city level |
| Visible to websites you visit | No, they see your router’s public IP | Yes |
| Reachable from outside | Only via NAT port forwarding or a VPN | Directly |
Network Address Translation (NAT) lets many devices share one public address: the router rewrites the private source address on every outbound packet to its own public IP, and rewrites it back on the reply. Port Address Translation (PAT, also called NAT overload) is the refinement that makes this work at scale — the router assigns each connection a unique source port and keeps a translation table mapping that port back to the internal device.
The primary driver, though, is arithmetic rather than security: IPv4 has roughly 4.3 billion addresses and the world has many times that number of connected devices. Private addressing plus NAT is what has allowed IPv4 to survive its own exhaustion.
Private addressing is not a security control, and it is worth being clear about why. Devices on a private range are connected to the public internet — through NAT — which is precisely how they browse the web, sync to the cloud and download updates. What private addressing gives you is that unsolicited inbound connections have nowhere to go: an internet host cannot open a connection to 192.168.1.14, because there are millions of such addresses and no route to any of them.
That single property is genuinely useful, but it stops well short of protection:
Real protection comes from a stateful firewall, patching, segmentation, MFA and monitoring. Treat private addressing as address management with a useful side effect, never as a defence.
All devices such as phones, tablets, or computers within a private network can benefit from a private IP address with no limitation. However, the same is not true for public IP addresses. Moreover, a private IP address allows communication between devices that do not need an internet connection, such as printers, scanners, or file servers.
If you have a private IP address, you cannot directly get traffic from the Internet. Instead, you have to utilize Network Address Translation (NAT) to use the same public IP address for multiple devices to access the internet.
For example, if your internet service gives you an IP address of 10.10.10.10, it will appear online as your router’s public address — say 203.0.113.45.
This is called Network Address Translation (NAT). Therefore, the ISP must provide you with a public IP Address to access your company or home network devices from the Internet.
With thousands of internal devices sharing one public address, the router distinguishes between them using Port Address Translation (PAT): each outbound connection is given a unique source port, and the router’s translation table maps that port back to the originating device and its original port. A reply arriving on port 51022 is therefore unambiguously routed back to the one device that opened it.
Knowing your private IP is useful more often than you might expect: connecting two machines directly, setting up a remote desktop session, configuring port forwarding for a game server, assigning a static address to a printer or NAS, or troubleshooting a 169.254.x.x address that means DHCP has failed. The next section shows how to find it on every common platform.
You can use a VPN to mask your IP with a virtual location if you hide your IP address. VPN encrypts your data and personal information. Users can also hide their IP address with a web proxy to create an unidentifiable anonymous IP address. Note that a VPN changes the public IP that websites see; your device keeps its private address on the local network either way.
Your private IP is the address your router assigned to your device. Every platform exposes it differently:
| Platform | How to find it | What you are looking for |
|---|---|---|
| Windows | Open Command Prompt and run ipconfig | The IPv4 Address under your active adapter |
| macOS | System Settings → Network → your connection → Details, or run ipconfig getifaddr en0 | The IP Address field |
| Linux | Run ip addr show (or the older ifconfig) | The inet value on your active interface |
| iPhone / iPad | Settings → Wi-Fi → tap the ⓘ next to your network | The IP Address field |
| Android | Settings → Network & internet → Wi-Fi → tap your network → Advanced | The IP address field |
| Your router | Log in to the admin page (usually 192.168.0.1 or 192.168.1.1) | The DHCP client or attached-devices list |
On Windows, ipconfig also shows the Default Gateway. That is your router’s private address, and it is the one to enter in a browser to reach the router admin page.
If you see an address starting with 169.254, your device failed to reach a DHCP server and self-assigned a link-local address. It will not have internet access. Restart the router, then renew the lease with ipconfig /release && ipconfig /renew on Windows or sudo dhclient -r && sudo dhclient on Linux.
Your private IP is not the address websites see. To find the public IP your traffic appears to come from, query an IP API such as ipstack’s /check endpoint, which returns the requester’s own public address.
ipconfig, press Enter, and find IPv4 Address under the active adapter.To look up the public IP websites see, sign up at the IPstack dashboard, copy your access key, and call https://api.ipstack.com/check?access_key=YOUR_ACCESS_KEY. The JSON ip field is your public address. See the API documentation and free IP API.
Your private IP is not the address websites see. To find the public IP your traffic appears to come from, query an IP API such as ipstack’s /check endpoint, which returns the requester’s own public address.
Any application that logs, rate-limits, geolocates or allow-lists by IP eventually has to answer “is this address routable?”. Do not write your own regex — the reserved blocks are more numerous than they look, and the standard libraries already know all of them.
import ipaddress
def classify(addr: str) -> str:
ip = ipaddress.ip_address(addr)
if ip.is_loopback: return "loopback" # 127.0.0.0/8, ::1
if ip.is_link_local: return "link-local" # 169.254.0.0/16, fe80::/10
if ip.is_private: return "private" # RFC 1918, fc00::/7, and more
return "public"
print(classify("192.168.1.14")) # private
print(classify("100.64.0.1")) # private (CGNAT shared space)
print(classify("172.32.0.1")) # public (outside the 172.16.0.0/12 block)const PRIVATE = [ /^10\./, // 10.0.0.0/8 /^172\.(1[6-9]|2\d|3[01])\./, // 172.16.0.0/12 /^192\.168\./, // 192.168.0.0/16 /^100\.(6[4-9]|[7-9]\d|1[01]\d|12[0-7])\./, // 100.64.0.0/10 (CGNAT) /^169\.254\./, // 169.254.0.0/16 /^127\./, // loopback ]; const isPrivate = (ip) => PRIVATE.some((re) => re.test(ip));
Note how the 172 pattern stops at 31 and the 100.64 pattern stops at 127, the two boundaries most hand-rolled checks get wrong.
A private IP cannot be geolocated. The same 192.168.1.14 exists on millions of networks simultaneously, so there is no location to return — geolocation databases map public addresses to the organisations and regions that hold them.
This matters because a very common bug looks like a geolocation failure and is not. If your application sits behind a load balancer, reverse proxy or CDN, the connecting socket address is the proxy’s address, often a 10.x.x.x internal one. Geolocating it tells you where your own infrastructure is. The real client IP is in the forwarded headers:
X-Forwarded-For: 203.0.113.45, 10.0.1.7, 10.0.4.22
^ original client ^ proxy hopsTake the left-most address that is not in a private or reserved range, then geolocate that. In Python, combining the classifier above with an ipstack lookup:
import ipaddress, requests
def client_ip(xff: str) -> str | None:
for part in xff.split(","):
ip = ipaddress.ip_address(part.strip())
if not (ip.is_private or ip.is_loopback or ip.is_link_local):
return str(ip)
return None # every hop was internal
ip = client_ip(request.headers["X-Forwarded-For"])
if ip:
r = requests.get(f"https://api.ipstack.com/{ip}",
params={"access_key": KEY, "fields": "country_code,city"})
print(r.json()) # {"country_code": "US", "city": "Los Angeles"}A caution on trusting X-Forwarded-For: clients can forge it. Only trust the hops appended by proxies you control, and configure your framework’s trusted-proxy setting rather than reading the raw header.
The ipstack API resolves a public IP to country, region, city, timezone, currency and an is_eu flag in a single call. Private and reserved addresses have no location to return, so filter them out before you call. It also saves quota.
The free plan includes 100 requests per month; paid plans start at $12.99/month for 50,000 requests.
Enterprises do not really choose private addressing. At any meaningful scale it is the only option, because no organisation can obtain a public address for every laptop, server, container and phone. What enterprises choose is how to structure it. Typical practice: allocate from 10.0.0.0/8 because it is large enough to sub-divide cleanly, give each site, environment and cloud VPC its own non-overlapping block, and document the plan before the first subnet is created.
Overlapping ranges are the classic enterprise mistake. Two sites that both use 192.168.1.0/24 cannot be joined by a VPN or site-to-site link without renumbering or double NAT, a problem that surfaces years later during a merger or a cloud migration. Sparse, deliberate allocation from 10.0.0.0/8 avoids it.
However, private IP addresses come with additional work. A closed network means you need more tools to access the Internet and connect to a public network. Enterprises may need to invest in network-based IP VPNs to perform secure business transactions. Additional tools mean additional resources to manage the network. The security work is separate: segmentation, stateful firewalls, and zero-trust access controls do the protecting, not the address range itself.
These are the questions people actually type into Google and AI assistants about private IPs. Each has a direct, self-contained answer.
Three IPv4 ranges are private under RFC 1918: 10.0.0.0/8 (10.0.0.0 to 10.255.255.255), 172.16.0.0/12 (172.16.0.0 to 172.31.255.255) and 192.168.0.0/16 (192.168.0.0 to 192.168.255.255). Also non-routable: 100.64.0.0/10 (CGNAT), 169.254.0.0/16 (link-local) and 127.0.0.0/8 (loopback). For IPv6, fc00::/7 is the private equivalent.
Yes. The RFC 1918 block runs from 172.16.0.0 to 172.31.255.255, so anything from 172.16 through 172.31 is private, including 172.20. Addresses from 172.32.0.0 upward are public. This boundary is the most commonly mis-stated fact about private addressing.
You are behind carrier-grade NAT. 100.64.0.0/10 is Shared Address Space (RFC 6598), used by ISPs to number the link between their CGNAT equipment and your router. You share a public IP with other subscribers, which means inbound port forwarding will not work: you need to ask your ISP for a public or static IP.
Your device could not reach a DHCP server and self-assigned a link-local (APIPA) address from 169.254.0.0/16. It can talk to other devices on the same physical segment but has no gateway and no internet. Restart the router, check the cable or Wi-Fi association, then renew the lease with ipconfig /release and ipconfig /renew.
Not by itself. A private address means unsolicited inbound connections cannot reach your device, which is useful, but NAT is not a firewall, it inspects nothing and logs nothing, and it offers no protection against malware, phishing or an attacker already inside the network. Security comes from firewalls, patching, segmentation and monitoring.
Not on the same network: a duplicate address causes a conflict and one or both devices lose connectivity. Across different networks it is completely normal. Millions of routers worldwide use 192.168.1.1 at the same time, which is exactly why these addresses are never routed on the public internet.
On Windows run ipconfig and read the IPv4 Address. On macOS run ipconfig getifaddr en0 or check System Settings → Network → Details. On Linux run ip addr show. On iOS or Android, open your Wi-Fi network’s details. Your router’s admin page also lists every connected device.
No. Private ranges are reused on millions of independent networks, so there is no location associated with them. If your logs show 10.x or 192.168.x addresses you are recording a proxy or load-balancer hop. Read the original client IP from the X-Forwarded-For header and geolocate that instead.
A pattern that works well with any coding assistant:
"You are a senior network engineer. Review this firewall allow-list. For each entry, state whether it falls in RFC 1918 (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16), RFC 6598 shared space (100.64.0.0/10), link-local (169.254.0.0/16), loopback, or public space. Flag any rule that permits a public range where a private one was intended, and any 172.x rule whose boundary is wrong." Naming the exact CIDR blocks in the prompt is what stops the model guessing at boundaries.
Private IP addressing is what has kept IPv4 alive: three reserved ranges — 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16 — that every network reuses independently, stitched to the public internet by NAT. Learn where each range starts and stops, remember that 172 stops at 172.31 and that 100.64 means your ISP is doing the NAT, and treat “private” as an addressing decision rather than a security one.
And when you need to know where a request genuinely came from, make sure you are geolocating the client rather than your own proxy. The IPstack API turns a public IP into country, region, city, timezone and currency in a single call, starting free. Get a free API key and run it against your own traffic logs.
A private IP address is an address from a range reserved for internal networks and never routed on the public internet: 10.0.0.0/8, 172.16.0.0/12 or 192.168.0.0/16 under RFC 1918. Your router assigns one to every device on your network, and NAT lets them all share a single public IP.
10.0.0.0 to 10.255.255.255 (10.0.0.0/8, about 16.7 million addresses), 172.16.0.0 to 172.31.255.255 (172.16.0.0/12, about 1 million) and 192.168.0.0 to 192.168.255.255 (192.168.0.0/16, 65,536). They were defined by RFC 1918 in 1996.
Yes. It sits inside 192.168.0.0/16 and is the most widely used router gateway address in the world. Because private ranges are reused, millions of separate home networks use 192.168.1.1 simultaneously, which is why it can never be reached from the public internet.
A private IP is assigned by your router, is unique only within your own network, and cannot be routed on the internet or geolocated. A public IP is assigned by your ISP, is globally unique, is what websites see, and can be geolocated to country, region and city.
They prevent unsolicited inbound connections, which is genuinely useful, but that is the limit. NAT is not a firewall, it inspects no traffic and applies no policy, and it does nothing against malware, phishing or lateral movement. Use a stateful firewall, segmentation and patching for actual security.
It is reserved and non-routable, but it is not RFC 1918 private. Defined by RFC 6598 as Shared Address Space, it belongs to ISPs for carrier-grade NAT. Seeing it on your router’s WAN interface means you are behind CGNAT and cannot accept inbound connections without your ISP’s cooperation.
IPv6 uses Unique Local Addresses (ULA) from fc00::/7, defined in RFC 4193, in practice always fd00::/8, with a randomly generated 40-bit global ID. Separately, fe80::/10 is link-local and auto-configured on every IPv6 interface. IPv6 has no equivalent of NAT-based address sharing.
No. The same private address exists on millions of networks at once, so there is nothing to trace it to. Only the public IP your traffic exits from can be geolocated, and that resolves to your ISP’s allocation, typically accurate to city level, never to a street address.
Because there are not enough public IPv4 addresses, roughly 4.3 billion for far more devices. Assigning private addresses internally and translating them through one public IP means a household of thirty devices consumes a single public address instead of thirty.
Yes. Reboot the router so DHCP hands out a new lease, or assign a static address in the device’s network settings or with a DHCP reservation. The new address must still sit inside the LAN’s private range and must not collide with another device.
Yes. On Wi-Fi they use a private address assigned by the router. On cellular data they typically use a public or CGNAT address assigned by the carrier, which is why apps see a different IP when you leave home Wi-Fi.
They are unique only inside one local network. The same 192.168.1.1 can be used on millions of other networks at the same time. That reuse is why private addresses are never routed on the public internet.
Internet routers drop RFC 1918 traffic, so a private address is not reachable as a public destination. NAT on your router converts outbound private sources to a public IP so browsing still works.
Class A, B and C as people still search for them, mapped correctly onto the RFC 1918 blocks.
Read the guide →Address assignmentStatic versus dynamic, when you need each, and the DHCP reservation that costs nothing.
Read the guide →API referenceThe base URL, the three endpoints and every field a lookup returns.
Read the guide →ipstack turns a public IP into country, region, city, time zone and currency in a single call. The free plan is 100 requests a month.