IPv4 Subnet Calculator (CIDR, Mask, Range)

Type an IPv4 address with CIDR (192.168.1.0/24) and get the network address, broadcast address, usable host range, host count, and the corresponding subnet mask. Reverse: enter a dotted mask (255.255.255.0) and get the CIDR.

How to use the IPv4 Subnet Calculator (CIDR, Mask, Range)

Enter an IPv4 address with a CIDR suffix such as 192.168.1.50/24. You get the network and broadcast addresses, the usable host range, the host count, and the dotted subnet mask. Enter a dotted mask instead to get the matching CIDR back.

Working out a subnet from IP and prefix

A subnet mask or CIDR prefix splits an IPv4 address into a network part and a host part. From that split everything else follows: the network address has all host bits set to zero, the broadcast address has them all set to one, the usable host count is two to the power of the host bits minus two, and the dotted mask is just the prefix written out. Doing this arithmetic in binary by hand is slow and easy to get wrong.

Enter an address with its prefix and this returns the network and broadcast addresses, the usable host range, the host count, and the mask — or give it a dotted mask to get the CIDR. To convert a whole block to its first and last IP or summarise a range, use the CIDR to range converter; to validate or classify a single address, the IP address tools.

Common use cases

  • Subnet planning — size a network and see its host capacity.
  • Firewall and ACL rules — confirm the network and broadcast boundaries.
  • Host counting — check how many usable addresses a prefix gives.
  • Mask conversion — translate a dotted mask to and from CIDR.
  • Troubleshooting — verify an address actually falls in the intended subnet.

Frequently asked questions

Why subtract two from the host count?

The network address and the broadcast address are reserved and not assignable to hosts, so usable hosts are two fewer than the total addresses.

What is the broadcast address?

The address with all host bits set to one; traffic sent to it reaches every host on the subnet.

How are /31 and /32 handled?

A /32 is a single host and a /31 is a two-address point-to-point link, both special cases where the usual minus-two rule does not apply.

Can I work from a dotted mask?

Yes. Enter a mask like 255.255.255.0 and the tool returns the equivalent CIDR prefix.
Embed this tool on your site

Free to embed, no attribution required (but appreciated). Paste this where you want the tool to appear: