Address Count by Prefix

范围: /0 - /32

Total addresses: 256

Usable hosts: 254

Host bits: 8

Network bits: 24

About This Tool

The Address Count by Prefix calculator determines how many IP addresses are available in a network based on its CIDR prefix length. This tool supports both IPv4 (0-32 bits) and IPv6 (0-128 bits) and calculates the total number of addresses as well as usable host addresses for IPv4 networks. Understanding address counts is fundamental for IP address planning, subnet design, and ensuring adequate capacity for network growth.

How to Use

  1. Select the IP version (IPv4 or IPv6) from the dropdown menu
  2. Enter the CIDR prefix length (0-32 for IPv4, 0-128 for IPv6)
  3. View the calculated total addresses and network/host bit breakdown
  4. For IPv4, see both total addresses and usable host addresses (accounting for network and broadcast)
  5. Use the results for capacity planning and subnet sizing decisions

Features

  • Supports both IPv4 and IPv6 prefix calculations
  • Calculates total addresses for any valid prefix length
  • Shows usable host count for IPv4 (excluding network and broadcast addresses)
  • Displays network bits and host bits breakdown
  • Formatted numbers with thousands separators for readability
  • Real-time calculation as you adjust the prefix
  • Handles special cases like /31 and /32 networks correctly

Common Use Cases

  • Planning subnet sizes for network infrastructure
  • Determining if a subnet has enough capacity for expected growth
  • Calculating how many hosts can be assigned in a VLAN
  • Sizing cloud VPC subnets (AWS, Azure, GCP)
  • Estimating IPv6 address space for allocation planning
  • Comparing IPv4 and IPv6 capacity for migration planning
  • Validating subnet design meets organizational requirements
  • Learning the relationship between prefix length and address count

Technical Details

The number of addresses in a subnet is calculated using the formula: 2^(host bits), where host bits = total bits - prefix length.

IPv4 Address Counts (32-bit addresses):

  • /24 = 2^8 = 256 total addresses (254 usable hosts)
  • /25 = 2^7 = 128 total addresses (126 usable hosts)
  • /26 = 2^6 = 64 total addresses (62 usable hosts)
  • /27 = 2^5 = 32 total addresses (30 usable hosts)
  • /28 = 2^4 = 16 total addresses (14 usable hosts)
  • /30 = 2^2 = 4 total addresses (2 usable hosts, common for point-to-point)
  • /31 = 2^1 = 2 total addresses (2 usable, RFC 3021 point-to-point)
  • /32 = 2^0 = 1 address (single host)

IPv6 Address Counts (128-bit addresses):

  • /64 = 2^64 = 18,446,744,073,709,551,616 addresses (standard subnet size)
  • /56 = 2^72 = 4,722,366,482,869,645,213,696 addresses (home network allocation)
  • /48 = 2^80 = 1,208,925,819,614,629,174,706,176 addresses (site allocation)

Usable Hosts Calculation (IPv4 only):

For standard subnets (/1 through /30), usable hosts = total addresses - 2 (excluding network address and broadcast address). For /31 networks (RFC 3021), both addresses are usable for point-to-point links. For /32, there is only 1 address (host route).