Public vs. Private IP Addresses
Tell public and private IP addresses apart, understand how your router connects them and decide when the difference matters to you.
Key takeaways
- Private IPv4 ranges are 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16, as set out in RFC 1918.
- Private addresses are not routed on the public internet, so many separate networks can reuse them.
- A home router uses network address translation to let private devices share one public address.
- Being behind NAT blocks many unsolicited connections, but a firewall is what actually enforces security.
- If your router's outside address is itself private or in 100.64.0.0/10, another layer of NAT sits upstream.
A public IP address can be reached across the internet because it is unique worldwide and routers know a path to it. A private IP address works only inside a local network, and the same one is reused in millions of homes and offices. Your laptop almost certainly has a private address, while your router holds the address the outside world sees.
The quickest test for IPv4: if the address starts with 10., 192.168., or 172. followed by a number from 16 to 31, it is private. This guide explains why the split exists, how traffic crosses it and what it means when you want to reach something at home from elsewhere.
The private ranges
The standard known as RFC 1918 reserves three blocks that anyone may use internally without asking permission:
| Block | First address | Last address | Often seen in |
|---|---|---|---|
10.0.0.0/8 | 10.0.0.0 | 10.255.255.255 | Larger organizations, some home gear, VPNs |
172.16.0.0/12 | 172.16.0.0 | 172.31.255.255 | Corporate networks, container software |
192.168.0.0/16 | 192.168.0.0 | 192.168.255.255 | Home routers |
The middle one causes the most mistakes. 172.20.4.1 is private, but 172.32.4.1 is not, because the block stops at 172.31. The IP range matcher can check whether an address falls inside a block.
The number after the slash is the prefix length, which sets how big the block is. CIDR notation explains how to read it.
What makes an address public
A public address has been allocated through the registry system to a particular organization, which announces it to other networks using a routing protocol called BGP. Because only one holder is supposed to announce it, a packet sent to that address from anywhere has a defined place to go.
You don't own the public address on your home connection. Your provider holds it and lends it to you. It may stay the same for months or change often, as described in static vs. dynamic IP addresses.
Not every address outside the RFC 1918 blocks is public in practice. Several other ranges are reserved for loopback, link-local use, documentation and multicast. See reserved and special IPv4 ranges.
Why private addresses exist
There are not enough IPv4 addresses to give every device its own. Private ranges let a household use a single public address for dozens of gadgets. They also let an organization build and renumber its internal network without involving anyone outside, and they keep internal machines from being directly addressable from the internet.
The reuse has a cost. When two networks that picked the same private range need to connect, through a company merger or a VPN from home to the office, their addresses collide. If your home uses 192.168.1.0/24 and so does the network you are dialing into, your computer cannot tell which one you mean. Choosing a less common range, such as 192.168.73.0/24, avoids much of this.
How traffic gets from private to public
Your router performs network address translation (NAT). In the common home form, it changes both the source address and the source port of outgoing connections.
Say your laptop at 192.168.1.20 opens a web page on a server at 198.51.100.80. Your router's public address is 203.0.113.5.
The server never learns the laptop's private address from the packet headers. It sees the router. When a second device connects to the same server, the router picks a different outside port so it can tell the replies apart. NAT explained covers the variations.
Finding both of yours
Your private address is listed by the operating system:
- Windows: run
ipconfigand look for "IPv4 Address" under your active adapter. - macOS: open the Wi-Fi or Network settings and view the connection details, or run
ipconfig getifaddr en0(the interface name may differ). - Linux: run
ip -4 addr.
The "default gateway" shown nearby is the router's private side. See the default gateway.
Your public address is not usually visible in device settings, because your device doesn't hold it. Check the status or internet page in your router's admin interface, or visit a service that reports the address it received, such as the request header echo tool. If a VPN or proxy is active, that service sees the VPN or proxy address.
When the outside address is not really public
Compare the address on your router's internet interface with what an outside service reports. If they match and the address is not reserved, you have a public address on your router.
If they differ, look at the router's value:
- If it starts with
192.168.,10.or172.16to172.31, there is probably another router in front of yours, often a provider's modem-router combination. This is double NAT, and bridge mode often fixes it. - If it falls between
100.64.0.0and100.127.255.255, your provider is likely using carrier-grade NAT, sharing public addresses among customers. See carrier-grade NAT. - If it starts with
169.254., the router failed to get an address at all.
Private networks bigger than a home
The same ideas scale up. An office, school or data center usually carves a large private block into several smaller subnets: one for staff computers, one for phones, one for guests, one for servers. Routers or a central switch pass traffic between them, and rules decide which groups may talk to each other. All of it stays on private addresses until it leaves for the internet through a NAT device or firewall that holds the public address.
Cloud platforms work this way too. A virtual network you create there gets a private range of your choosing, and a server in it reaches the public internet only if you give it a public address or route it through a gateway. See cloud networking basics.
Container and virtual machine software on your own computer also creates small private networks. That explains the surprising 172.17.x.x or 192.168.x.x adapters that show up next to your real connection. They are normal, and traffic from them is translated again on its way out.
Two habits prevent trouble as a private network grows:
- Keep a list of the ranges in use, including VPN and virtual networks, so a new one doesn't overlap an old one.
- Don't borrow public ranges for internal use. An address block that isn't yours will eventually belong to a real site, and your users will be unable to reach it.
Reaching home from outside
Private addresses matter most when you want incoming connections: a camera, a game server, a file share. Outsiders cannot send packets to 192.168.1.50. Your options are:
- Port forwarding. Tell the router to pass connections arriving on a chosen port to one inside device. It needs a real public address on your router. It also exposes that service to anyone who finds it, so read port forwarding and when not to.
- A VPN into your home. Often safer, since only authenticated users get in. See self-hosting a VPN.
- A relay or tunnel service. Your device connects outward to a service that brokers access. It works through carrier-grade NAT, at the price of trusting the intermediary.
Is a private address a security feature?
NAT has a side effect people value: an unsolicited packet arriving at your router matches no existing mapping and is usually dropped. That is helpful, but incidental.
It does not protect you from anything your device connects to on its own, such as a malicious download, and it can be undone by port forwarding or by UPnP, which lets software open ports automatically. It also does nothing about other devices already inside your network. Keep the router's firewall on, update devices and don't expose services you don't need. Firewalls explained describes the real filtering.
What about IPv6?
IPv6 has no shortage, so each device on a home network can have a globally unique address. That doesn't mean everything is open: a properly configured router still blocks unsolicited inbound connections with a firewall.
IPv6 also has local-only addresses. Link-local ones starting fe80: work on one network segment, and unique local addresses starting fd play a role similar to private IPv4. A device commonly holds both a global and a local address at once. See IPv6 address types.
Common questions
Can a website see my private address?
Not from the packets, since NAT replaces it. Browser features and scripts have at times been able to reveal local details, and modern browsers have added protections. Don't treat a private address as sensitive in itself, but don't paste full network configurations into public forums without a look.
Is it a problem if my neighbor uses 192.168.1.1 too?
No. Your networks are separate, and each router translates independently.
Which private range should I pick?
Any of the three works. Pick one that is unlikely to clash with your workplace or common hotel and hotspot defaults, and give it room to grow.