What is an IP Address?
Short answer: an IP (Internet Protocol) address is a number that identifies a device on a network so data knows where to go and where it came from. Like a postal address, every device that communicates needs one.
IPv4 vs IPv6
| IPv4 | IPv6 | |
|---|---|---|
| Example | 192.168.1.10 | 2001:db8::8a2e:370:7334 |
| Size | 32 bits | 128 bits |
| Addresses | About 4.3 billion | Practically unlimited |
| Notation | Four numbers 0-255 with dots | Eight groups of hexadecimal with colons |
IPv4 addresses ran short as more devices connected, so IPv6 was created. Most networks run both for now.
Public and private addresses
- Public IP: reachable on the internet and assigned by your internet provider. Your whole home usually shares one.
- Private IP: used inside a local network and not routable on the internet.
| Private IPv4 range | Typical use |
|---|---|
10.0.0.0 to 10.255.255.255 | Large company networks |
172.16.0.0 to 172.31.255.255 | Medium networks |
192.168.0.0 to 192.168.255.255 | Home routers |
The address 127.0.0.1 (also called localhost) always points to your own computer and is what you use when you run a project locally.
How private devices reach the internet: NAT
Your router performs Network Address Translation (NAT). Your phone and laptop have private addresses, but when they visit a website, the router swaps in its single public address and keeps track of which reply belongs to which device.
Static vs dynamic IP
| Type | Meaning | Used for |
|---|---|---|
| Dynamic | Assigned automatically and may change | Most homes and phones |
| Static | Fixed and manually set or reserved | Servers, printers, remote access |
Dynamic addresses are handed out by DHCP (Dynamic Host Configuration Protocol), a service on your router that leases an address to each device when it joins.
How to find an IP address
# Windows
ipconfig
# macOS (Wi-Fi)
ipconfig getifaddr en0
# Linux
ip addr
To see your public IP, search "what is my IP" in a browser or run curl ifconfig.me.
IP addresses and domain names
People remember names, computers use numbers. The Domain Name System (DNS) translates a name like example.com into an IP address. Learn more in what a domain name is.
What an IP address reveals
A public IP can show your internet provider and an approximate area, usually a city or region, but not your street address or name. Websites and servers see it in their logs. To hide it, people use a VPN, which replaces your visible address with the VPN server's.
IP, ports and protocols
An IP address finds the device. A port finds the program on it. Together, as in 192.168.1.10:3000, they identify one service. Web traffic usually uses port 80 for HTTP and 443 for HTTPS; see HTTPS vs HTTP.
Common questions
- Can two devices share an IP? Not on the same network; it causes a conflict. Different networks can reuse private addresses.
- Why does my IP change? Your provider or router leased you a new dynamic address.
- Is IPv6 faster? Not by itself, but it removes address shortages and some NAT overhead.
Related topics
Read how web traffic is served in what a web server is and how clouds use private networks in AWS VPC networking.
