An IPv4 address has four numbers, and an IPv6 address has eight groups of numbers. That is the short answer, but the count depends on which version of the protocol you mean, and the two versions are so different that it helps to look at each one separately.

IPv4: Four Numbers, 32 Bits

An IPv4 address is written as four decimal numbers separated by dots, such as 192.168.1.1. Each of those four numbers is called an octet because it represents 8 bits, and the four octets together make 32 bits. Each octet can hold a value from 0 to 255, which gives 256 possible values per position.

Do the arithmetic and you get 256 × 256 × 256 × 256, or about 4.3 billion unique addresses. That number seemed enormous when IPv4 was designed, but it is now exhausted in most regions, which is why IPv6 exists.

A common misconception is that the four numbers must each be under 100 or that they are always three digits. They can be one, two or three digits, and leading zeros are usually dropped. 10.0.0.1 is a valid address, and so is 172.16.254.1. The dots are separators, not decimal points, so 192.168.1.1 is four separate numbers, not one number with decimal places.

IPv6: Eight Groups, 128 Bits

An IPv6 address is written as eight groups of four hexadecimal digits separated by colons, such as 2001:0db8:85a3:0000:0000:8a2e:0370:7334. Each group represents 16 bits, and eight groups make 128 bits. That is four times the bit width of IPv4, which works out to about 340 undecillion addresses — a number with 39 digits.

Hexadecimal means each digit can be 0 through 9 or a through f, so each group has 16 possible values per position and four positions per group. That gives 65,536 possible values per group, and eight groups multiply out to the full 128-bit space.

IPv6 has two shorthand rules that change how many groups you actually see written down. You can drop leading zeros within any group, so 0db8 becomes db8 and 0000 becomes 0. You can also replace one run of consecutive all-zero groups with a double colon, so 2001:0db8:0000:0000:0000:0000:0000:0001 can be written as 2001:db8::1. The double colon can appear only once in an address, because otherwise the expanded form would be ambiguous.

Counting the Numbers in Practice

If someone asks how many numbers an IP address has, the honest answer is: four for IPv4 and eight for IPv6, counting the dot-separated or colon-separated groups. The digits inside each group are not what you count — you count the groups.

Here is a quick reference for common cases:

  • IPv4 address: 4 numbers, each 0–255, separated by dots.
  • IPv4 with CIDR suffix: still 4 numbers, plus a slash and a prefix length such as /24.
  • IPv6 full form: 8 groups of up to 4 hex digits, separated by colons.
  • IPv6 compressed form: fewer visible groups because of the double-colon rule, but the underlying address still has 8 groups.
  • IPv4-mapped IPv6 address: written as ::ffff:192.168.1.1, which mixes the two notations but still represents a 128-bit IPv6 address.

A practical rule of thumb: if you see dots, count four; if you see colons, count eight, even if the double colon hides some of them. If you are reading a subnet mask like 255.255.255.0, that is also four numbers, but it is a mask, not an address.

Subnet Masks and Prefix Lengths

A subnet mask in IPv4 is written the same way as an address — four dot-separated numbers — but its job is different. It tells you which part of an address identifies the network and which part identifies the host. A mask of 255.255.255.0 means the first three octets are the network and the last octet is the host, giving 256 addresses on that subnet.

The slash notation, such as /24, is a shorthand for the same idea: it says the first 24 bits are the network prefix. Since each octet is 8 bits, /24 corresponds to three full octets, which is why 255.255.255.0 and /24 describe the same mask. A /16 mask is 255.255.0.0, and a /8 mask is 255.0.0.0.

IPv6 uses the same slash idea but with much larger numbers: a typical home or small-office prefix is /64, meaning the first 64 bits identify the network and the remaining 64 bits identify the host. That leaves an enormous number of addresses per subnet, which is why IPv6 subnets are usually written as a single /64 rather than carved into smaller pieces.

Reading an Address Correctly

When you look at an address, check the separator first. Dots mean IPv4 and four numbers. Colons mean IPv6 and eight groups. If you see both, as in ::ffff:192.168.1.1, the address is IPv6 in a mixed notation, and the dotted part is a compressed way of writing the last 32 bits.

Watch for these signs that you are miscounting:

  • You counted digits instead of groups. 192.168.1.1 has 10 digits but 4 numbers.
  • You treated a subnet mask as an address. 255.255.255.0 is a mask, not a host address.
  • You forgot the double colon in IPv6. 2001:db8::1 still has eight groups; the :: stands in for the missing zeros.
  • You assumed every group in IPv6 is four digits. Leading zeros are dropped, so a group can be as short as one digit.

The correct fact to hold onto: the count is about groups, not digits, and the version of the protocol decides whether the count is four or eight. If you need to confirm an address on a device, open the network settings and look at the connection details; the labels for IPv4 and IPv6 addresses are usually shown separately, and the exact menu path can differ by operating system and version.