What is an IP address and how it works
Short answer
An IP address is a numeric identifier given to a device on a network that communicates with the Internet Protocol. It identifies the device and helps locate it for communication. IPv4 and IPv6 are the two versions in use today.
Key points
- Identifies a device and its location on a network
- IPv4 uses 32-bit addresses; IPv6 uses a different format
- CIDR notation shows the network prefix after a slash
- About 18 million IPv4 addresses are reserved for private networks
- NAT lets multiple devices share one public IP
What is an IP address?
What is an IP address? It is a numeric identifier given to a device on a network that communicates using the Internet Protocol. The label identifies the device on that network and helps locate it so data can reach the right place. An IP address works like a postal address, giving traffic a destination across local and global networks.
The two main jobs of an IP address
An IP address has two main functions. It identifies a device on the network, and it locates that device so communication with other devices can happen. A device without an address cannot exchange data on the network.
- Identification: each device, including computers, smartphones, and servers, gets an address that marks it as a separate endpoint.
- Location: the address tells routers where to deliver data, much like a street address tells a courier where to leave a package.
IPv4 and IPv6
IPv4 and IPv6 are both in use today, and each one formats addresses in its own way. Because IPv4 was common earlier, the plain term IP address still usually means an IPv4 address.
The version numbers are not consecutive. Version 5 was assigned in 1979 to the experimental Internet Stream Protocol, which was never referred to as IPv5. That gap explains why the next widely used version after IPv4 is IPv6.
How an IP address is written
An IP address is a long binary number. Because binary is hard to read aloud, addresses are normally shown as ordered groups of numbers. IPv4 addresses are written as four decimal numbers separated by dots, such as 192.0.2.1.
IPv6 uses a different, longer format. The two versions are both in use, and each defines address format on its own terms.
Network and host portions
Every IP address has two logical parts. The network portion names the network that the device joins, while the host portion names the device itself. Together, the two parts make routing possible: routers first find the network, then deliver data to the host.
Subnet masks and CIDR notation
The term subnet mask is used only within IPv4. A subnet mask defines which part of an IPv4 address is the network and which part is the host. For instance, an IPv4 address might be 192.0.2.1 with a subnet mask of 255.255.255.0.
Both IP versions use CIDR, which stands for Classless Inter-Domain Routing. CIDR notation puts a slash after the address and states how many bits belong to the network part, known as the routing prefix. Thus, 192.0.2.1/24 means the first 24 bits name the network and subnet.
Public, private, static, and dynamic addresses
IP addresses can be grouped by the network type they serve and by how they are assigned. A public IP address is reachable from the wider internet. A private IP address is used inside a local network. NAT, or Network Address Translation, lets several devices on a private network use one public IP address to reach the internet.
An address can also be static or dynamic. A static address stays the same. A dynamic address is assigned automatically and can change. Many home networks receive a dynamic public address from an internet service provider.
Static and dynamic assignment in practice
A static address is useful when a device must always be found at the same location, such as a server or printer. A dynamic address is common for phones and laptops because it can be reassigned when they join a network. The choice depends on whether stable reachability matters more than flexible assignment.
IPv4 classes and reserved ranges
Classful addressing once grouped IPv4 addresses into five classes. The table shows the class, the address range, and the maximum number of networks.
| Class | Range | Maximum number of networks |
|---|---|---|
| Class A | 1-126 | 126 (2^7-2) |
| Class B | 128-191 | 16,384 |
| Class C | 192-223 | 2,097,152 |
| Class D | 224-239 | Reserved for multicast |
| Class E | 240-255 | Reserved for research and development |
Classful design helped in the internet's early days, but it did not scale well during the rapid growth of networking in the 1990s. CIDR replaced the class system in 1993. CIDR relies on variable-length subnet masking, so allocation and routing can use prefixes of any length.
Reserved IPv4 space
IPv4 addresses are 32 bits long, allowing 4,294,967,296 possible addresses. A portion of those addresses is set aside for special uses. About 18 million addresses are reserved for private networks, and about 270 million are reserved for multicast addressing.
Remnants of classful networking
Now, classful network ideas remain useful only in a narrow set of cases. They survive as default settings in certain network software and hardware, like a netmask, and in the language network administrators use. CIDR remains the system that governs allocation and routing.
IPv4 address exhaustion and IPv6
IPv4 has a fixed 32-bit space, so its supply is limited. IPv6 exists to provide a much larger address space, and both versions are used at the same time during the transition.
How IP addresses work in practice
- Each device that joins a network gets an IP address.
- That address works like a digital home address, letting the network identify the device uniquely.
- The Internet Protocol sets the rules for packaging, addressing, transmitting, routing, and receiving data.
- Routers use the network portion to move data toward the right network.
- NAT can let several private devices share one public address.
Finding your IP address
On a Mac, open System Preferences, choose Network, select the active connection, and check its details for the IP address. Other operating systems show the address in their network settings. You can also use a website that reports the public address seen by the internet.
IP addresses and security
An IP address identifies a device or network, so it can be used to trace traffic and apply access rules. Network Address Translation hides private addresses behind a public one, which reduces direct exposure of internal devices. For software threats that may abuse network connections, see What is malware definition and types.
IP addresses and the wider internet
IP addresses make the internet usable by giving every connected device a reachable identity. For a broader view of routing, packets, and protocols, see How Does the Internet Work? A Guide. If a browser seems to hold stale network data, How to clear browser cache on any device can help with local troubleshooting.
Questions people also ask
Can two devices share an IP address?
Yes. Through Network Address Translation, several devices in a private network can use one public IP address. Each device still has its own private address inside the network.
Why does IPv4 still matter if IPv6 exists?
IPv4 was historically prevalent, so the generic term IP address usually still refers to IPv4. Both versions are in simultaneous use during the transition.
What does CIDR notation mean?
CIDR notation writes an IP address, a slash, and the number of bits used for the network part. For example, 192.0.2.1/24 means the first 24 bits identify the network.
How many IPv4 addresses exist?
An IPv4 address has 32 bits, which allows 4,294,967,296 addresses. Some are reserved for private networks and multicast.
Related pages
- Cloud Computing: What It Is and How It Works
Cloud computing is on-demand access to computing resources over the internet, usually priced by use. It replaces buying and running physical servers with renting capacity from a provider. Users can scale storage, compute, and software up or down as needs change.
- How Wi-Fi Works: Radio Waves to Router
Wi-Fi sends data as radio waves between a device and a router. The router connects that local wireless network to the wider internet. Standards such as IEEE 802.11 define how devices share frequencies, range, and security rules.
- What is net neutrality? A plain guide
Net neutrality is the principle that internet service providers should treat all online traffic equally, without favoring or blocking particular sites, apps, or services. It shapes how broadband companies manage speed, access, and fees. Supporters and critics disagree about whether extra rules help or harm investment, competition, and access.
- What is DNS and How Does It Work?
DNS is the system that translates human-readable domain names into the IP addresses computers use to find each other on a network. It works as a distributed, hierarchical database with caching, so browsers can load sites without users remembering numeric addresses.
- How Does Email Work? From Send to Inbox
Email moves a message from a sender's mail program to a recipient's inbox through mail servers and standard protocols. The sending server looks up the recipient's domain, finds its mail exchanger, and hands off the message for storage. The recipient then reads it with a mail client or webmail, often through IMAP or POP.
- What Is a VPN and How Does It Work?
A VPN is a service that builds an encrypted tunnel between your device and a remote server, then sends your internet traffic through that server. It can hide your IP address and shield activity on untrusted networks, but it does not make you anonymous to the VPN provider or to websites you log into.
How this page was prepared
Before writing, the topic was researched in the sources below. The page then passed automatic quality checks.