What is an IP address? IPv4 and IPv6 explained

The number every device on the internet uses to find every other device, the difference between IPv4 and IPv6, and public versus private addresses.

1–2 minutes
Coiled green network cable on a white background

An IP address is the number that identifies a device on a network, so data knows where to go. Every server, phone and laptop online has one. Domain names exist so people do not have to remember them; DNS turns names into IP addresses.

IPv4 and IPv6

IPv4IPv6
Looks like203.0.113.102001:db8:85a3::8a2e:370:7334
Length32 bits128 bits
How manyAbout 4.3 billionAbout 340 undecillion
DNS recordAAAAA

IPv4 ran out of new addresses years ago, which is why IPv6 exists. Most of the internet now runs both side by side. In an IPv6 address, :: stands for a run of zeros, so it can be written shorter.

Public and private addresses

Your home router has one public address that the internet sees. Devices behind it get private addresses, which are reused in millions of homes and never appear on the internet:

  • 10.0.0.0 to 10.255.255.255
  • 172.16.0.0 to 172.31.255.255
  • 192.168.0.0 to 192.168.255.255

The router translates between them, a process called NAT. A server meant to be reached from the internet needs a public address.

Static and dynamic

Home connections often get a dynamic public address that can change. Servers get a static address that stays the same, which is what DNS records point to.

Find yours

curl -4 ifconfig.me
curl -6 ifconfig.me
ip addr

The first two show the public addresses the internet sees (IPv4 and IPv6). ip addr on Linux (or ipconfig on Windows) lists the addresses on the machine’s own network cards.

What the slash means

You will see addresses like 203.0.113.0/24. The number after the slash says how many bits are the network part. A /24 covers 256 addresses (203.0.113.0 to 203.0.113.255); a single IPv4 address is a /32.

Something out of date? Software changes. If a step no longer works, tell us and we will check it and update the page.