ip address prefix calculator

Use this IPv4 CIDR tool to calculate network details from an IP address and prefix length.

Try examples:

Enter an IPv4 address and prefix, then click Calculate Prefix Details.

What is an IP address prefix calculator?

An IP address prefix calculator helps you translate CIDR notation (like /24 or /30) into meaningful network values: subnet mask, network address, broadcast address, usable host range, and host count. If you work in network administration, cloud architecture, security, or software deployment, these calculations are part of daily life.

While experienced engineers can do this quickly by hand, a calculator reduces errors and saves time—especially when handling many subnets across VLANs, VPNs, containers, or infrastructure-as-code templates.

CIDR in plain language

CIDR stands for Classless Inter-Domain Routing. It replaced rigid class-based networking with flexible prefix-based subnetting. Instead of saying “Class C,” we define exactly how many bits are network bits.

  • /24 means 24 bits are network bits, leaving 8 bits for hosts.
  • /16 leaves 16 bits for hosts.
  • /30 leaves only 2 host bits (great for point-to-point links).
  • /32 represents exactly one address.

For IPv4, there are 32 bits total. Prefix length tells you how those 32 bits are split between network and host portions.

How this calculator works

1) Convert IP to binary/integer form

The dotted-decimal IP (for example, 192.168.1.34) is converted into a 32-bit number. This makes bitwise math possible.

2) Build subnet mask from prefix

A prefix like /24 creates a mask with 24 ones followed by 8 zeros:

11111111.11111111.11111111.00000000 = 255.255.255.0

3) Compute network and broadcast

  • Network address = IP AND subnet mask
  • Broadcast address = Network OR wildcard mask

4) Determine host range

For most subnets, first usable host is network + 1 and last usable host is broadcast - 1. Special cases exist for /31 and /32 and are handled in this calculator.

Understanding key outputs

Subnet mask

The dotted-decimal form of the prefix. For example, /26 corresponds to 255.255.255.192.

Wildcard mask

Inverse of subnet mask. Often used in ACLs. For /24, wildcard is 0.0.0.255.

Total addresses vs usable hosts

Total addresses includes network and broadcast (except conceptual nuances for /31 and /32). Usable host count reflects practical addressing for devices.

Address type

The calculator also labels common ranges such as private (RFC 1918), loopback, link-local, multicast, or public/documentation ranges. This helps with quick sanity checks in troubleshooting.

Real-world subnet examples

Example A: 192.168.1.34/24

  • Network: 192.168.1.0
  • Broadcast: 192.168.1.255
  • Usable range: 192.168.1.1 to 192.168.1.254
  • Usable hosts: 254

Example B: 10.4.6.129/25

  • Mask: 255.255.255.128
  • Subnets split into blocks of 128 addresses
  • 129 belongs to the 10.4.6.128/25 network

Example C: 172.16.8.3/30

  • Block size: 4 addresses
  • Commonly used on point-to-point links
  • 2 usable hosts in traditional interpretation

Common mistakes this tool helps avoid

  • Mixing up subnet mask and wildcard mask
  • Assuming every network has 254 usable hosts
  • Forgetting /31 and /32 behavior
  • Assigning hosts outside the valid subnet range
  • Using public space when private ranges are required

Tips for better IP planning

  • Use consistent subnet sizes by role (users, servers, transit links).
  • Reserve growth space so you can expand without renumbering.
  • Document intent: VLAN ID, gateway, DHCP range, and security policy.
  • Automate validation in CI/CD for network configs.

Final thoughts

A reliable IP prefix calculator is one of those simple tools that prevents expensive mistakes. Whether you’re designing enterprise LANs, segmenting cloud networks, or troubleshooting routing policies, fast and accurate CIDR math is foundational. Use the calculator above whenever you need quick, precise subnet details.

🔗 Related Calculators