Subnet Calculator (CIDR)

Enter an IP address with a CIDR prefix to get the network address, broadcast address, usable host range, netmask and address count.

How to read the subnet calculator results

The tool parses a CIDR block (for example 192.168.1.0/24) and breaks it down into its parts: the network address, the broadcast address, the first and last usable host addresses, the subnet mask, the wildcard mask, the prefix length, the total number of addresses and the number of usable hosts. The network address is the first address in the range, the broadcast address is the last one, and everything in between can be assigned to servers and network devices.

The number of usable hosts is almost always two less than the number of addresses: one goes to the network address and one to broadcast. The exceptions are /31 and /32. A /31 network describes a point-to-point link with two addresses and no broadcast, while a /32 is a single address, such as one specific server in a firewall rule.

Common prefixes and their sizes

The larger the number after the slash, the smaller the subnet. A few reference values are handy for quick estimates:

PrefixMaskAddressesHosts
/24255.255.255.0256254
/25255.255.255.128128126
/26255.255.255.1926462
/30255.255.255.25242
/31255.255.255.25422
/32255.255.255.25511

Where you will use it

Subnet math comes up when writing firewall rules (allowing a whole range instead of individual IPs), configuring static routes, setting up private networks and VPCs at a cloud or VPS provider, and splitting a larger network into isolated segments. Knowing how many hosts fit into a /26 or /27 keeps you from allocating an oversized block to a small service segment, or running out of addresses where you need headroom.

Frequently asked questions

What is a wildcard mask?
It is the inverted subnet mask, with ones and zeros swapped. Network equipment uses it in access control lists and routing rules.
Why does a /24 have 254 usable hosts instead of 256?
Two of the 256 addresses are reserved: the first for the network address and the last for broadcast, which leaves 254 for devices.
What is a /31 used for?
It describes a point-to-point link between two nodes and uses both addresses as host addresses, with no separate broadcast.
What does /32 mean?
It is a single address, which is convenient in firewall rules or routes when you mean exactly one server.
How do I get the number of addresses from a prefix?
The number of addresses is 2 to the power of (32 minus the prefix): for a /26 that is 2 to the 6th, or 64 addresses.
Does a smaller subnet have a bigger or smaller prefix?
The bigger the number after the slash, the smaller the subnet: a /28 holds only 16 addresses, while a /24 holds 256.