Every network, whether it’s the entire internet or your home Wi-Fi, needs a way to tell devices apart. That’s where IP addresses come in. An IP address is basically a unique ID made up of numbers separated by dots.
IP addresses can be public (or “white”), which are used to connect to the wider internet, or private (internal), which are used within local networks like your home or office.
Also, IPs can be static (they stay the same) or dynamic (they change over time), and they follow one of two standards: IPv4 or the newer IPv6.
In this article, we’ll break down what IP addresses are, how they work, and why understanding the difference between public and private IPs actually matters.
An IP address (Internet Protocol Address) is a unique identifier assigned to every computing device on a network. It consists of numbers separated by dots.
When a user visits a website, a request is sent from their IP to a remote server, which then responds with the web page. Without IP addresses, computers and smartphones wouldn’t be able to locate each other online. They wouldn’t know where to send or receive data.
An IP address is comparable to a postal code, which tells the postman where to deliver a letter and tells the recipient where it came from.
All IP addresses are unique, since they identify individual devices in a network. However, they follow the same structural format.
Examples of IPv4 addresses, which consist of four integers:
78.129.229.78
172.16.254.1
203.0.113.5
192.162.74.34
184.12.203.67
Examples of IPv6 addresses, made up of eight hexadecimal blocks:
2606:4700:4700:0db8:2001:1111
2001:4860:4860::8888
fe80::1a2b:3c4d:5e6f:7g8h
1050:0:0:0:5:600:300c:326b
2001:0db8:aa10:0001:7g8h::00fb
Some IPv6 addresses may contain two colons in a row (::
), which represent a sequence of zeroes. For example:
2001:0db8:0000:0000:0000:0000:0000:1
2001:db8::1
However, the double colon (::
) can only appear once in an IPv6 address, or else it would be unclear how many zeroes are omitted.
For instance, the address 2001::5e6f::4860
could ambiguously mean:
2001:0000:0000:5e6f:0000:4860
2001:0000:5e6f:0000:0000:4860
If no double colon is used, then either the address is complete or contains full zeroes.
Most operating systems allow local communication via a reserved domain name — localhost
.
It’s important to distinguish between the types and categories of IP addresses.
Categories of IP addresses:
Types of IP addresses:
Classification by protocol:
192.168.1.1
fe80::1a2b:3c4d:5e6f:7g8h
In summary, categories define whether an IP is public or private, while types define whether it's permanent or temporary.
A public IP address is a public (external) IP that identifies a computing device on the internet.
Regular internet users connect to websites and game servers using public IPs.
Domain names (like hostman.com), resolved through DNS (Domain Name System), are simply a user-friendly wrapper around public IP addresses.
Thus, having a public IP is a prerequisite for any computing device to interact directly with the internet.
A private IP address is a private (internal) IP used to identify a device within a local network.
The main purpose of private IPs is to conserve public IPs, which are limited in number.
IPv4 uses 32 bits to encode IPs, yielding a range from 0.0.0.0
to 255.255.255.255
, totaling 4,294,967,296 possible addresses (256^4, not 255^4, because counting starts from 0).
With over 8 billion people on Earth, and each using multiple devices (laptops, smartphones, TVs, smart speakers, etc.), there's clearly not enough public IPs for everyone.
This limitation is addressed with private IPs. These are used within local networks to identify multiple devices, all of which connect to the internet through a single public IP that represents the whole network globally.
Private IPs solve several problems:
In short, private IP addresses:
A practical example:
A home Wi-Fi router connects multiple devices (PC, phone, TV, smart speaker). All these are part of the local network and have private IPs.
However, the Wi-Fi router itself is part of the global Internet and has a public IP address.
For an internal device to access the external internet, its private IP address is converted into a public IP using NAT (Network Address Translation) technology.
The conversion occurs in several steps:
In essence, NAT rewrites IPs in data packets, enabling private IP devices to interact with the internet. There are several types of IP substitution:
Until the world fully transitions to IPv6, which removes the limitations of IPv4, NAT will continue to be used in Wi-Fi routers, modems, and local networks.
Of course, sharing a single public IP among multiple devices isn’t always ideal.
For example, if three players are gaming on a remote server using the same Wi-Fi router, and one gets IP-banned for cheating, all three could be banned, which seems unfair.
However, in such cases, rebooting the router may assign a new dynamic public IP address.
Also, the router's bandwidth is shared among all connected users. So, the more devices are connected to a router, the slower the connection speed for each.
Regardless of the IP type, a common question is: Who assigns these identifiers to devices? The answer is: DHCP.
DHCP (Dynamic Host Configuration Protocol) is a technology that automatically assigns IP addresses to all new devices in a network.
Whether it's a local or global network, IP assignment follows these steps:
In some cases, a private IP can be manually set on a device, which it then proposes to the DHCP server.
A public IP can only be manually set if it is static and pre-assigned by an ISP.
If an IP conflict arises (two devices use the same IP), the DHCP server reassigns IPs to both.
Although public and private IPs are structurally identical, they differ in usage context:
Characteristic |
Public IP |
Private IP |
Internet Accessibility |
Yes |
No |
Uniqueness Across Networks |
Yes |
No |
Security |
Lower |
Higher |
NAT Use |
No |
Yes |
Cost |
Paid |
Free |
Routing |
Global |
Local |
Manual Assignment |
No |
Yes |
Assigned By |
ISP |
Network Administrator |
Default IP Type |
Dynamic |
Static |
A public IP can connect to the Internet directly. A private IP can only connect to the Internet through NAT using a public IP.
Public IPs can be static or dynamic, while private IPs are typically static.
It’s incorrect to view public and private IPs as alternatives. For Internet access, a public IP is essential — without it, the global network is inaccessible.
In reality, local and global networks are interconnected.
Multiple devices in a local network may have unique private IPs, but all access the Internet through a single public IP.