CIDR Subnet Calculator

Computes an IPv4 CIDR block's network address, broadcast address, usable host range, total and usable host counts, and subnet mask, and can split the block into child subnets at a target prefix length. A free online tool from Staaarter, right in your browser.

Runs locallyUpdated 2026-07-25

Overview

Introduction

Working out a CIDR block's network address, broadcast address, and usable host range by hand means converting octets to binary and masking bits manually, error-prone even for a simple /24.

This tool does that arithmetic directly, and can also split a block into smaller child subnets at a target prefix length, entirely in your browser.

What Is CIDR Subnet Calculator?

An IPv4 CIDR calculator that reports a block's network address, broadcast address, subnet mask, usable host range, and total/usable host counts.

It's part of this site's Network Tools collection; when given an optional target prefix length longer than the source block's, it also lists every resulting child subnet up to a 256-subnet display cap.

How CIDR Subnet Calculator Works

The entered address and prefix length are parsed into a 32-bit integer and a bitmask; the network address is the address ANDed with the mask, and the broadcast address is the network address ORed with the mask's complement.

Usable hosts follow the standard convention: for /30 and shorter prefixes, the first and last addresses (network and broadcast) are excluded from the usable range; /31 treats both addresses as usable per RFC 3021, and /32 is a single address. When a split prefix is given, the same math repeats for each equally-sized child block within the original range.

When To Use CIDR Subnet Calculator

Use it when planning how to carve a larger allocated block into smaller subnets for different network segments, VLANs, or environments.

It's also useful for quickly checking exactly which addresses a given CIDR notation actually covers, before writing a firewall rule or allow list against it.

Features

Advantages

  • Reports every commonly needed value (network, broadcast, mask, usable range, host counts) from a single CIDR input in one pass.
  • Optionally splits a block into child subnets at any valid target prefix, without needing a separate subnetting calculation.
  • Detects and clearly explains when a host address (rather than the network address) was entered.

Limitations

  • IPv4 only; IPv6 CIDR blocks are detected and rejected with an explanatory note rather than computed.
  • The subnet-splitting feature caps output at 256 child subnets to keep results readable; extremely large splits need to be done in smaller batches.

Examples

Calculating a standard /24 block

Input

10.0.0.0/24

Output

Network address: 10.0.0.0
Broadcast address: 10.0.0.255
Usable host range: 10.0.1 - 10.0.0.254
Usable hosts: 254

A /24 reserves the first address (network) and last (broadcast), leaving 254 usable host addresses out of 256 total.

Splitting a /24 into four /26 subnets

Input

cidr: 192.168.1.0/24, splitPrefix: 26

Output

192.168.1.0/26, 192.168.1.64/26, 192.168.1.128/26, 192.168.1.192/26

Moving from a /24 to a /26 adds 2 bits to the prefix, producing 2^2 = 4 equally sized child subnets of 64 addresses each.

Best Practices & Notes

Best Practices

  • Plan subnet sizes around actual host counts plus reasonable headroom for growth, rather than defaulting to /24 for every segment.
  • Remember that /31 and /32 have special usable-host semantics (point-to-point links and single hosts respectively) that don't follow the standard network/broadcast exclusion rule.
  • When splitting a block, confirm the resulting subnet count and size actually match your network plan before committing the addressing scheme to configuration.

Developer Notes

All arithmetic is done on 32-bit unsigned integers using bitwise operators with `>>> 0` to keep values unsigned in JavaScript's 32-bit bitwise operation semantics; the mask for a /0 prefix is special-cased to 0 since `0xffffffff << 32` is undefined behavior for a 32-bit shift in JavaScript.

CIDR Subnet Calculator Use Cases

  • Planning how to divide an allocated IP block into subnets for separate VLANs or environments
  • Verifying the usable host range of a subnet before assigning static IPs within it
  • Checking whether two CIDR blocks overlap by comparing their computed network/broadcast ranges

Common Mistakes

  • Assuming a /24 always has 256 usable hosts; it has 254 usable hosts once the network and broadcast addresses are excluded.
  • Choosing a split prefix that's shorter (a smaller number) than the source prefix, which doesn't produce smaller subnets and is rejected as invalid input.

Tips

  • If you only need to double-check that an IP falls within a given range, compare it against the reported network and broadcast addresses directly rather than eyeballing the CIDR notation.

References

Frequently Asked Questions