[ learn ]

Public vs private IP addresses

Updated · 3 min read

Short answer

A public IP address is unique on the internet and is what websites see when you connect. A private IP address, from ranges such as 192.168.0.0/16, 10.0.0.0/8 and 172.16.0.0/12, works only inside a local network and can be reused by anyone. Your router uses NAT to connect the private addresses at home to its public one.

The difference

PublicPrivate
UniqueWorldwideOnly within one network
Assigned byYour ISP (from registry blocks)Your router or network admin, usually by DHCP
Reachable from the internetYes, unless a firewall blocks itNo, not directly
Shows in an IP lookupISP, ASN, approximate locationNothing: just "private range"
Example8.8.8.8192.168.1.20

The private ranges

RFC 1918 sets aside three IPv4 blocks for private use:

BlockRangeAddresses
10.0.0.0/810.0.0.0 – 10.255.255.25516,777,216
172.16.0.0/12172.16.0.0 – 172.31.255.2551,048,576
192.168.0.0/16192.168.0.0 – 192.168.255.25565,536

Note that only 172.16 to 172.31 are private: 172.217.x.x, for example, is a public Google range. In IPv6 the private equivalent is the unique local range fc00::/7 (in practice fd00::/8), though IPv6 devices normally also have public addresses. Other ranges that are not public include loopback 127.0.0.0/8, link-local 169.254.0.0/16 and the CGNAT range 100.64.0.0/10.

How private devices reach the internet

When your laptop at 192.168.1.20 opens a website, the router rewrites the packet's source to its own public address and remembers the connection, so it can send the reply back to the laptop. This is NAT. To the website, every device in your home appears as the same public IPv4 address.

Many ISPs add a second layer, carrier-grade NAT: your router itself gets an address from 100.64.0.0/10, and the ISP translates again to a public address shared with many other customers. You can spot it when the WAN address on your router does not match what What is my IP? shows.

How to find each one

  • Public address: open What is my IP?, or run curl https://ipinfo.dkly.net/json in a terminal.
  • Private address on Windows: ipconfig, look for "IPv4 Address".
  • macOS: System Settings → Network, or ipconfig getifaddr en0.
  • Linux: ip addr or hostname -I.
  • Phones: Wi-Fi settings → the connected network → details.

The privacy check also shows whether your browser exposes a local or second public address through WebRTC.

Why lookups of private addresses show nothing

A private address is used by countless networks at once, so it has no owner, no ASN and no location. If you enter 192.168.1.1 into the IP lookup or the API, you get the range it belongs to and security.is_bogon set to true, and nothing else. Seeing private or bogon addresses in server logs usually means a proxy or load balancer in front of the server, or a forged X-Forwarded-For header.

[ FAQ ]

Frequently asked questions

Is 192.168.1.1 a public IP address?

No. It is in 192.168.0.0/16, a private range, and is the default address of many home routers. It works only inside the local network and cannot be reached from the internet.

Can two devices have the same private IP address?

Yes, as long as they are on different networks. Millions of homes use 192.168.1.x at the same time. Inside one network, every device must have a different address.

Why does my router show a different public IP than websites do?

Your ISP is probably using carrier-grade NAT. The router gets an address from 100.64.0.0/10 or another internal range, and the ISP translates it again to a public address that it shares with other customers.

Is a private IP address more secure?

Devices on private addresses cannot be reached directly from the internet, which blocks unsolicited connections. That is a side effect of NAT, not real security: devices still need updates, and a firewall should do the filtering.

Last updated · All articles · API docs