IP Address: What It Is and How It Works

An IP address is a unique identifier assigned to each device on a network. It allows devices to locate and communicate with each other.

IP Address

An IP address is a unique numerical label assigned to every device on a network. It is how devices identify each other and route data to the correct destination, functioning like a postal address for the internet that tells every router along the path exactly where to deliver each packet of data.

What Is an IP Address

IP stands for Internet Protocol. An IP address is a structured number assigned to every device that participates in a network, whether that is a home computer, a smartphone, a web server, a smart TV, or any other connected device. When your browser requests a webpage, the request travels as packets through a chain of routers. Each router reads the destination IP address in the packet header and decides where to forward it next. Without IP addresses, there would be no way for routers to determine where any packet should go.

IP addresses serve two purposes simultaneously. They identify the device or network that is the source or destination of a packet, and they provide location information that the routing system uses to determine how to reach that device. These two roles, identity and location, are both embedded in the address itself, which is why changing your network location typically means receiving a different IP address.

Example IPv4 address:
192.168.1.1
Example IPv6 address:
2001:0db8:85a3:0000:0000:8a2e:0370:7334

IPv4 vs IPv6

There are two versions of the Internet Protocol in active use. IPv4 is the original version that has powered the internet since its early days. IPv6 is its successor, developed to address the fundamental problem that the IPv4 address space is nearly exhausted.

IPv4 uses 32-bit addresses written as four groups of numbers between 0 and 255 separated by dots, such as 203.0.113.42. This format allows for approximately 4.3 billion unique addresses, which seemed more than sufficient when the protocol was designed in the 1980s but has proven inadequate as billions of devices came online. Network Address Translation (NAT) has allowed multiple devices to share a single public IPv4 address, extending the life of the IPv4 address pool, but it adds complexity and has limitations for certain applications.

IPv6 uses 128-bit addresses written as eight groups of four hexadecimal digits separated by colons, such as 2001:db8::1. This format provides approximately 340 undecillion unique addresses, which is effectively inexhaustible. IPv6 also simplifies network configuration, improves routing efficiency, and includes built-in support for IPSec encryption. Adoption of IPv6 has been growing steadily as ISPs, cloud providers, and device manufacturers transition their infrastructure.

FeatureIPv4IPv6
Format32-bit, written as four decimal groups (e.g. 192.168.1.1)128-bit, written as eight hexadecimal groups (e.g. 2001:db8::1)
Total AddressesApproximately 4.3 billionApproximately 340 undecillion, effectively inexhaustible
Current StatusWidely used but address pool is exhausted. New allocations rely on NAT.Growing adoption. Most modern devices and networks support both.
Address ConfigurationManual or via DHCPSupports stateless autoconfiguration, allowing devices to configure themselves
SecurityIPSec support is optional and must be configured separatelyIPSec support is built into the protocol specification
NAT RequiredYes, for most home and office networks sharing one public IPNo. Enough addresses exist to assign a unique public IP to every device.

Public vs Private IP Addresses

Not all IP addresses are equal in scope. Some are visible to the global internet while others exist only within a local network. This distinction exists because the number of available IPv4 addresses is insufficient to assign a unique public address to every device in the world, so private address ranges are used within local networks and shared public addresses are used to reach the internet.

TypeWho Assigns ItWhere It Is UsedVisible on the Internet?Example Range
Public IPYour ISPInternet-facing communication. This is the address remote servers see when you connect.YesAny address outside the private ranges
Private IPYour router via DHCPCommunication within your local network only. Not routable on the public internet.No192.168.x.x, 10.x.x.x, 172.16.x.x to 172.31.x.x

Your router uses a technique called Network Address Translation (NAT) to allow all devices on your private network to share a single public IP address. When a device on your network sends a request to a server on the internet, your router replaces the private source IP with its public IP before forwarding the packet. When the response arrives, the router translates it back and delivers it to the correct private device. From the perspective of any external server, all traffic from your home network appears to come from a single IP address.

Static vs Dynamic IP Addresses

IP addresses can be either fixed, meaning they remain the same indefinitely, or dynamic, meaning they are assigned temporarily and may change periodically. The distinction matters for services that need to be consistently reachable at the same address.

FeatureStatic IPDynamic IP
Change FrequencyNever changes once assignedChanges periodically when the DHCP lease expires or the connection resets
Assigned ByISP manually, or router DHCP reservation for private IPsISP via DHCP automatically for public IPs, router via DHCP for private IPs
Use CaseWeb hosting, game servers, remote access, VPN endpoints, CCTV systemsHome users, mobile devices, any connection that does not need to be consistently reachable by IP
CostUsually requires an additional fee from the ISP for a static public IPIncluded in virtually all standard broadband plans at no extra cost
DNS CompatibilitySimple. Point your domain's A record at the static IP and it never needs updating.Requires dynamic DNS (DDNS) services if you need a consistent hostname for a changing IP.

Real-World Use Cases

IP addresses underpin nearly every practical aspect of internet connectivity. Understanding how they are used in specific scenarios clarifies why the distinctions between types matter.

  • Web hosting: Websites and APIs are hosted on servers with static public IP addresses. DNS A records point domain names at these addresses so browsers can reliably find the server regardless of when they make the request.
  • Online gaming: Game servers require stable IP addresses so players can connect reliably. Multiplayer games communicate between clients using IP addresses and port numbers to identify each player's connection.
  • VPN services: When you connect to a VPN, your traffic is routed through the VPN provider's server. Websites and services you visit see the VPN server's IP address rather than your real public IP, masking your identity and approximate location.
  • CCTV and IoT devices: IP cameras, smart home devices, and industrial sensors each require a unique IP address on their local network. Many are also assigned a public IP or use port forwarding to allow remote access.
  • Remote work security: Companies restrict access to internal systems and VPNs to specific IP addresses or ranges, a practice called IP allowlisting. Employees working from home may need a static IP or company VPN to be granted access.
  • Email deliverability: Mail servers use PTR records and IP reputation systems to verify that emails are sent from legitimate servers. The IP address of a mail server directly affects whether its messages are accepted or flagged as spam.

How to Find Your IP Address

  • Public IP: Search "what is my IP" in any browser to see your current public IP instantly, or use the command line with curl ifconfig.me on macOS and Linux. See the full guide to finding your IP address for all methods.
  • Windows private IP: Open Command Prompt and run ipconfig. Look for the IPv4 Address field under your active network adapter.
  • macOS private IP: Run ifconfig | grep inet in Terminal, or go to System Settings, Network, and select your connection.
  • Linux private IP: Run ip addr show or hostname -I in the terminal.
  • Mobile devices: Go to Settings, Wi-Fi, and tap the connected network to view the IP address assigned by your router.

Frequently Asked Questions

  1. Can two devices have the same IP address?
    Not on the same network, as this would cause a conflict and prevent both devices from communicating reliably. However, two devices on different private networks can share the same private IP address because private address ranges are not globally unique by design. For example, millions of home routers use 192.168.1.1 simultaneously without conflict because each one is isolated within its own private network. On the public internet, every IP address must be globally unique.
  2. What is DHCP?
    DHCP stands for Dynamic Host Configuration Protocol. It is a network protocol that automatically assigns IP addresses to devices when they join a network. When your laptop connects to Wi-Fi, your router's DHCP server assigns it an available private IP address, a subnet mask, the default gateway address, and a DNS server address. DHCP leases are temporary, and addresses may be reassigned after the lease expires if the device has disconnected. This is why your private IP may occasionally change.
  3. Why do VPNs change your IP address?
    When you connect to a VPN, all your internet traffic is encrypted and routed through the VPN provider's server before reaching its destination. From the perspective of any website or service you visit, the request appears to originate from the VPN server's IP address rather than your real public IP. This masks your identity, approximate geographic location, and browsing activity from the websites you visit, your ISP, and anyone monitoring the network between you and the VPN server.
  4. What is the difference between an IP address and a MAC address?
    A MAC address is a hardware identifier burned into a network interface card by its manufacturer. It is used for communication within a local network at the data link layer and does not change when you move between networks. An IP address is a logical identifier assigned by network configuration and changes depending on which network you are connected to. Routers use MAC addresses to deliver packets within a local network and IP addresses to route packets between networks. The two systems work together through a protocol called ARP (Address Resolution Protocol).
  5. What is an IP address range and what does the slash notation mean?
    When you see a notation like 192.168.1.0/24, the number after the slash is called a prefix length or CIDR notation. It indicates how many bits of the address represent the network portion and how many represent individual hosts within that network. A /24 means the first 24 bits identify the network, leaving 8 bits for host addresses, which allows for 254 usable device addresses in that range. A /32 identifies a single specific address. This notation is used extensively in router configuration, firewall rules, and network documentation to describe ranges of addresses concisely.

Conclusion

IP addresses are the fundamental addressing system of the internet. Every device that communicates over a network requires one, and every packet of data travelling across the internet carries both a source and destination IP address that routers use to forward it along the correct path. Understanding the differences between public and private addresses, static and dynamic assignment, and IPv4 and IPv6 gives you a practical foundation for networking, web hosting, security configuration, and troubleshooting connectivity problems. Continue with IPv4 vs IPv6, public vs private IP addresses, and how routing works to build a complete picture of how the internet addressing system functions.