What Is an IP Address? How Devices Find Each Other Online
By the BrainSnail editorial team. How these articles are written and checked, and how to tell us when one is wrong.
An IP address is a numerical address used by the Internet Protocol to help data travel between devices and network destinations.
What an IP address is used for
When you open a website, send a message, or stream a video, data is broken into packets that need to travel across networks. Routers examine addressing information so they can send those packets toward the right destination. An IP address is one important part of that delivery system.
You can think of an IP address as a network location label rather than a permanent name for one physical device. Addresses can change, several devices can share one public-facing address through network translation, and one device can have different addresses on different networks. The exact relationship depends on how the network is configured.
This is the practical answer to what an IP address is. It helps computers route data, but it does not by itself tell you everything about a person, device, or exact physical location.
IPv4 and IPv6 use different address sizes
IPv4 addresses are commonly written as four decimal numbers separated by dots, such as 192.0.2.1. IPv4 uses 32 bits, which allows a little over four billion possible values. As internet use grew, that address space became too small to give every connected device a unique public IPv4 address.
IPv6 was designed with a much larger 128-bit address space. IPv6 addresses are written in hexadecimal groups separated by colons, and rules allow some zeros to be shortened in the written form. The enormous address space makes it far easier to assign large numbers of unique addresses.
When studying IP addresses, remember that IPv4 and IPv6 perform the same broad job of addressing network traffic, even though their formats and supporting protocol details differ. Modern networks often use both during the long transition between the systems.
Public, private, static, and dynamic addresses
A home router often receives a public IP address from an internet provider while devices inside the home use private addresses. Network address translation can let many private devices share the router's public IPv4 address when communicating with the wider internet. This helps conserve the limited IPv4 address space.
An address can also be static or dynamic. A static address is configured to stay the same unless someone changes it. A dynamic address is assigned automatically, often by DHCP, and may change over time. Servers sometimes benefit from stable addressing, while everyday devices commonly use dynamic assignments.
DNS connects names with addresses, which is why you can type a domain name instead of memorising numbers. Learning about an IP address becomes easier if you separate the jobs: DNS helps look up where a name points, while IP addressing helps packets travel through networks toward that destination. IP addresses also work with ports and transport protocols when data reaches a device. The address helps traffic reach the correct machine or network interface, while a port helps the operating system deliver that traffic to the right application or service. Keeping address and port separate is useful when you later learn about web servers, games, messaging, or network troubleshooting.
Special addresses you will meet
Some IPv4 addresses are set aside for particular jobs. The address 127.0.0.1, often called localhost, always refers to the device you are using. Programmers use it to test a web server on their own machine without sending anything over a network. Three ranges are reserved for private networks: addresses beginning with 10, those from 172.16 to 172.31, and those beginning with 192.168. That is why so many home routers use an address like 192.168.1.1. These private addresses are not routed across the public internet.
If a device cannot get an address from a DHCP server, it may give itself one beginning with 169.254. Seeing that address is a useful clue when troubleshooting, because it usually means the device never heard back from the router. You will also see notation such as 192.168.1.0/24. The number after the slash says how many of the 32 bits identify the network, leaving the rest to identify individual devices. A /24 network leaves 8 bits, which gives 256 possible addresses, a few of which are reserved.
Following a packet, and what an address reveals
Every IP packet carries a small number called its time to live. Each router that passes the packet on reduces the number by one, and if it reaches zero the router discards the packet and usually sends a short error message back to the sender. This stops lost packets from circling the internet forever. A diagnostic tool called traceroute uses the rule cleverly. It sends packets whose time to live is 1, then 2, then 3, and so on, and the error messages reveal the address of each router along the path in turn.
People often assume an IP address pinpoints where you are. Websites estimate location using geolocation databases, which link blocks of addresses to the organisations that hold them and to places where those addresses have been seen in use. The result is often correct for the country and sometimes for the city or region, but it can be wildly wrong at street level. It may show your internet provider's equipment many kilometres away, or a mobile network's gateway, rather than your home. A virtual private network changes the address that websites see altogether.
Inside the numbers: binary and the local network test
Each of the four numbers in an IPv4 address is one byte, eight bits, which is why none can exceed 255, the largest value eight bits can hold. The address 192.168.1.10 is really the 32-bit string 11000000 10101000 00000001 00001010. Writing it in decimal with dots is purely a convenience for people; routers work with the bits. The same idea explains the subnet mask that often appears in network settings as 255.255.255.0. In binary that is twenty-four ones followed by eight zeros, the same information as the /24 notation, marking which bits name the network.
Your device uses that mask every time it sends a packet. It compares the network part of its own address with the network part of the destination. Suppose your laptop is 192.168.1.10 with a /24 mask. A printer at 192.168.1.40 shares the first three numbers, so the laptop sends to it directly across the local network. A server at 203.0.113.5 does not match, so the laptop hands the packet to its default gateway, normally the home router, which forwards it towards the internet. If the mask is set wrongly, a device may send local traffic the wrong way, and connections fail in confusing ways.
How IPv4 ran out, and how to read IPv6
The 32-bit design of IPv4 dates from the early 1980s, long before anyone expected billions of phones, laptops and smart devices. Addresses are handed out in large blocks by the Internet Assigned Numbers Authority to five regional internet registries, which pass them on to internet providers and organisations. In February 2011 the central pool ran dry when the last blocks went to the regional registries, and over the following years most registries used up their ordinary supplies too. Since then IPv4 addresses have been bought and sold between organisations, and many mobile networks share one public address among large numbers of customers.
IPv6 avoids this with 128-bit addresses, giving about 3.4 multiplied by 10 to the power 38 possibilities. Writing them out in full is tiring, so two shortening rules apply. Leading zeros in any group of four hexadecimal digits can be dropped, and one run of consecutive all-zero groups can be replaced by a double colon. So 2001:0db8:0000:0000:0000:ff00:0042:8329 becomes 2001:db8::ff00:42:8329. The double colon may appear only once, because with two of them a reader could not tell how many zero groups each one hides. The IPv6 version of localhost is simply written as ::1.
The takeaway
An IP address is a network address used to route Internet Protocol traffic. IPv4 and IPv6 provide different address formats, while public, private, static, and dynamic addresses describe different ways addresses are used. Think of an IP address as routing information, not as a permanent personal identity tag.