TechnologyWhat is
What Is an IP Address?
An IP address is a number that identifies a device on a network. Learn how IPv4 and IPv6 differ and why your phone and your router have different ones.
4 sourcesPublished
Quick answer
An IP address is a number used to address each device on an IP network uniquely. IPv4 addresses are 32 bits long and IPv6 addresses are 128 bits long. A device at home usually has a private address on the local network, while the router presents one public address to the wider internet.
- IP address
A number used to address each device on an IP network uniquely, where IP stands for Internet Protocol, the protocol layer the address belongs to.
What the address is for
Data on the internet travels in small packets, and each packet needs a destination and a return address. MDN defines an IP address as a number used to address each device on an IP network uniquely. The original Internet Protocol specification, RFC 791, describes the address as the means by which a packet reaches the right host: every packet carries a source and destination address, and the network uses the destination to decide where to forward it.
An IP address identifies a network connection, not a person. A laptop that moves from home Wi-Fi to a café network receives a different address on each, because the address belongs to the network the device is currently attached to.
IPv4 and IPv6
| Criteria | IPv4 | IPv6 |
|---|---|---|
| Address length | 32 bits | 128 bits |
| Typical written form | Four decimal numbers separated by dots, such as 192.0.2.1 | Groups of hexadecimal digits separated by colons, such as 2001:db8::1 |
| Defined in | RFC 791 | RFC 8200 |
| Size of the address space | About 4.3 billion possible addresses | Vastly larger |
A 32-bit address allows two to the power of 32 combinations, which is about 4.3 billion. That sounded enormous in the early network and proved too small once phones, computers, and appliances all needed addresses. IPv6 was specified with 128-bit addresses so that every device could in principle have its own. MDN notes that "IP address" often still means an IPv4 address in everyday speech, even though both families are in use side by side.
Private and public addresses
Most homes have many devices but a single public address. RFC 1918 sets aside blocks of IPv4 addresses for private networks: 10.0.0.0 to 10.255.255.255, 172.16.0.0 to 172.31.255.255, and 192.168.0.0 to 192.168.255.255. Devices inside a home or office use these addresses among themselves. They are not routed across the public internet, so many separate networks can reuse the same private numbers without conflict.
When a device on a private network contacts a site, the router typically substitutes its own public address for the private one using network address translation, and reverses the substitution when the reply returns. This is why the address a website sees for you is usually your router's public address, not the number shown in your phone's Wi-Fi settings.
Static, dynamic, and how your device gets one
Devices usually do not have their address typed in by hand. A router commonly runs a service that hands out addresses automatically when a device joins the network, called DHCP. The address is leased for a period and may change later. A fixed address that does not change is called static, and it is mostly used for servers, printers, and equipment other devices must find reliably. Internet providers also commonly assign the public address dynamically, which is why it can change after a router restarts.
Names versus numbers
People rarely type addresses. They type names, and the Domain Name System translates them to addresses behind the scenes. The DNS guide explains that step. If a site opens when you type its numeric address but not its name, the problem is likely the name lookup rather than the connection, a distinction also covered in Wi-Fi vs Internet.
What an IP address does and does not reveal
| Question | Realistic answer |
|---|---|
| Which network is the visitor on? | Usually the internet provider or organization that holds the address block |
| The visitor's approximate region? | Often roughly, but databases can be wrong, especially for mobile and shared connections |
| The visitor's identity or street address? | Not from the address alone |
Sharing an address is normal
Everyone behind the same router appears to the internet under one public address, so an address alone does not point to a single person or device.
Sources
- IP Address (Glossary) — MDN Web Docs
- RFC 791: Internet Protocol — Internet Engineering Task Force
- RFC 8200: Internet Protocol, Version 6 (IPv6) Specification — Internet Engineering Task Force
- RFC 1918: Address Allocation for Private Internets — Internet Engineering Task Force
Keep going