Subnet Calculator

Work out an IPv4 subnet from IP and prefix.

Result

255.255.255.192
192.168.10.0
192.168.10.63
62

How it is calculated

An IPv4 address has 32 bits. The CIDR prefix /p says the first p bits identify the network and the remaining 32 − p bits identify the host. The netmask is p ones followed by zeros. The network address is IP AND mask (host bits set to 0), the broadcast address is the network address with all host bits set to 1, and usable hosts are 232 − p − 2, because the network and broadcast addresses cannot be given to devices. The tool needs four octets from 0 to 255 and a prefix from 0 to 32. For /31 and /32 it shows 0 hosts under this classic rule.

Worked example

Address 192.168.10.37 with prefix /26. Mask: 26 ones = 255.255.255.192. The last octet block size is 256 − 192 = 64, and 37 falls in the block 0–63. Network: 192.168.10.0. Broadcast: 192.168.10.63. Usable hosts: 26 − 2 = 62, from .1 to .62.

Try this example →

Common mistakes

  • Counting the network and broadcast addresses as usable hosts. A /26 holds 64 addresses but only 62 hosts.
  • Confusing the prefix with the number of hosts. A larger prefix like /30 means a smaller network.
  • Entering the mask (255.255.255.0) in the prefix field. Give the CIDR number, here 24.
  • Expecting the address you typed to be the network address. 192.168.10.37 is a host inside 192.168.10.0/26.
  • Assuming /31 has no use. Point-to-point links can use it, but this tool applies the classic count and shows 0.

About this calculator

This calculator works out an IPv4 subnet from an IP address and CIDR prefix length: it derives the subnet mask, the network address (IP bitwise-ANDed with the mask), the broadcast address (network address with all host bits set to 1), and the number of usable host addresses (2^(32−prefix) − 2, subtracting the network and broadcast addresses themselves).

Network engineers and system administrators use subnetting constantly when designing IP address plans — carving a larger network into smaller subnets for departments, VLANs, or cloud VPCs, sizing subnets to fit a known number of hosts without wasting address space, and configuring routers and firewalls.

Was this helpful?

You can pick up to 3 reactions.

Comments (1)

  • Editorial team

    The usable host count follows the classic rule, so /31 and /32 both show 0 hosts. In practice a /31 is used on point-to-point router links, where both addresses are assigned to the two ends, and a /32 identifies a single host or loopback. So read a zero as special-case sizing, not as an error. Are you planning a LAN, a VPN range or a router link?

Popular calculators

All Calculators