Run a full scan — every category, one report

IPv4 Subnet Calculator

Calculate network boundaries, usable host ranges, and broadcast addresses for IPv4 CIDR blocks.

About Subnetting and CIDR

CIDR (Classless Inter-Domain Routing) is a method used to allocate IP addresses and route IPv4 packets. Before CIDR, networks were strictly divided into Class A, B, and C sizes, which was highly inefficient.

CIDR allows variable-length subnet masks (VLSM). A CIDR block is written as an IP address followed by a slash and a routing prefix number (e.g., 192.168.1.0/24). The number /24 indicates that the first 24 bits of the IP address denote the network, leaving the remaining 8 bits to identify specific hosts within that network.

  • Network Address: The very first IP in the block, used to identify the network itself. Cannot be assigned to a host.
  • Broadcast Address: The last IP in the block, used to send data to all hosts simultaneously. Cannot be assigned to a host.
  • Usable Range: All addresses falling strictly between the Network and Broadcast addresses.

Our Subnet Calculator takes any IP address and prefix length and returns the network address, broadcast address, usable host range, subnet mask and total host count. It removes the binary arithmetic from network planning and firewall rule writing.

What is Subnetting?

Subnetting divides an IP address range into smaller networks. Every address has two parts — a network portion identifying the subnet, and a host portion identifying a device within it — and the prefix length determines where the boundary falls.

CIDR notation writes this as an address followed by a slash and the prefix length, such as 192.168.1.0/24. The /24 means the first 24 bits identify the network, leaving 8 bits for hosts, which gives 256 addresses of which 254 are usable.

Two addresses in each IPv4 subnet are reserved. The first is the network address identifying the subnet itself, and the last is the broadcast address reaching every host on it. Neither can be assigned to a device, which is why a /24 provides 254 usable addresses rather than 256.
  • Divides an address range into smaller networks
  • CIDR notation gives the prefix length after a slash
  • A shorter prefix means a larger network
  • The first and last addresses are reserved in IPv4
  • IPv6 subnetting follows the same logic without the reserved addresses

Why Subnet Calculation Matters

Subnet mistakes create both outages and security holes. A firewall rule written for the wrong prefix either blocks legitimate traffic or permits far more than intended — and a rule that is too permissive produces no error at all, so nobody notices.

The arithmetic is also error-prone at the boundaries people work with least. The difference between a /22 and a /23 is easy to state and easy to get wrong under pressure, and overlapping subnets discovered after deployment are expensive to renumber.
  • Firewall rules written for the wrong prefix silently over-permit
  • Overlapping subnets are painful to fix after deployment
  • Correct sizing prevents both address exhaustion and waste
  • Cloud VPC design depends entirely on getting CIDR blocks right
  • Prefix arithmetic is easy to get wrong and rarely validated

How This Subnet Calculator Works

The tool applies the prefix mask to the address and derives every boundary value.
  1. Validates the address and prefix length inputs
  2. Applies the prefix mask to determine the network address
  3. Calculates the broadcast address at the top of the range
  4. Derives the usable host range between those boundaries
  5. Reports the subnet mask, wildcard mask and total host count

How to Use the Subnet Calculator

  1. Enter an IP address with its prefix, such as 192.168.1.10/24
  2. Run the calculation to derive the subnet boundaries
  3. Review the network and broadcast addresses
  4. Note the usable host range for device assignment
  5. Use the subnet mask or wildcard mask in your device configuration

Understanding Your Subnet Results

The calculation returns every value you need for configuration:

Field / Value Meaning
Network address The first address in the range, identifying the subnet itself. It cannot be assigned to a host and is what appears in routing tables.
Broadcast address The last address in the range, reaching every host on the subnet. Also unassignable. IPv6 has no broadcast address, using multicast instead.
Usable range The addresses between network and broadcast that can be assigned to devices. For a /24 this is 254 addresses.
Subnet mask The dotted-decimal form of the prefix, such as 255.255.255.0 for a /24. Older equipment and many interfaces expect this rather than CIDR notation.
Wildcard mask The inverse of the subnet mask, such as 0.0.0.255. Used in Cisco access control lists and some routing protocol configurations.
Total hosts Two raised to the number of host bits, minus the two reserved addresses in IPv4. A /24 gives 254, a /25 gives 126, a /30 gives 2.
Prefix length How many bits identify the network. A smaller number means a larger subnet — a /16 contains 256 times as many addresses as a /24.

Common Problems & How to Fix Them

A prefix one bit shorter than intended doubles the address range. Writing /16 where /24 was meant permits 65,534 hosts rather than 254, and nothing reports an error.

Calculate the range before writing the rule and confirm the network and broadcast addresses match what you expect. Review existing rules for prefixes that look broader than the described purpose.

Two subnets sharing address space cause unpredictable routing, and the symptoms are intermittent and confusing.

Calculate the full range of every subnet before allocating, and maintain an address plan. Overlaps between on-premises ranges and cloud VPC blocks are a particularly common problem when connecting the two, because private ranges were chosen independently.

Growing a subnet in place is usually impossible without renumbering, because the adjacent space is already allocated.

Size with headroom from the start. A /24 is a reasonable default for most segments, and cloud VPCs are typically allocated a /16 to leave room for many subnets within it.

The address is probably the network or broadcast address of the subnet, neither of which can be assigned to a host.

Check the calculated usable range and choose an address within it. In a /24 such as 192.168.1.0/24, the assignable addresses are .1 through .254.

IPv6 conventions differ substantially. A /64 is the standard subnet size regardless of how few hosts it contains, because stateless address autoconfiguration requires exactly 64 host bits.

Do not subnet smaller than /64 for ordinary networks. Sites typically receive a /48 or /56 from their provider, giving many /64 subnets to allocate.

Best Practices

  • Calculate the range before writing any firewall or routing rule
  • Maintain a documented address plan to prevent overlaps
  • Size subnets with headroom, since growing them later means renumbering
  • Use /64 for IPv6 subnets regardless of host count
  • Check on-premises and cloud ranges do not overlap before connecting them
  • Use private ranges from RFC 1918 for internal networks
  • Record the purpose of each allocated subnet alongside its range

Security Recommendations

  • Verify firewall rule prefixes carefully, since an over-broad rule permits traffic silently with no error
  • Segment networks by function so a compromise in one segment does not reach others
  • Avoid excessively large flat subnets, which give an attacker a wide reachable range after initial access
  • Use the calculated range when writing allowlists rather than approximating
  • Document which subnet each service lives in to support incident response
  • Apply the same segmentation discipline to IPv6, where the vast address space encourages flat designs

Frequently Asked Questions

It is the CIDR prefix length — the first 24 bits identify the network, leaving 8 bits for hosts. That gives 256 addresses, of which 254 are usable after the network and broadcast addresses are reserved.

The first is the network address identifying the subnet itself, and the last is the broadcast address reaching every host. Neither can be assigned to a device. IPv6 has no broadcast address and so does not lose one this way.

Two raised to the number of host bits, minus two. A /24 gives 254, a /25 gives 126, a /26 gives 62, and a /30 gives 2 — the last being the conventional size for a point-to-point link.

A subnet mask marks the network bits as ones, such as 255.255.255.0. A wildcard mask is its inverse, 0.0.0.255, and is used in Cisco access control lists and some routing protocol configurations.

RFC 1918 defines 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16 for IPv4 private use. These are not routable on the public internet and are what you should use for internal networks.

Stateless address autoconfiguration requires exactly 64 host bits to work. Subnetting smaller than /64 breaks it. The address space is large enough that allocating a /64 to a segment with three hosts is not considered wasteful.

Rarely without renumbering, because adjacent address space is usually already allocated. This is why sizing with headroom from the start matters — expanding later means reconfiguring every device on the segment.