Subnet Calculator

Enter any IPv4 address and CIDR prefix to get the network address, broadcast address, usable host range, subnet mask, wildcard mask and total host count.

/
Enter an IPv4 address and prefix length /0–/32, e.g. 192.168.1.0 / 24

Enter an IPv4 address and prefix length above to calculate subnet details.

⚡ Instant calculation
🔒 No data stored
✓ No sign-up needed

FAQs About Subnet Calculator

What is a subnet and what is CIDR notation?

A subnet (subnetwork) is a logical subdivision of an IP network. Subnetting divides a larger network into smaller, more manageable segments — improving security, performance, and address efficiency. CIDR (Classless Inter-Domain Routing) notation expresses both the IP address and the network prefix length in a compact format such as 192.168.1.0/24. The number after the slash tells you how many bits of the 32-bit IP address are fixed as the "network" portion; the remaining bits identify individual hosts within that subnet. A /24 means 24 network bits and 8 host bits, giving 256 total addresses (254 usable hosts). To look up which organisation owns any public IP address, use our IP Lookup tool.

What is the difference between the network address, broadcast address, and usable hosts?

Every subnet has three special address categories. The network address is the lowest address in the block — it identifies the subnet itself and cannot be assigned to a device. The broadcast address is the highest address in the block — traffic sent to it reaches every host on the subnet simultaneously, and it also cannot be assigned to a device. The usable host addresses are every address in between: the range from (network + 1) to (broadcast − 1). For a /24 subnet, that gives 254 usable addresses. For a /30 (commonly used for point-to-point links), there are only 2 usable addresses. /31 and /32 are special cases: /31 provides 2 addresses for point-to-point links with no broadcast, and /32 represents a single host.

How does the prefix length relate to the subnet mask?

The prefix length and the subnet mask are two ways of expressing the same information. A prefix of /24 corresponds to the subnet mask 255.255.255.0, because the first 24 bits of the 32-bit mask are all 1s and the remaining 8 bits are all 0s. A /16 corresponds to 255.255.0.0, and a /8 corresponds to 255.0.0.0. The wildcard mask is simply the bitwise inverse of the subnet mask — it is used in firewall access control lists and router configuration to specify which bits of an address are "don't care". For example, the wildcard mask for a /24 is 0.0.0.255. To check whether a specific port is open on a host within your subnet, use our Port Checker.

What is the difference between a public and private IP address?

Private IP address ranges are defined by RFC 1918 and are not routed on the public internet — they are used within homes, offices, and data centres. The three private ranges are 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16. Any IP address outside these ranges is a public IP address, routable across the global internet. This calculator automatically flags whether the network you enter is private or public. To see the public IP address your device is currently presenting to the internet, use our What Is My IP tool.

How do I calculate how many subnets I can create from a larger block?

To divide a network into smaller subnets, you borrow bits from the host portion of the address and add them to the network portion. The number of additional subnets created equals 2 raised to the power of the number of bits borrowed. For example, if you take a /24 network and borrow 2 bits to create /26 subnets, you get 2² = 4 subnets, each with 64 total addresses (62 usable hosts). To verify the routing and ASN for a block of IP addresses, use our ASN Lookup tool which shows all announced prefixes for any autonomous system.

What are /30, /31, and /32 subnets used for?

These small subnets have specific practical uses in networking. A /30 provides 4 total addresses and 2 usable hosts — ideal for point-to-point WAN links between routers where only two endpoints need addresses. A /31 (RFC 3021) is used on point-to-point links between routers in modern networks where the broadcast and network addresses are eliminated, providing exactly 2 addresses for the two endpoints. A /32 is a host route — a single IP address — used in routing tables to represent a specific host, a loopback address, or a virtual interface. When troubleshooting connectivity to a specific host, our Ping Test and Port Checker tools are useful companions.

What is a wildcard mask and how is it different from a subnet mask?

A subnet mask uses 1s to indicate the network portion of an address and 0s for the host portion. A wildcard mask does the opposite — it uses 0s where bits must match exactly and 1s where bits are "don't care". Wildcard masks are used extensively in Cisco IOS ACLs (access control lists) and OSPF area configuration to match a range of IP addresses. For example, to match all hosts in 10.0.0.0/8, you would use the wildcard mask 0.255.255.255. This calculator automatically derives the wildcard mask for every subnet you enter. To investigate what DNS records are associated with a host in your network, use our DNS Lookup tool.

What is a broadcast address and why can't it be assigned to a host?

The broadcast address is the last address in a subnet — all host bits set to 1. Traffic sent to the broadcast address is delivered to every device on the subnet simultaneously. Because it serves this special purpose, it cannot be assigned to any individual network device. The network address (all host bits set to 0) also cannot be used as a host address. These two reserved addresses are why the usable host count for any subnet is always total-addresses minus 2. To investigate whether a specific host address in your subnet is reachable and has its ports open, use our Port Checker and Ping Test tools.

How do I find the network address from a host IP like 172.0.0.1/12?

The network address is calculated by applying a bitwise AND between the host IP address and the subnet mask. For example, 172.0.0.1/12 has a subnet mask of 255.240.0.0. Applying the bitwise AND: 172 AND 255 = 172, 0 AND 240 = 0, 0 AND 0 = 0, 1 AND 0 = 0 — giving a network address of 172.0.0.0. This calculator accepts any host address within a subnet (not just the network address) and automatically derives the correct network address for you. The result will always show the canonical network address for the block, even if you entered a host address like 172.0.0.1. To look up the ASN and routing details for a public IP block, use our ASN Lookup tool.

More Network Tools