Public vs Private IP Addresses Explained

RSS

A public IP address is globally unique and reachable on the internet, while a private IP address is reserved for use inside a local network and is never routed on the internet. Your router connects the two, usually through Network Address Translation (NAT).

The difference in one picture

Picture an office building. It has one street address that the postal service uses to deliver mail — that's the public IP address. Inside, every desk has an internal extension or room number that only makes sense within the building: those are private IP addresses. The reception desk (your router) takes in everything addressed to the building and passes it along to the right desk.

Public IP addressPrivate IP address
ScopeUnique across the whole internetUnique only within one local network
Assigned byYour ISP (from blocks issued by a Regional Internet Registry)Your router, usually via DHCP, or set manually
Reachable from the internetYes, subject to firewallsNo, not directly
Example203.0.113.42192.168.1.23
Who sees itEvery website and service you connect toOnly devices on the same network
CostIncluded with your internet service; static ones may cost extraFree to use

The private IP address ranges

RFC 1918 sets aside three IPv4 ranges for private networks. Anyone can use them without asking permission, and routers on the public internet are expected to drop traffic addressed to them.

RangeCIDR blockNumber of addressesTypical use
10.0.0.0 – 10.255.255.25510.0.0.0/816,777,216Large corporate and cloud networks; some home routers
172.16.0.0 – 172.31.255.255172.16.0.0/121,048,576Business networks, Docker and other container defaults
192.168.0.0 – 192.168.255.255192.168.0.0/1665,536Most home and small-office routers

Worth flagging: only 172.16.x.x through 172.31.x.x are private. An address such as 172.32.0.1 or 172.15.0.1 is just a normal public address. Need to check exactly which addresses fall inside a block? The subnet calculator shows the first and last address of any CIDR range.

Other non-public ranges you may see

  • 100.64.0.0/10 is shared address space defined in RFC 6598 for carrier-grade NAT. If your router's WAN address falls in this range, your ISP is sharing a public address between multiple customers.
  • 169.254.0.0/16 is link-local. A device assigns itself one of these addresses when it can't reach a DHCP server, which usually signals a connection problem.
  • 127.0.0.0/8 is loopback, used by a device to talk to itself. See What Is Localhost?

What about IPv6?

IPv6 has Unique Local Addresses (ULAs) in fc00::/7 — in practice almost always starting with fd — which play a role similar to RFC 1918 space. But because IPv6 has so many addresses to go around, most home devices also pick up a global IPv6 address that's publicly routable. Instead of hiding behind NAT, they're protected by the router's firewall, which blocks unsolicited inbound connections by default. Every IPv6 interface also carries a link-local address beginning with fe80::.

How NAT connects private and public addresses

Since private addresses can't travel across the internet, your router performs Network Address Translation (more precisely, port address translation) for outgoing IPv4 traffic:

  1. Your laptop at 192.168.1.23 opens a connection from local port 51515 to a web server.
  2. The router swaps the source address for its own public address, say 203.0.113.42, and picks a free source port, say 40001. It records the mapping in its NAT table.
  3. The web server sees a connection from 203.0.113.42:40001 and replies there.
  4. The router looks up port 40001 in its table, rewrites the destination back to 192.168.1.23:51515, and forwards the reply to your laptop.

This is how dozens of devices end up sharing one public IPv4 address. A side effect: unsolicited inbound connections have nowhere to go, since the router has no table entry telling it which device should receive them. That's why hosting a game server, camera or remote desktop at home requires port forwarding — a manual rule that sends a given public port to a specific private address. You can confirm whether a forwarded port is actually reachable with the open port checker.

Note: NAT is not a firewall, even though it blocks many inbound connections as a side effect. Keep your router's firewall enabled and only forward the ports you actually need.

Carrier-grade NAT (CGNAT)

Some ISPs, especially mobile networks, don't give your router a public address at all. Instead they hand out an address from 100.64.0.0/10 or another private range and run a second layer of NAT in their own network. Many customers end up sharing one public IP address this way. CGNAT makes port forwarding impossible from your side, can cause problems with some online games and peer-to-peer apps, and means the public IP you see may also be in use by complete strangers.

How to find your public and private IP

Your public IP

Your public IP is the address the rest of the internet sees, so the easiest way to find it is to just ask an external service. The What's My IP Number page shows it immediately, along with your ISP and approximate location. Every device on the same home network will normally show the same public IPv4 address.

Your private IP

Your private IP is configured on the device itself, so you'll look it up in the device's network settings or with a command:

  • Windows: open Command Prompt and run ipconfig; look for "IPv4 Address".
  • macOS: run ipconfig getifaddr en0 in Terminal, or open System Settings > Network.
  • Linux: run hostname -I or ip addr.
  • iPhone and Android: open the details for your Wi-Fi network in Settings.

Full step-by-step instructions for every platform are in How to Find Your IP Address on Any Device.

Checking whether you are behind CGNAT

Log in to your router (see the router login guide) and find the WAN or Internet IP address on its status page. Compare it with the public IP shown on our What's My IP Number page. If they match, your router has a real public address. If the router shows an address in 100.64.0.0/10 or an RFC 1918 range, your ISP is using CGNAT.

Security and privacy implications

Your private IP reveals almost nothing useful to outsiders — millions of homes use 192.168.1.x, after all. Your public IP is a different story. It shows which ISP you use and an approximate location, and it's the address attackers would scan for open ports. Practical steps include keeping router firmware updated, disabling UPnP if you don't need it, and closing port forwards you no longer use. Want websites to see a different public address? A VPN or similar service will do that; our guide on hiding your IP address compares the options.

Frequently asked questions

Why do my phone and laptop show the same public IP?

Because both sit behind the same router, which translates their private addresses to a single public one. If your phone switches to mobile data, it'll show a different public IP belonging to your mobile carrier instead.

Can someone hack me if they know my private IP?

Not from the internet. Private addresses aren't routable, so an outsider can't send traffic to them directly. Someone already on your local network, such as a guest on your Wi-Fi, could — which is exactly why a strong Wi-Fi password and a separate guest network are worth having.

Is 192.168.1.1 a public or private address?

It's private. It's also one of the most common default addresses for home routers, alongside 192.168.0.1 and 10.0.0.1.

Can I choose my own private IP address?

Yes. You can set a static address on the device or, more conveniently, create a DHCP reservation in your router so the same device always gets the same private address. If you set the address manually on the device, pick one inside your router's subnet but outside its DHCP pool to avoid conflicts.

Попробуйте сами

Примените это руководство на практике с помощью наших бесплатных инструментов.

Комментарии

Поделитесь советом, задайте вопрос или расскажите, как вам помог инструмент.

Читать далее

Скопировано в буфер обмена