b2KIT

CIDR Calculator

Convert between CIDR notation and subnet masks with network range and host count calculations.

Tested tool guide Tested browser tools Checked August 15, 2026

What CIDR Calculator does, with a checked example

CIDR notation packs a network address and prefix length into one string, like 192.168.1.0/24, and this calculator expands that shorthand into the numbers you actually need: the dotted-decimal subnet mask, the network and broadcast addresses, the first and last usable host, and the total address count for the block. Enter either a CIDR string or an address paired with a mask and it converts between the two. The detail people trip over most: type a host address that isn't already the start of its block and the tool rounds down to the enclosing network rather than treating your address as special.

Worked example

A concrete input and expected output from the current implementation.

Input

10.20.30.40/27

Expected output

Network address: 10.20.30.32, Broadcast address: 10.20.30.63, Subnet mask: 255.255.255.224, Usable host range: 10.20.30.33 - 10.20.30.62, Total addresses: 32, Usable hosts: 30

A /27 leaves 5 host bits, so each block spans 32 addresses starting on multiples of 32; 40 falls between 32 and 63, so the tool reports that block's network (.32) and broadcast (.63), leaving 30 usable addresses in between.

How the result is produced

1

CIDR-to-mask conversion

The prefix length (the number after the slash) sets how many leading bits are network bits; the tool converts that count directly into a 32-bit subnet mask and its dotted-decimal form, and can also work backward, taking a mask like 255.255.255.224 and reporting the equivalent /27 prefix.

2

Network range and host count

It ANDs the entered address with the mask to find the network address, sets the host bits to all 1s for the broadcast address, and reports the addresses in between as the usable host range. Total addresses are 2^(32-prefix); usable hosts are normally that count minus 2 for the network and broadcast addresses.

Good uses

  • Planning how to split an office or cloud VPC address block into smaller subnets before assigning them to VLANs or teams.
  • Checking whether two IP addresses fall inside the same subnet by applying a given mask or prefix to both.
  • Translating a dotted-decimal subnet mask copied from a router or DHCP scope into its equivalent /prefix notation for documentation or firewall rules.

Limits and checks

  • /31 and /32 blocks don't follow the usual 'total minus 2' usable-host rule (RFC 3021 point-to-point links use both addresses in a /31; a /32 is a single-host route) - confirm the output makes sense for these two prefixes rather than assuming the general formula applies.
  • Entering a host address that isn't already the network address, such as 10.20.30.40/27, gets silently rounded down to the containing block (10.20.30.32/27); the output describes the subnet the address belongs to, not the specific address you typed.
  • This is built around standard IPv4 dotted-decimal notation and prefix lengths of /0 to /32; IPv6 prefix math uses different notation and bit-length rules, so don't assume the same input format or output fields apply there.

Common questions

I typed 10.20.30.40/27 and got a network address of 10.20.30.32 - is that a bug?

No. A /27 network starts every 32 addresses (0, 32, 64, 96...), so any address in that block is rounded down to its network boundary. 10.20.30.40 falls between .32 and .63, so .32 is the correct network address for that /27.

Does the usable host count already exclude the network and broadcast addresses?

For ordinary subnets (prefix /30 and shorter) yes, it subtracts both. /31 and /32 are special cases under RFC 3021 and single-host routing where that subtraction doesn't apply the normal way, so double-check the output for those two prefixes specifically rather than assuming minus-2 always holds.

References and verification

The example and behavioral notes were checked against the browser implementation. Standards and primary references below define the relevant format, formula, or platform behavior.

Related Tools