Ipcidrsubnet Calculator
Calculate subnet details from IP address and CIDR notation. Get network address, broadcast address, usable host range, subnet mask, and wildcard mask
Ipcidrsubnet Calculator
Calculator
Adjust values & calculateEnter your values below. Every result is computed in your browser โ no data is sent to any server.
Formula: Usable Hosts = 2^(32-CIDR) - 2 | Network = IP AND Mask | Broadcast = Network OR Wildcard
Worked example โ Network: 192.168.1.0/24 | 254 usable hosts | Class C Private
Formula
Usable Hosts = 2^(32-CIDR) - 2 | Network = IP AND Mask | Broadcast = Network OR Wildcard
The subnet mask is derived from the CIDR prefix length. Network address is the bitwise AND of the IP and mask. Broadcast address is the network address OR-ed with the wildcard mask (inverse of subnet mask). Usable hosts exclude the network and broadcast addresses.
Worked Examples
Example 1: Standard Office Network (/24)
Problem:Calculate subnet details for the network 192.168.1.0/24.
Solution:Subnet Mask: 255.255.255.0 Network Address: 192.168.1.0 Broadcast Address: 192.168.1.255 First Usable Host: 192.168.1.1 Last Usable Host: 192.168.1.254 Total Addresses: 256 Usable Hosts: 254
Result:Network: 192.168.1.0/24 | 254 usable hosts | Class C Private
Example 2: Small Department Subnet (/28)
Problem:A department needs 10 devices. Calculate subnet details for 10.0.1.0/28.
Solution:Subnet Mask: 255.255.255.240 Network Address: 10.0.1.0 Broadcast Address: 10.0.1.15 First Host: 10.0.1.1 Last Host: 10.0.1.14 Total Addresses: 16 Usable Hosts: 14 /28 provides 14 usable hosts, sufficient for 10 devices with room for 4 more.
Result:Network: 10.0.1.0/28 | 14 usable hosts | Class A Private
Frequently Asked Questions
What is CIDR notation and how does it relate to subnet masks?
CIDR (Classless Inter-Domain Routing) notation is a compact method for specifying IP addresses and their associated network prefixes. Written as an IP address followed by a forward slash and a number (for example 192.168.1.0/24), the number after the slash indicates how many bits of the 32-bit IP address represent the network portion. A /24 means the first 24 bits are the network portion and the remaining 8 bits are for host addresses. This directly corresponds to a subnet mask: /24 equals 255.255.255.0, /16 equals 255.255.0.0, and /8 equals 255.0.0.0. CIDR replaced the older classful addressing system (Class A, B, C) and allows for more flexible allocation of IP address space, reducing waste and enabling route aggregation in Internet routing tables.
How do you calculate the number of usable hosts in a subnet?
The number of usable host addresses in a subnet is calculated by the formula 2 raised to the power of the host bits minus 2. The host bits equal 32 minus the CIDR prefix length. Two addresses are subtracted because the first address in any subnet is reserved as the network address (all host bits set to 0) and the last address is reserved as the broadcast address (all host bits set to 1). For example, a /24 subnet has 32 minus 24 equals 8 host bits, yielding 2 to the 8th power minus 2 equals 254 usable host addresses. A /28 subnet has 4 host bits giving 2 to the 4th minus 2 equals 14 usable hosts. The special cases are /31 (point-to-point links, 2 addresses per RFC 3021) and /32 (single host address).
What is the difference between network address, broadcast address, and host addresses?
In any IP subnet, three types of addresses serve distinct purposes. The network address is the first address in the subnet where all host bits are zero, identifying the subnet itself and used in routing tables. It cannot be assigned to any device. The broadcast address is the last address where all host bits are one, used to send data to all hosts within the subnet simultaneously. It also cannot be assigned to individual devices. Host addresses are all addresses between the network and broadcast addresses that can be assigned to individual devices such as computers, printers, servers, and routers. For the subnet 192.168.1.0/24, the network address is 192.168.1.0, the broadcast is 192.168.1.255, and usable hosts range from 192.168.1.1 through 192.168.1.254 giving 254 assignable addresses.
How do I determine the right subnet size for my network?
Choosing the correct subnet size requires counting the number of devices that need IP addresses and then selecting the smallest subnet that accommodates them with room for growth. Start by counting all devices including computers, phones, printers, servers, IoT devices, and network infrastructure like switches and access points. Add 20 to 50 percent for future growth. Then find the smallest power of 2 that exceeds your total device count plus 2 (for network and broadcast addresses). For 50 devices, you need at least 52 addresses, so a /26 subnet providing 62 usable hosts is appropriate. For 200 devices, a /24 with 254 hosts works well. Over-sizing wastes address space especially with public IPs, while under-sizing requires painful renumbering later. It is generally better to slightly oversize than to undersize.
What are private IP address ranges and when should they be used?
Private IP address ranges are blocks of addresses reserved by RFC 1918 for use within private networks that do not need to be globally unique on the Internet. The three private ranges are: 10.0.0.0 to 10.255.255.255 (10.0.0.0/8) providing over 16 million addresses, 172.16.0.0 to 172.31.255.255 (172.16.0.0/12) providing about 1 million addresses, and 192.168.0.0 to 192.168.255.255 (192.168.0.0/16) providing about 65,000 addresses. Private addresses should be used for all internal network devices that do not require direct Internet accessibility. Devices using private addresses connect to the Internet through Network Address Translation (NAT) on a router or firewall. This conserves the limited supply of public IPv4 addresses and adds a layer of security by hiding internal network structure from the outside world.
What is the wildcard mask for, if it is only the inverse of the subnet mask?
A wildcard mask reverses the meaning of the bits: a zero marks a position that must match and a one marks a position to ignore. Cisco IOS access control lists and OSPF network statements are written this way, so the /24 mask 255.255.255.0 appears as wildcard 0.0.0.255. A wildcard also does not have to be contiguous, which lets it express patterns no subnet mask can - matching 10.0.1.0 with wildcard 0.0.254.255, for instance, selects only odd-numbered third octets.
When should a router link use a /31 instead of a /30?
A /30 supplies four addresses of which only two are assignable, spending the network and broadcast entries on a link that will never hold more than two interfaces. RFC 3021 defines /31 for exactly this case: both addresses are usable and there is no broadcast, because a point-to-point link does not need one. Use /31 wherever both ends support it, which modern router platforms generally do, and keep /30 for legacy equipment. Across a large network it halves the space consumed by interconnects.
What is VLSM, and in what order should the subnets be allocated?
Variable Length Subnet Masking means carving one block into subnets of differing sizes rather than splitting it evenly. Allocate the largest requirement first, because every subnet must begin on a boundary that is a multiple of its own size. Dividing 192.168.1.0/24 for groups of 100, 50, 20 and 20 hosts yields 192.168.1.0/25, then 192.168.1.128/26, then 192.168.1.192/27 and 192.168.1.224/27. Starting with the small groups instead leaves the remaining space too fragmented for the large one.
How does route summarisation combine several subnets into one advertisement?
Summarisation shortens the prefix so a single route covers a contiguous, correctly aligned range. Four consecutive /24 networks from 192.168.4.0 through 192.168.7.0 share their first 22 bits and therefore aggregate to 192.168.4.0/22. Alignment is the constraint: the base address must be a multiple of the block size, so 192.168.5.0 through 192.168.8.0 cannot be expressed as one /22 no matter how contiguous it looks. Allocating address space in aligned blocks from the outset keeps routing tables small.
How does a host decide whether a destination is on its own subnet?
It ANDs its own address with its subnet mask, ANDs the destination address with the same mask, and compares the two results. Identical results mean the destination is local, so the host resolves it with ARP and sends the frame directly; different results mean the packet is handed to the default gateway. This is why a mismatched mask breaks reachability asymmetrically: a host configured /24 beside a neighbour configured /25 may treat that neighbour as local while the neighbour replies via its gateway.
References
Background & Theory
History
Reviewed for accuracy by Daniel Agrici, Founder & Lead Developer ยท Editorial policy
Related Calculators
๐งฎBandwidth Time Transfer Calculator
Calculate bandwidth time transfer with inputs, formulas, and instant results.
๐งฎDownload Time Calculator
Calculate download time with inputs, formulas, and instant results.
๐งฎThroughput Efficiency Calculator
Calculate throughput efficiency with inputs, formulas, and instant results.
๐งฎBase64 Encode & Decode Calculator
Calculate base64encode decode with inputs, formulas, and instant results.
๐งฎHash Checksum Calculator
Calculate hash checksum with inputs, formulas, and instant results.
๐งฎUrlpercent Encoding Calculator
Calculate urlpercent encoding with inputs, formulas, and instant results.