IPv6 · Local calculator

IPv6 / IPv4 Comparison

Compare an IPv4 subnet with an IPv6 prefix from the same addressing plan. Putting their boundaries side by side shows why identical slash lengths, address counts and host conventions describe different things.

Inputs

Result

Address widths
32 and 128 bits
Calculated or matching entries
PropertyIPv4IPv6
Normalized prefix192.0.2.64/262001:db8::/64
Addresses6418446744073709551616
Bits after prefix664
Last address192.0.2.1272001:db8::ffff:ffff:ffff:ffff
Broadcast192.0.2.127None
In this guide12 sections

Introduction

Compare an IPv4 subnet with an IPv6 prefix from the same addressing plan. Putting their boundaries side by side shows why identical slash lengths, address counts and host conventions describe different things.

Formula and calculation

Address count for a prefix
addresses = 2^(address width − prefix length)

The calculator compares mathematical prefix sizes using a 32-bit IPv4 width and a 128-bit IPv6 width. Address count is distinct from assignable host count or operational reachability.

address width · 32 or 128 bits
fixed address length for the family
prefix length · bits
number of leading bits in the network prefix

Method and concepts

IPv4 has 32 positions and IPv6 has 128. In either family the count is two raised to the number of unfixed positions. Equal counts therefore require equal numbers of remaining bits. How a link uses the first and last positions depends on its protocol and configuration.

  1. Enter one IPv4 CIDR and one IPv6 CIDR. Each prefix is interpreted within its own address width.
  2. Compare the normalized networks, variable bits, address counts and last addresses. Read the broadcast row with the deployment convention in mind.

IPv6 addresses, prefixes and neighbors diagram

  1. 2001:db8:4a00:1200::/56
  2. 8 subnet bits · ab
  3. 2001:db8:4a00:12ab::/64
  4. Interface identifier · 42
The first byte of the fourth group stays 12. The next byte selects the child subnet. A final group of 42 is hexadecimal in this notation.

Worked examples

Compare two point-to-point prefixes

  1. An IPv4 interface uses 192.0.2.5/31. One bit varies, so the two values are 192.0.2.4 and 192.0.2.5. Both are endpoint positions on an RFC 3021 link.
  2. An IPv6 inter-router link uses 2001:db8::5/127. Again one bit varies, giving 2001:db8::4 and 2001:db8::5.
  3. Both counts are two. Neither example needs a directed broadcast. A change to /30 in the IPv4 field doubles its count while the IPv6 count stays two.

IPv6 addresses, prefixes and neighbors: Number subnet 171 in a documentation delegation

  1. Begin with 2001:db8:4a00:1200::/56. The fourth group covers the final eight prefix bits and the eight available subnet bits.
  2. Write decimal 171 as hex ab. Replacing the low byte 00 with ab gives 2001:db8:4a00:12ab::/64. The child index ranges from 0 through 255.
  3. Choose 2001:db8:4a00:12ab::42 as an example interface value. Expanding it gives 2001:0db8:4a00:12ab:0000:0000:0000:0042.

Reference table

IPv6 / IPv4 Comparison reference
PositionsIPv4 prefixIPv6 prefix
1/32/128
2/31/127
16/28/124
256/24/120

Reading the result

Comparisons describe allocation shapes. The tools do not establish an address mapping between the two protocols. An IPv4 /24 and an IPv6 /120 both span 256 positions, yet their operational use can be quite different.

Common mistakes

  • Comparing slash numbers by themselves. A /32 is one IPv4 address or an IPv6 prefix with 96 bits left.
  • Subtracting two from every IPv6 block to estimate hosts. IPv6 has no broadcast address and interface assignment has separate rules.

Frequently asked questions

Does the first IPv6 address always identify a router?

Some subnet conventions use an all-zero interface identifier for subnet-router anycast. Numeric membership alone does not tell you what a configured device does.

Can both families express one address as a route?

Yes. An IPv4 /32 and an IPv6 /128 each fix every address bit, yielding a host route.

Why might two links both show fe80::1?

A link-local value is meaningful within a particular link. Each interface can reach its own neighbor using the same spelling, provided the link is specified.

Does an IPv6 router split an oversized packet into fragments?

IPv6 fragmentation is performed by the source. A forwarding router that cannot fit a packet on its outgoing link sends ICMPv6 Packet Too Big feedback, subject to protocol rules.

Can one IPv6 address be compressed in more than one way?

Yes. Leading zeroes in a hextet can be omitted, and one longest run of all-zero hextets can be replaced by ::. Using :: more than once would make the expanded length ambiguous.

Why does an IPv6 link-local address need an interface identifier on some systems?

Link-local scope is limited to one link, and the same address value can exist on several interfaces. A zone or interface name tells the system which link to use.

Does every IPv6 subnet use a /64?

Many ordinary SLAAC LAN designs use /64, but not every prefix in every role is /64. Follow the addressing plan and protocol requirements for the link.

Why are IPv6 addresses enclosed in brackets in a URL?

Colons are part of IPv6 notation and also separate a URL host from its port. Brackets make the address boundary unambiguous, for example https://[2001:db8::1]:8443/.

Does IPv6 have broadcast addresses?

No. IPv6 uses multicast for group delivery and anycast for selected one-to-nearest service behavior; it does not use IPv4-style broadcast.

Can an IPv6 interface have multiple addresses?

Yes. An interface can hold link-local, global, temporary, and other scoped addresses at the same time, depending on its configuration and network advertisements.

What is the role of a link-local IPv6 address?

It enables communication on the local link, including neighbor discovery and many router interactions. Routers do not forward link-local traffic to another link.

Does a compressed IPv6 address preserve leading zeroes?

The notation omits leading zeroes within hextets and may compress one longest zero run. Expanding the address restores a fixed eight-hextet value without changing its bits.

What is an IPv6 unique local address?

Unique local addresses come from fc00::/7 and are intended for local communication. They are not guaranteed to be globally routed, though they are designed to be locally unique when generated correctly.

Why use 2001:db8:: in examples?

The 2001:db8::/32 prefix is reserved for documentation. It avoids presenting a live public allocation as a fictional example.

Does IPv6 require NAT for address conservation?

IPv6's address space is designed to provide abundant addresses, so ordinary deployments do not need NAT for conservation in the same way IPv4 often does. Firewalls and routing policy still control access.

What is Duplicate Address Detection?

IPv6 Neighbor Discovery uses Duplicate Address Detection to check whether an address is already in use on a link before an interface begins using it.

Can an IPv6 subnet include a broadcast address?

No. IPv6 uses multicast rather than broadcast. A prefix calculator can still show its numeric first and last address values, but that does not create an IPv4-style broadcast role.

Further learning and references