Public vs Private IP Addresses - Complete Guide to IP Address Types
Public vs Private IP Addresses
What is a Public IP Address?
A public IP address is an IP address that can be accessed over the Internet. Like postal address used to deliver a postal mail to your home, a public IP address is the globally unique IP address assigned to a computing device. Your public IP address can be found at What is my IP Address page.
Public IP addresses are used by Internet Service Providers (ISPs) to enable Internet access. When you browse the internet, your public IP address is communicated to the webserver so that the webserver knows where to send the requested data.
What is a Private IP Address?
A private IP address is the address space allocated by InterNIC to allow organizations to create their own private network. There are three IP blocks (1 class A, 1 class B and 1 class C) reserved for a private use. The computers, tablets and smartphones sitting behind your home, and the personal computers within an organizations are usually assigned private IP addresses.
A computer that is assigned a private IP address cannot be accessed directly from the Internet. A private IP address is used to connect computers and devices within the same network together. For example, you may find several devices in your home that have IP addresses starting with 192.168.xxx.xxx. These are private IP addresses.
Private IP Address Ranges
The following IP blocks are reserved for private use:
- Class A: 10.0.0.0 to 10.255.255.255 (10.0.0.0/8)
- Class B: 172.16.0.0 to 172.31.255.255 (172.16.0.0/12)
- Class C: 192.168.0.0 to 192.168.255.255 (192.168.0.0/16)
How Public and Private IP Addresses Work Together
When you connect to the Internet, your router (or gateway) uses Network Address Translation (NAT) to translate your private IP address to a public IP address. This allows multiple devices on your private network to share a single public IP address.
Here's how it works:
- Your device has a private IP address (e.g., 192.168.1.100)
- Your router has both a private IP address (e.g., 192.168.1.1) and a public IP address (assigned by your ISP)
- When you request a webpage, your router translates your private IP to its public IP
- The webserver responds to the public IP
- Your router translates the response back to your private IP address
Key Differences
| Aspect | Public IP Address | Private IP Address |
|---|---|---|
| Scope | Globally unique, accessible from Internet | Local network only |
| Assignment | Assigned by ISP | Assigned by router/network admin |
| Cost | Usually paid for | Free |
| Security | Exposed to Internet | Protected behind NAT |
| Range | Any valid IP address | Reserved ranges only |
| Usage | Internet communication | Local network communication |
Security Considerations
Private IP addresses provide a layer of security because they are not directly accessible from the Internet. This is why most home and office networks use private IP addresses for internal devices. The router acts as a gateway and firewall, controlling what traffic can pass between the private and public networks.