Public vs private IP addresses: the reserved ranges, NAT, and how to tell which one you have

Private addresses like 192.168.1.20 work only inside a local network; a public address is the one the rest of the internet sees. The exact private ranges for IPv4 and IPv6, the special ranges that are neither (100.64, 169.254, 127), how NAT joins the two, and how to check any address by eye or in code.

On this page Public vs private IP: the difference

You connect to the office VPN from home, and the file server at 192.168.1.10 won't open. Your home router hands out 192.168.1.x addresses too, so your laptop may look for the server on your own Wi-Fi instead. Both networks are allowed to use the same range, because those are private addresses: they only have to be unique inside one network. The address websites see is a different one again, the public address of your connection.

Besides the three RFC 1918 private ranges, you'll also run into 100.64.x.x on a router, 169.254.x.x on a laptop that can't connect, and IPv6 addresses starting with fd or fe80. This guide covers each of them, with links to the standards that define them.

Public vs private IP: the difference

A public IP address is globally unique and routed on the internet: any server can send packets back to it. Your ISP assigns it to your connection, and it's the address what is my IP shows. A private IP address comes from a range reserved for local networks. The same private addresses are reused in a huge number of separate networks, so routers on the internet don't carry traffic for them. A device with only a private address reaches the internet through a router that translates its address to a public one. (For the basics of what an address is, see what is an IP address.)

The private IPv4 ranges (RFC 1918)

RFC 1918 sets aside three blocks for private networks:

RangeCIDRAddressesTypical use
10.0.0.0 to 10.255.255.25510.0.0.0/816.777.216Company networks, cloud VPCs, some home routers
172.16.0.0 to 172.31.255.255172.16.0.0/121.048.576Company networks, Docker's default bridge networks
192.168.0.0 to 192.168.255.255192.168.0.0/1665.536Most home routers (192.168.0.x, 192.168.1.x)

The /8, /12 and /16 are CIDR prefix lengths: how many leading bits are fixed. The middle block is easy to misread: it covers 172.16.x.x to 172.31.x.x only, so 172.32.0.1 and 172.15.0.1 are ordinary public addresses. The subnet calculator shows the first and last address of any block if you want to check. Anyone can use these ranges without asking a registry, and in return nobody can route them on the public internet.

Private addresses in IPv6

IPv6 has its own equivalents, but they're used differently.

  • Unique local addresses (ULA), fc00::/7, are the closest thing to RFC 1918 (RFC 4193). In practice you'll see them starting with fd, because RFC 4193 only defines the half of the block where its "L" bit is set (locally assigned), with a random 40-bit Global ID so that two networks are unlikely to pick the same prefix.
  • Link-local addresses, fe80::/10, exist on every IPv6 interface and only work on the local link, such as one Wi-Fi network (RFC 4291). Your device has one even when it has no other IPv6 address.

The big difference from IPv4 is that IPv6 devices normally also get a public (global) address of their own. There's enough address space that the ISP gives your router a whole block, and each device takes an address from it. There's no translation step, so the "public IP" a website sees over IPv6 is the address of your device, not of your router. Your router's firewall, not NAT, decides what can connect in.

How NAT lets private devices reach the internet

Network address translation (NAT) is how a whole house shares one public IPv4 address. When your laptop at 192.168.1.20 opens a connection to a website, the router:

  1. Replaces the private source address with its own public address, and usually picks a new source port.
  2. Records the mapping: this public port belongs to 192.168.1.20, port 51544.
  3. When the reply comes back to that public port, looks up the mapping and forwards the packet to the laptop.

The website only ever sees the router's public address, so every device in your home that connects over IPv4 shows the same address on what is my IP. It's also why a server can't start a connection to a device behind NAT unless you set up port forwarding on the router.

Some ISPs add a second layer: your router gets an address from the ISP's own shared range and the ISP translates again before traffic reaches the internet. This is carrier-grade NAT (CGNAT), which uses the range in the next section.

Addresses that are neither public nor private

Several ranges are reserved for special purposes. They're not in RFC 1918, but they're not public addresses either. The full list is the IANA IPv4 Special-Purpose Address Registry and its IPv6 counterpart; these are the ones you'll actually meet:

RangeNameWhere you'll see itDefined in
100.64.0.0/10Shared address spaceYour router's WAN address when the ISP uses CGNATRFC 6598
169.254.0.0/16IPv4 link-localA device that asked for an address and got no answerRFC 3927
127.0.0.0/8 and ::1Loopbacklocalhost: the device talking to itselfRFC 1122 §3.2.1.3, RFC 4291
192.0.2.0/24, 198.51.100.0/24, 203.0.113.0/24DocumentationExamples in manuals and articlesRFC 5737
2001:db8::/32 and 3fff::/20IPv6 documentationExamples in manuals and articlesRFC 3849, RFC 9637

A few notes on these:

  • 100.64.0.0/10 (100.64.0.0 to 100.127.255.255) is for ISPs. RFC 6598 says this shared address space "is distinct from RFC 1918 private address space" and that packets from it must not be forwarded across service provider boundaries. If your router reports a WAN address in this range, you're behind CGNAT.
  • 169.254.x.x on Windows is often called an APIPA address. Your computer picks it by itself when it asks the network for an address and no DHCP server answers. It usually means the cable, the Wi-Fi connection or the router's DHCP service has a problem.
  • Documentation addresses are reserved so that examples never point at a real network. IPv6 got a second, larger documentation block, 3fff::/20, in 2024 (RFC 9637).

Developers who need the full list in code, including IPv6 ranges such as the NAT64 prefix, can find one in IPv6 geolocation.

How to tell whether an address is public or private

By eye, for IPv4: an address starting with 10., 192.168. or 172.16. to 172.31. is private; 100.64. to 100.127. is CGNAT space; 169.254. is link-local; 127. is loopback. Almost everything else is public. For IPv6: fd or fc is unique local, fe80 is link-local, ::1 is loopback, and addresses starting with 2 or 3 are global, apart from a few special blocks: the documentation prefixes 2001:db8::/32 and 3fff::/20, and blocks such as 2001::/23 (IETF protocol assignments) and 2002::/16 (6to4) that the IANA IPv6 registry lists separately.

If you're not sure whether an address falls inside a block, put the block into the subnet calculator and compare the range. To find your own local and public addresses on each operating system, see how to find your IP address.

In code, use your language's address library rather than string prefixes. Python's ipaddress module follows the IANA registries:

python
import ipaddress

for a in ["192.168.1.1", "172.20.1.1", "100.64.1.1", "169.254.10.20", "8.8.8.8", "fd12:3456:789a::1"]:
    ip = ipaddress.ip_address(a)
    print(a, "private:", ip.is_private, "global:", ip.is_global)

Run on Python 3.12, it prints:

text
192.168.1.1 private: True global: False
172.20.1.1 private: True global: False
100.64.1.1 private: False global: False
169.254.10.20 private: True global: False
8.8.8.8 private: False global: True
fd12:3456:789a::1 private: True global: False

is_private is true for more than RFC 1918: link-local, loopback and documentation addresses count too, because the registry marks them as not globally reachable. And 100.64.1.1 is neither private nor global. If your question is "can this address be reached from the internet?", test is_global.

In Node.js, net.BlockList checks an address against the ranges you add:

js
const net = require('net');

const privateRanges = new net.BlockList();
privateRanges.addSubnet('10.0.0.0', 8);
privateRanges.addSubnet('172.16.0.0', 12);
privateRanges.addSubnet('192.168.0.0', 16);
privateRanges.addSubnet('fc00::', 7, 'ipv6');

console.log(privateRanges.check('192.168.1.1'));       // true
console.log(privateRanges.check('172.32.0.1'));        // false
console.log(privateRanges.check('fd00::1', 'ipv6'));   // true

For the arithmetic behind a range check, see match an IP against a CIDR range. To validate that a string is an IP address at all, see IP address validation.

Why a private IP has no location

IP geolocation works by estimating where a public network is used. A private address isn't part of any public network: 192.168.1.20 is in use in countless homes on every continent at the same moment, so there's nothing to look up. If you enter one into IP lookup, it's shown as a private or reserved address with no location or ISP. The same applies to 100.64.x.x, link-local and documentation addresses.

For the same reason, a lookup of your own connection uses your public address. It belongs to your ISP's network, so it can be placed approximately, usually in the right country and somewhere near the right city.

FAQ

Is 192.168.1.1 a public IP?

No. It's in 192.168.0.0/16, one of the RFC 1918 private ranges, and it's the default address of many home routers. Your router has a second, public address on its internet side.

Can someone hack me with my private IP?

Not from the internet. A private address can't be reached from outside your network, and the same address is in use in countless other homes. Someone already on your network (your Wi-Fi, for example) can see and reach private addresses, which is one more reason to use a strong Wi-Fi password and keep the router updated.

Why does my computer show 169.254.x.x?

It asked for an address and no DHCP server answered, so it gave itself a link-local address (RFC 3927). It can only talk to devices on the same link and can't reach the internet. Reconnect to the network, restart the router, or check the cable.

Why does my router show a 100.64.x.x address?

Your ISP uses carrier-grade NAT. 100.64.0.0/10 is shared address space set aside for ISPs (RFC 6598): not private in the RFC 1918 sense, and not public either. A router WAN address in that range means you share a public IPv4 address with other customers, and port forwarding on your router won't make a device reachable from the internet over IPv4.

See which public address your connection uses right now: what is my IP.

Look up an IP address now

Free IP lookup: location, network and bot flags, no account needed.