Public vs Private IP Addresses Explained
Back to Articles
Networking

Public vs Private IP Addresses Explained

Understand the difference between public and private IP addresses. Learn about NAT, private IP ranges, CGNAT, and how to check which type you have.

TraceThatIP Team January 9, 2026 6 min read 1,025 words

The Two Types of IP Addresses

Every device on your home network has two IP addresses: a private IP used inside your network and a public IP used on the internet. Understanding this distinction is fundamental to networking.

Your laptop might have a private IP of 192.168.1.105. But when you visit a website, that website sees your router's public IP - something like 203.45.67.89. These are completely different addresses serving completely different purposes.

Want to see your public IP right now? Use our What's My IP tool.

What Is a Public IP Address?

A public IP address is globally unique and routable on the internet. It is assigned to your router by your Internet Service Provider (ISP). Every device on your home network shares this single public IP when communicating with the internet.

Key characteristics:

  • Assigned by your ISP
  • Globally unique across the entire internet
  • Visible to every website and service you connect to
  • Can be traced to your ISP and approximate location (using tools like TraceThatIP)
  • Can be static (fixed) or dynamic (changes periodically)

When someone says they want to "trace an IP address," they mean a public IP. Learn how in our IP tracing guide.

How public IPs are allocated

The global IP address pool is managed by a hierarchy of organizations:

TEXT
IANA (Internet Assigned Numbers Authority)
  └── Regional Internet Registries (RIRs)
        ├── ARIN    (North America)
        ├── RIPE    (Europe, Middle East)
        ├── APNIC   (Asia-Pacific)
        ├── LACNIC  (Latin America)
        └── AFRINIC (Africa)
              └── ISPs (Telstra, Comcast, Vodafone, etc.)
                    └── Your router (1 public IP)

Your ISP buys blocks of public IPs from the regional registry and assigns one to each customer.

What Is a Private IP Address?

A private IP address is used exclusively within a local network (your home, office, or data center). Private IPs are not routable on the internet. They cannot be seen by the outside world.

Key characteristics:

  • Assigned by your router via DHCP
  • Only unique within your local network
  • Not visible to the internet
  • Can be reused across millions of different networks
  • Always in one of the reserved private ranges

The three private IP ranges

The Internet Engineering Task Force (IETF) reserved three IP ranges exclusively for private use in RFC 1918:

RangeCIDRAddressesTypical Use
10.0.0.0 - 10.255.255.25510.0.0.0/816,777,216Enterprise networks, VPNs, cloud providers
172.16.0.0 - 172.31.255.255172.16.0.0/121,048,576Medium corporate networks
192.168.0.0 - 192.168.255.255192.168.0.0/1665,536Home routers (most common)

If your device's IP starts with 192.168., 10., or 172.16-31., it is a private IP.

Other reserved address ranges

Beyond RFC 1918, several other ranges have special purposes:

RangePurpose
127.0.0.0/8Loopback (localhost) - your own machine
169.254.0.0/16Link-local (APIPA) - auto-assigned when DHCP fails
100.64.0.0/10Carrier-grade NAT (shared ISP space)
224.0.0.0/4Multicast addresses
0.0.0.0/8"This network" - used in routing tables

How NAT Connects Private to Public

If private IPs cannot reach the internet, how does your laptop browse the web? The answer is Network Address Translation (NAT).

NAT is performed by your router. It translates private IPs to your single public IP and keeps track of which internal device made which request.

The NAT process step by step

TEXT
1. Your laptop (192.168.1.105) sends a request to google.com
2. Your router receives the packet
3. Router replaces 192.168.1.105 with your public IP (203.45.67.89)
4. Router records: "Port 54321 = 192.168.1.105"
5. Google receives the request from 203.45.67.89
6. Google sends the response back to 203.45.67.89
7. Router receives the response
8. Router looks up port 54321 → 192.168.1.105
9. Router forwards the response to your laptop

This is why NAT was invented - it allows millions of devices to share the limited pool of public IPv4 addresses.

NAT types

TypeDescriptionUse Case
SNAT (Source NAT)Translates source IP of outgoing packetsHome/office internet access
DNAT (Destination NAT)Translates destination IP of incoming packetsPort forwarding, hosting servers
PAT (Port Address Translation)Multiple private IPs share one public IP using different portsMost home routers (also called NAT overload)
1:1 NATOne private IP maps to one public IPEnterprise DMZ, dedicated servers

Most home routers use PAT, which is the most common form of NAT.

Carrier-Grade NAT (CGNAT)

As IPv4 addresses became scarce, ISPs started implementing Carrier-Grade NAT (CGNAT). With CGNAT, multiple customers share a single public IP address.

TEXT
Traditional setup:
  Your router → Public IP 203.45.67.89 (unique to you)

CGNAT setup:
  Your router → ISP NAT → Public IP 203.45.67.89 (shared with 50+ customers)

How to detect CGNAT

If your router's WAN IP is in the 100.64.0.0/10 range (100.64.x.x to 100.127.x.x), you are behind CGNAT.

Check your router's WAN IP and compare it to what What's My IP shows:

  • If they match: You have a direct public IP
  • If they differ: You are likely behind CGNAT

CGNAT implications

  • Port forwarding does not work (you cannot host servers)
  • Some VoIP and gaming protocols may have issues
  • IP-based geolocation becomes less accurate
  • Multiple unrelated users share your apparent IP address

How to Find Your IP Addresses

Find your public IP

The fastest way: visit What's My IP.

From the command line:

Terminal
# Using curl
curl https://tracethatip.com/raw

# Alternative services
curl ifconfig.me
curl icanhazip.com

Find your private IP

macOS:

Terminal
ifconfig en0 | grep "inet " | awk '{print $2}'

Linux:

Terminal
hostname -I | awk '{print $1}'
# or
ip addr show | grep "inet " | grep -v 127.0.0.1 | awk '{print $2}'

Windows:

Terminal
ipconfig | findstr "IPv4"

Find all devices on your network

Terminal
# Scan your local network (requires nmap)
nmap -sn 192.168.1.0/24

# Or use ARP table
arp -a

Public vs Private IP: Quick Comparison

FeaturePublic IPPrivate IP
ScopeGlobal (internet)Local (your network)
UniquenessGlobally uniqueUnique only within network
Assigned byISPRouter (DHCP)
Visible to websitesYesNo
Can be tracedYes (try it)No
Number available~4.3 billion (IPv4)Unlimited (reusable)
Example203.45.67.89192.168.1.105
ChangesWhen ISP reassignsWhen DHCP lease renews

Why This Matters for Security

Understanding public vs private IPs is important for security:

  1. Your public IP is not a secret. Every website you visit sees it. This is normal and unavoidable.
  2. Private IPs add a layer of protection. Devices behind NAT are not directly reachable from the internet.
  3. Port forwarding exposes devices. When you forward ports on your router, you create a path from the public internet to a private IP.
  4. VPNs replace your public IP. A VPN makes websites see the VPN server's public IP instead of yours. Learn more about hiding your IP address.

Summary

Your public IP is your identity on the internet - assigned by your ISP and visible to every service you connect to. Your private IP is your identity on your local network - assigned by your router and invisible to the outside world. NAT bridges the gap between the two.

Tools to explore:

Share this article