Private vs Public IP Address: What Is the Difference?
A public IP address is assigned by your ISP and identifies your network online. A private IP identifies devices inside local networks like homes or offices.
Public vs Private IP Address
All IP addresses fall into two categories: public and private. Understanding the difference is essential for networking, security, and troubleshooting internet connectivity issues. It also explains why devices on your home network can talk to each other but are not directly reachable from the outside world.
What Is a Public IP Address
A public IP address is the address that represents your entire home or office network on the internet. It is assigned to you by your Internet Service Provider (ISP) and is the address that websites, apps, and remote servers see when you connect to them. Every time you load a webpage or make an API request, the destination server sees your public IP as the source of that traffic.
Public IP addresses are globally unique. No two devices or networks on the internet share the same public IP at the same time. This uniqueness is what makes it possible to route traffic correctly across the internet, because every packet needs a destination address that points to exactly one place.
203.0.113.45
Public IP addresses can be dynamic or static. A dynamic public IP is reassigned periodically by your ISP and may change each time your router reconnects. A static public IP stays the same over time and is typically used by businesses or anyone who needs to host a server that others can reliably connect to. Home internet connections almost always use dynamic public IPs, while web hosting and business plans often offer static options.
What Is a Private IP Address
A private IP address is assigned by your router to devices within your local network, such as phones, laptops, smart TVs, and printers. These addresses exist only within your local network and are not routable on the public internet. A device with a private IP cannot be directly contacted from outside your network unless specific rules are configured to allow it.
Your router acts as the gateway between your private network and the public internet. It assigns private IP addresses to each connected device, usually automatically through a system called DHCP (Dynamic Host Configuration Protocol). When a device on your network sends traffic to the internet, the router translates the private IP to the public IP before the request leaves your network, and reverses the translation when the response comes back.
192.168.1.5
The same private IP address can exist on millions of different networks simultaneously without any conflict, because private addresses are never routed on the public internet. Your home network might have a device at 192.168.1.5, and so might your neighbour's, but they are on completely separate private networks hidden behind their own public IPs.
Private IP Address Ranges
Private IP address ranges are defined by the Internet Assigned Numbers Authority (IANA) and are reserved specifically for use within private networks. There are three ranges, covering different network sizes and use cases.
| Range | Class | Common Use |
|---|---|---|
| 10.0.0.0 to 10.255.255.255 | Class A | Large enterprise networks and cloud infrastructure |
| 172.16.0.0 to 172.31.255.255 | Class B | Medium-sized business networks |
| 192.168.0.0 to 192.168.255.255 | Class C | Home routers and small office networks |
The 192.168.x.x range is the one most people encounter at home. Most consumer routers default to assigning addresses in the 192.168.0.x or 192.168.1.x block. The 10.x.x.x range is popular in enterprise and cloud environments because it provides over 16 million addresses, which is useful when managing large numbers of servers or virtual machines across a data centre or cloud platform.
Public vs Private IP: Key Differences
| Feature | Public IP | Private IP |
|---|---|---|
| Assigned By | Your ISP | Your router via DHCP |
| Visibility | Visible to the entire internet | Visible only within the local network |
| Globally Unique? | Yes, no two active devices share the same public IP | No, the same private IP can exist on many separate networks |
| Internet Routable? | Yes | No, private addresses are not routed on the public internet |
| Security Exposure | Directly exposed and reachable from the internet | Hidden behind NAT, not directly reachable externally |
| Typical Example | 203.0.113.45 | 192.168.1.5 |
How NAT Bridges Public and Private IPs
NAT (Network Address Translation) is the technology built into your router that allows multiple devices with private IP addresses to share a single public IP address when accessing the internet. Without NAT, every device would need its own public IP address, which would exhaust the limited IPv4 address space extremely quickly.
When a device on your local network sends a request to the internet, NAT intercepts it at the router, replaces the private source IP with the public IP, and records the mapping in a table. When the response arrives, the router looks up that table and forwards the packet back to the correct private IP on your network. From the website's perspective, all traffic from your home comes from one IP address.
- A device with private IP 192.168.1.5 sends a request to a website
- The router intercepts the outbound packet and replaces the source IP with the public IP 203.0.113.45
- The website receives the request and sees it coming from 203.0.113.45
- The website sends its response back to 203.0.113.45
- The router receives the response, looks up which device made the original request, and forwards the packet to 192.168.1.5
The router keeps track of connections using port numbers in addition to IP addresses. Each outbound connection is assigned a unique port so the router can correctly match responses to the right device, even when many devices are making requests simultaneously. This specific form of NAT that uses port tracking is called PAT (Port Address Translation) and is what makes it possible for dozens of devices to share one public IP without their traffic getting mixed up.
How to Find Your IP Addresses
Finding your public IP is straightforward. Any website that displays your IP, or a search engine query for "what is my IP", will show you the public address your ISP has assigned to your connection. This is the address the rest of the internet sees.
Finding your private IP depends on your operating system. On Windows, running ipconfig in the command prompt shows your local network address. On macOS and Linux, the command ifconfig or ip addr lists your network interfaces and their assigned private IPs. On most home networks, your private IP will start with 192.168, which immediately identifies it as a private address.
Real-World Examples
- Home Wi-Fi: All devices in the house share one public IP assigned by the ISP. Each device gets a unique private IP from the router, typically in the 192.168.x.x range.
- Office network: Hundreds of PCs and phones each have a unique private IP on the internal network. They all share a small number of public IPs through NAT when accessing the internet.
- Web servers: Servers that need to be reachable from anywhere on the internet are assigned public, usually static IP addresses. Without a public IP, external users would have no way to connect to them directly.
- Cloud infrastructure: Virtual machines in cloud platforms like AWS or Azure are typically assigned private IPs within the cloud provider's internal network. A public IP or load balancer is added separately when the service needs to be publicly accessible.
- VPN: A VPN routes your internet traffic through a server in another location. Websites see the VPN server's public IP instead of your own, which masks your real location and public IP from the sites you visit.
Frequently Asked Questions
- Can websites see my private IP address?
No. NAT hides your private IP from the internet. When your traffic leaves your router, the source address is replaced with your public IP. Websites only ever see your public IP. Your private IP is visible only to devices on your local network and to your router. - Do all devices on my Wi-Fi share the same public IP?
Yes. Your router assigns each device a unique private IP address, but when any of those devices access the internet, all their traffic appears to originate from the same public IP address that your ISP assigned to your router. This is how NAT allows an entire household of devices to share a single public IP. - Can private IP addresses conflict?
Yes, but only within the same local network. If two devices on the same network are assigned the same private IP address, neither will work correctly because the router cannot tell which device should receive incoming traffic. This is called an IP conflict and is usually caused by a DHCP misconfiguration or a device manually assigned a static private IP that overlaps with another. Conflicts between private IPs on different networks are not possible because private addresses are never routed between networks. - What is a static private IP and when would I need one?
By default, routers assign private IP addresses dynamically through DHCP, which means a device's private IP might change over time. A static private IP is a fixed address manually assigned to a specific device so it always gets the same address. This is useful for devices like network printers, home servers, or smart home hubs that other devices on the network need to reliably reach at a consistent address. Most routers allow you to reserve a specific private IP for a device based on its MAC address, which achieves the same result without manual configuration on the device itself. - Why does my IP address sometimes appear to be in a different city or country?
Geolocation databases map public IP addresses to approximate physical locations based on registration records and network routing data. These records are not always accurate and can lag behind when ISPs reassign address blocks or when traffic is routed through servers in a different region. VPNs and proxy services deliberately exploit this by routing your traffic through servers in other locations, making your traffic appear to originate from wherever the server is located.
Conclusion
Public and private IP addresses serve distinct but complementary roles in how networks are structured. Your public IP is your identity on the internet, assigned by your ISP and visible to every server you connect to. Your private IP is your identity within your local network, assigned by your router and never visible beyond it. NAT bridges the two, allowing every device in your home or office to access the internet through a single shared public address. Understanding this distinction is foundational to making sense of networking concepts like port forwarding, VPNs, firewalls, and cloud infrastructure. To learn more, explore Network Address Translation, default gateway, and IPv4 vs IPv6.
