Public vs private IP addresses differ in where they're meant to work. A public address is meant for routing on the internet; a private address is used within a private network and isn't meant to cross the internet. The private IP ranges are 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16, set aside by RFC 1918.
Having a public address doesn't make a device reachable by itself; routing and firewall rules decide that. On a typical IPv4 home network, the router translates between the two kinds, so every device inside appears online under one shared public address.
Private IP Ranges
RFC 1918 reserves three private IP address ranges, the same three blocks its predecessor, RFC 1597, set aside in March 1994. Anyone can use them without asking a registry, so your home router, an office network, and a cloud network can all hand out 10.0.0.5 at the same moment without a conflict, as long as the networks never join.
| CIDR Block | Address Range | Block Mask | Total Addresses |
|---|---|---|---|
| 10.0.0.0/8 | 10.0.0.0 to 10.255.255.255 | 255.0.0.0 | 16,777,216 |
| 172.16.0.0/12 | 172.16.0.0 to 172.31.255.255 | 255.240.0.0 | 1,048,576 |
| 192.168.0.0/16 | 192.168.0.0 to 192.168.255.255 | 255.255.0.0 | 65,536 |
The counts are every address in each block, not the usable hosts in any one subnet you carve out of it (the subnet mask guide covers that math, and the CIDR to IPv4 tool expands any block). Together the three blocks hold 17,891,328 addresses, about 0.42% of the IPv4 space.
You'll also see them called the Class A, B, and C private ranges. RFC 1918 uses those older terms only as a description: one class A network, 16 class B networks, and 256 class C networks. Classful addressing gave way to CIDR in 1993 (RFC 1519), so the prefix length (/8, /12, /16) is the label that holds up.
1. Not Every 172 Address Is Private
Only 172.16.0.0 to 172.31.255.255 is private, so the second number decides: 16 to 31 is private, and anything else after 172 isn't. That private slice is one sixteenth of 172.0.0.0/8. The rest is ordinary public space; Google, for one, publishes 172.217.0.0/16 among its own ranges.
ARIN, the registry for North America, warns that some network operators block all of 172.0.0.0/8 by mistake, which cuts off real users whose providers received 172 addresses after ARIN began allocating that space in August 2012. If you filter private ranges at a firewall or in code, filter 172.16.0.0/12, never the whole 172 block.

How Public and Private IP Addresses Differ
The difference between public and private IP addresses comes down to where each is meant to be used, and that decides who hands it out, whether it's unique, and what an outsider can learn from it.
| Aspect | Public IP Address | Private IP Address |
|---|---|---|
| Meant for | Routing on the public internet | Use within a private network |
| Handed out by | A regional internet registry, through an ISP or hosting provider | Your router or network admin, with no registry involved |
| Unique? | One holder at a time, though many devices can share it through NAT | Only within its own network; millions of networks reuse the same addresses |
| Reachable from the internet? | Can be, if routing and firewall rules allow it | Not directly; outgoing traffic goes through NAT, and incoming access needs a port forward, a VPN, or a proxy |
| What an IP lookup shows | The network, its owner, and an estimated location | No location; the address alone doesn't point to any one network |
Public addresses flow down from IANA to the five regional internet registries, then to providers and their customers, so every block has a holder on record. Private addresses skip that chain. RFC 1918 lets an organization use them "without any coordination with IANA or an Internet registry", and IANA says it has no record of who uses which ones.
Nothing physically stops a private address from leaving a network. RFC 1918 says packets with private source or destination addresses "should not be forwarded" between organizations, and it expects ISPs to filter routes for them. Traffic that seems to come from a private address still turns up now and then, and IANA's guidance is that it's coming from your own network, your ISP, or a spoofed source.
1. How Private Addresses Reach the Internet
Say a laptop at 192.168.1.20 opens a website. The home router swaps the laptop's address for the router's public one, here 203.0.113.10, keeps a note of the swap, and sends the request on. When the reply comes back to 203.0.113.10, the router checks its note and hands the reply to 192.168.1.20. That swap is network address translation (NAT), and it lets a whole household browse from one public address.
Some connections have more than one layer. A second router plugged in behind the first creates double NAT inside the home, and the inner router then shows a private address on its WAN port. Many ISPs, mobile carriers especially, also run carrier-grade NAT: the provider puts a NAT of its own in front of customers, and your router's internet-facing side gets an address from the provider instead of a public one, often from 100.64.0.0/10. RFC 6598 set 100.64.0.0/10 aside in April 2012 as shared address space, "distinct from RFC 1918 private address space". Under carrier-grade NAT, many homes share one public address, and the RFC lists what that breaks: some peer-to-peer apps can't accept incoming connections, for example, because no port can be opened through the provider's NAT.

To see which case you're in, compare your router's WAN address (on its admin page) with the address What is my IP shows. A private or shared WAN address means another NAT sits upstream. One in 100.64.0.0/10 is a strong clue that your provider uses carrier-grade NAT. An RFC 1918 address there usually points to another router in your own home or office, though RFC 6598 notes that a provider could number that link from private space too. (A WAN address starting with 169.254 means something else: the router got no address at all.)
Special Addresses That Are Neither Private Nor Public
Several blocks are neither private in the RFC 1918 sense nor ordinary public addresses, and they turn up in logs and configs often enough to know on sight:
| Block | What It Is | Where You'll Meet It |
|---|---|---|
| 100.64.0.0/10 | Shared address space for carrier-grade NAT (RFC 6598) | A router's WAN side under carrier-grade NAT; Tailscale also numbers its devices from it |
| 169.254.0.0/16 | Link-local (RFC 3927) | A device that couldn't get an address from DHCP assigns itself one; routers must not forward it |
| 127.0.0.0/8 | Loopback | 127.0.0.1, a machine talking to itself |
| 224.0.0.0/4 | Multicast, 224.0.0.0 to 239.255.255.255 | One packet addressed to a group of receivers, not to one host |
| 192.0.2.0/24, 198.51.100.0/24, 203.0.113.0/24 | Documentation (RFC 5737) | Examples in docs and articles, this one included |
| 0.0.0.0/8 | "This network"; 0.0.0.0 on its own means "unspecified" | A server listening on every interface, or a device that has no address yet |
IANA's special-purpose address registry gives every block in it a "Globally Reachable" flag, and the private blocks, 100.64.0.0/10, and the other blocks above are all marked false. Code that sorts addresses should lean on that flag through a library that tracks the registry, with two cautions. Multicast sits in a registry of its own, so a check built only on "globally reachable" files most multicast addresses as public. And the flag isn't a connectivity test: the registry itself says its prefixes "are not guaranteed routability in any particular local or global context." For the complete set, with the benchmarking, reserved, and broadcast blocks, see the full list of bogon and reserved ranges.
Private Addresses in IPv6
IPv6 has its own private range: unique local addresses, fc00::/7, defined in RFC 4193. Prefixes assigned today start with fd: RFC 4193 sets one bit, called the L bit, to 1 for prefixes a site assigns itself, and leaves the other half, fc00::/8, for an assignment method that may be defined later.
The design answers RFC 1918's collision problem, as long as sites follow it. Each site picks a random 40-bit Global ID for its prefix, about 1.1 trillion possible values, so two networks that later connect through a merger or a VPN are unlikely to clash. Two IPv4 networks that both used 192.168.1.0/24 overlap completely, which is why RFC 1918 warns that merged private networks may need renumbering and advises picking private sub-blocks at random.

Two other IPv6 ranges look private but do a different job. fe80::/10 is link-local: every IPv6 interface has one, and it works only on the local network segment it's attached to. fec0::/10, the old site-local range, was deprecated in September 2004 (RFC 3879), so a fec0 address in a config today is a leftover.
What Private Addressing Doesn't Do for Security
A private IP address doesn't authenticate anyone, encrypt anything, or replace a firewall. Whether outsiders can reach a device depends on routing, firewall rules, VPNs, proxies, and any port forwards someone set up. RFC 1918 makes no security promise; its security section is one line: "Security issues are not addressed in this memo."
NAT is often credited with protecting home networks. A home router drops unsolicited inbound traffic because nothing inside asked for it: the router's connection tracking finds no matching outgoing request, so the packet has nowhere to go. That's a side effect of how the router keeps state, and one port forward or UPnP rule opens a path straight in. RFC 4864 says it directly: IPv4 NAT "is not a security mechanism".
For anyone writing server code, two rules follow. First, never treat "this request came from a private address" as proof of trust. Anyone can put 10.0.0.1 in an X-Forwarded-For header, which holds whatever the client sent unless your own proxy rewrote it, and an attacker who's already inside the network has a private address too. Go's documentation for IsPrivate makes the same point: the method "does not describe a security property of addresses".
Second, if your server fetches URLs that users supply, blocking private, loopback, and link-local destinations is one layer of defense against server-side request forgery (SSRF), the attack that tricks a server into calling internal systems such as the cloud metadata service at 169.254.169.254. It isn't the whole defense. OWASP's SSRF prevention cheat sheet calls deny-lists "bypass-prone", prefers allow-lists, and covers DNS rebinding and redirects.
On the network side, drop traffic from the internet that carries a private source address; the guide to filtering private and reserved sources at the edge has router and firewall rules.
How to Tell Whether an IP Address Is Public or Private
There are four ways to check an address, from a glance to a lookup:
- Compare it with the ranges. An address starting with 10. or 192.168. is private. For 172., check the second number: 16 to 31 is private, anything else isn't. An address from 100.64 to 100.127 is shared address space, not private.
- Look at your own device. The address in your network settings is usually private: run
ipconfigon Windows orip addron Linux, or open the network details in System Settings on a Mac. The public address the internet sees is the one What is my IP shows, and if the two match, your device holds a public address directly. - Use a library in code, not a pattern match. Python's
ipaddressmodule definesis_privateas "not globally reachable" in IANA's registries, so loopback, link-local, and documentation addresses count as private too. It makes one stated exception: 100.64.0.0/10 is neither private nor global. Go'sIsPrivate()is narrower: it checks only the three RFC 1918 blocks and fc00::/7. Pick the definition that matches your question: the broad one for deciding what a server may connect to, the narrow one for asking whether an address is RFC 1918 space. - Run a lookup. A geolocation service has nothing to locate for a private address. IPGeolocation.io's IP Geolocation API answers one with HTTP 423 and the message that the address "is a bogon IP address", the term it uses for private and other reserved addresses.

1. Check an Address in Python
For more than a yes or no, the function below sorts an address into the categories in this guide. It runs on Python 3.13 or later and uses only the standard library.
import ipaddress
# The three RFC 1918 blocks, plus IPv6 unique local addresses (RFC 4193).
PRIVATE_NETS = [
ipaddress.ip_network(net)
for net in ("10.0.0.0/8", "172.16.0.0/12", "192.168.0.0/16", "fc00::/7")
]
# Shared address space for carrier-grade NAT (RFC 6598): neither private nor global.
SHARED_NET = ipaddress.ip_network("100.64.0.0/10")
def classify(address):
"""Return the type of an IP address. It describes the address, not whether it's reachable."""
try:
ip = ipaddress.ip_address(str(address).strip())
except ValueError:
return "invalid"
# Dual-stack servers log IPv4 clients as ::ffff:a.b.c.d, so judge the IPv4 address inside.
if ip.version == 6 and ip.ipv4_mapped is not None:
ip = ip.ipv4_mapped
if ip.is_unspecified:
return "unspecified"
if ip.is_loopback:
return "loopback"
if ip.is_link_local:
return "link-local"
# Check multicast before is_global: Python reports most multicast addresses as global.
if ip.is_multicast:
return "multicast"
if any(ip in net for net in PRIVATE_NETS):
return "private"
if ip in SHARED_NET:
return "shared (carrier-grade NAT)"
# Whatever else IANA lists as not globally reachable: documentation, benchmarking, reserved.
if not ip.is_global:
return "other special-use"
return "public"
if __name__ == "__main__":
samples = [
"192.168.1.20", "172.31.255.255", "172.217.0.1", "100.64.0.1",
"169.254.169.254", "224.0.0.251", "192.0.2.10", "::ffff:10.0.0.5",
"fd12:3456:789a:1::1", "0.0.0.0", "not-an-ip",
]
for value in samples:
print(f"{value:20} {classify(value)}")
The order of the checks matters: the specific categories come first, and is_global only decides whatever is left. Running the file prints:
192.168.1.20 private
172.31.255.255 private
172.217.0.1 public
100.64.0.1 shared (carrier-grade NAT)
169.254.169.254 link-local
224.0.0.251 multicast
192.0.2.10 other special-use
::ffff:10.0.0.5 private
fd12:3456:789a:1::1 private
0.0.0.0 unspecified
not-an-ip invalid
A public result describes the address type only; it doesn't prove that a host is reachable or that a connection to it is safe.
What Private Addresses Mean for IP Lookups and Logs
Your access log shows 10.0.0.12 for every request. That usually means a load balancer or reverse proxy sits in front of the app: the app sees the proxy's private address, and the visitor's real one travels in a forwarded header that you should read only from proxies you trust. The guide to reading the real client IP behind a proxy shows how for each common setup.
A private address can't be uniquely geolocated from the address alone. The same 10.0.0.12 is in use across millions of private networks at once, and no registry records which ones. Your own organization can still match it to a device through its DHCP leases or inventory; an outside lookup service can't, because IP geolocation maps public, registered address space. People look them up anyway. In the 12 months to November 17, 2026, IPGeolocation.io's IP lookup pages drew 89,642 clicks from Google Search, and 63,758 of them (71%) went to pages for addresses in the three RFC 1918 blocks, with 601 more for 100.64.0.0/10. The counts are Google Search Console clicks to our /browse/ address and range pages, not unique visitors.
Two single lookups we ran on October 30, 2026, show the difference. Both addresses start with 172:
- 172.16.0.1, inside the private block, came back with HTTP 423 and the message "'172.16.0.1' is a bogon IP address." There was no location to return.
- 172.217.0.1, inside Google's published 172.217.0.0/16, came back with Mountain View, United States, as the API's location result, autonomous system number AS15169 registered to Google LLC, Google LLC as the company, and 172.217.0.0/24 as the routed block.

On the public side, carrier-grade NAT limits what a lookup can say. When many customers share one public address, a lookup of that address finds the provider's NAT, not any one home, and RFC 6598 lists that among the known effects: geolocation systems "identify the location of the CGN server, not the end host." Any IP data provider sees the same thing, because the shared address really is the provider's. What helps is reading the location together with the network fields: IPGeolocation.io returns the connection type (such as Mobile, when it's known), the type of the ASN (such as ISP), and the routed block, which together help show when an address belongs to a carrier network rather than a single site.
In a data pipeline, the 423 response is useful in its own right. Because the API answers a private address with a distinct status rather than an empty location, your code can tell "not a public address" apart from a lookup that failed. The message reads the same for private and other reserved addresses, so classify locally, as in the Python example, when you need to know which kind it was. The guide to enriching IP addresses in logs shows where that check belongs.
Look Up Public IP Addresses With IPGeolocation.io
IPGeolocation.io's IP Geolocation API looks up any public IPv4 or IPv6 address and returns its geolocation, security data, ASN, company, abuse contact, and time zone in one request. The security data is the same as the IP Security API returns: a threat score from 0 to 100 with VPN, proxy, residential proxy, and Tor flags, plus provider names and confidence scores. ASN and abuse contact data are also available on their own through the ASN API and the IP Abuse Contact API. The same request can parse your visitor's user agent from the User-Agent header you pass along. Private and reserved addresses come back as HTTP 423 with no location, so your data never carries a guessed location for an address that has none.
For logs and batch jobs, the bulk endpoint, on paid plans, takes up to 50,000 addresses per request, and geolocation data also ships as a downloadable IP geolocation database. To see how any block splits, open its free range page: the 172.0.0.0/8 range page marks the private 172.16.0.0/12 slice inside it. The free Developer plan gives you 1,000 credits a day for life, with no credit card. Paid plans add more data, such as accuracy radius, company, network, and security data. Free and paid plans are compared on API pricing.
Start with the IP Geolocation API documentation, which lists every field and error code.
Frequently Asked Questions
Private. Every address from 192.168.0.0 to 192.168.255.255 belongs to 192.168.0.0/16, one of the three private IPv4 ranges defined in RFC 1918, alongside 10.0.0.0/8 and 172.16.0.0/12. Together the three hold 17,891,328 addresses.
No, only 172.16.0.0 to 172.31.255.255, the block 172.16.0.0/12. An address such as 172.217.0.1 is public and sits in a range Google publishes as its own. Check the second number: 16 to 31 means private.
No. 100.64.0.0/10 is shared address space that RFC 6598 set aside in April 2012 for carrier-grade NAT between an ISP and its customers' routers, and the RFC calls it distinct from RFC 1918 private space. IANA lists it as not globally reachable, so it isn't public either.
Your private IP address is the one in your device's network settings: on a phone, it's under the Wi-Fi network's details, and on a computer, ipconfig (Windows) or ip addr (Linux) prints it. It usually starts with 192.168, 10, or 172.16 to 172.31. For the public address the internet sees, use What is my IP.
Not from the address alone. The same private address is in use in millions of networks, and no registry records who uses it, so an IP lookup has nothing to place; IPGeolocation.io's API returns HTTP 423 for one. A lookup of your public address returns an estimated location for your provider's network, not a street address.







