Subnet Calculator / CIDR & IP Planner - Calculate Mask and Hosts | Federico Calò
Calculate network address, broadcast, subnet mask, wildcard mask, host range and host count for any IPv4 address and CIDR prefix (/0-32). Browser-side calculation only, no data sent to the server.
Configure
Result
No results
Insert an IPv4 address and prefix CIDR, then press Calculate.
Practical Guide to CIDR and IP Planning
Classless Inter-Domain Routing (CIDR) revolutionized IPv4 address management by replacing the rigid class-based system introduced in the 80s. With CIDR notation, every block of addresses is defined by an IP address and a prefix length in bits: for example, 192.168.1.0/24 indicates that the first 24 bits identify the network and the last 8 bits the hosts. This mechanism allows for arbitrary-sized subnets, reducing address waste and simplifying routing tables.
Choose your CIDR prefix wisely in an enterprise or cloud infrastructure, as it directly impacts network scalability and security. A /24 provides 254 hosts - ideal for office VLANs - while a /16 offers over 65,000 addresses for data centers. Selecting the correct prefix from design ensures future costly relocations are avoided and facilitates ACL and routing policy implementation.
The subnet calculator implements standard IPv4 math defined by RFC 791 and RFC 4632, including edge cases: /31 for point-to-point links (RFC 3021) and /32 for host routes. Private IP ranges (RFC 1918) are automatically detected. All calculations occur exclusively in the browser via native bitwise operations - no data is sent to a server and the tool functions offline.
Practical example: subnet 192.168.1.0/24
Entering 192.168.1.0 with prefix /24 gives:
- Network Address:
192.168.1.0- Watch Live
192.168.1.255- Mask:
255.255.255.0- Wildcard:
0.0.0.255- Range Host:
192.168.1.1 – 192.168.1.254- Available hosts
254
Vocabulary Dictionary
- Classless Inter-Domain Routing (CIDR)
- IPv4 address notation method that uses /n to indicate network bits, replacing the old class-based system (A/B/C). Defined by RFC 4632.
- Subnet Mask
- IP address subnet mask
- Wildcard Mask
- Bit complement of the subnet mask. Used in Cisco ACL and OSPF: bits set to 0 must match, bits set to 1 are ignored.
- Transmit
- Last address of the subnet, used to send a packet to all hosts in the segment simultaneously. Not assignable to devices.
- Private IP Ranges (RFC 1918)
- Three reserved IPv4 blocks for private, unrouteable networks on the internet: 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16.
Frequently Asked Questions
What is a CIDR and how does it work?
Classless Inter-Domain Routing (CIDR), defined by RFC 4632, is a method for allocating IP addresses and routing traffic more efficiently than the previous class-based division (A/B/C). CIDR notation adds a suffix "/n" to an IP address indicating how many bits are used for the network: /24 means that the first 24 bits identify the network and the last 8 identify hosts. This system allows for arbitrary-sized subnets, optimizing IPv4 address space usage.
How many hosts can a /24 subnet hold?
A /24 subnet contains 256 total addresses (2^8 = 256), but only 254 are usable for hosts. The first address (e.g., 192.168.1.0) is reserved as a network address, and the last (e.g., 192.168.1.255) is broadcast. The general formula for usable host addresses is 2^(32-prefix) - 2, valid for prefixes from /1 to /30. Exceptions: /31 allows 2 hosts usable (RFC 3021, point-to-point link), and /32 identifies a single host.
What is the difference between network address, broadcast, and host?
Every IPv4 subnet has three categories of addresses with distinct roles. The network address (first in the subnet) identifies the subnet in routing protocols and cannot be assigned to any host. The broadcast address (last in the subnet) is used to send a packet to all hosts on the subnet simultaneously; neither can be assigned to a host. All addresses between these extremes are usable, assignable to devices such as routers, servers, PCs, network printers.
What are private IP address ranges (RFC 1918)?
Private IPv4 address ranges are reserved by RFC 1918 for private networks (not routable on public Internet): 10.0.0.0/8 (10.0.0.0 – 10.255.255.255, Class A), 172.16.0.0/12 (172.16.0.0 – 172.31.255.255, Class B) and 192.168.0.0/16 (192.168.0.0 – 192.168.255.255, Class C). These ranges are used in home and office LAN networks with NAT to conserve public IP addresses. The tool indicates whether the inserted subnet falls within one of these private address ranges.
What is the wild card mask and what does it serve?
The wildcard mask (or inverse mask) is the logical complement of the subnet mask: where the subnet mask has 1, the wildcard has 0 and vice versa. For example, with a subnet mask of 255.255.255.0 corresponds to a wildcard of 0.0.0.255. Wildcard masks are used in Cisco router ACLs and OSPF to specify which addresses correspond to a rule: bits set to 0 must match exactly, while bits set to 1 are ignored.
Do calculations occur in the browser or on a server?
All calculations occur entirely within the browser, using standard bitwise JavaScript operations. No IP addresses inserted are sent to external servers. The tool does not require an internet connection to function after initial page loading.
How is it used?
- Insert your IP address
Enter an IPv4 address in dotted decimal format (e.g. 192.168.1.0). You can enter any subnet address - the tool will automatically calculate your network address by applying the mask.
- Choose a CIDR prefix
Select the prefix length (from /0 to /32) from the dropdown menu. The prefix determines how many bits are reserved for network identification: /24 = 255.255.255.0, /16 = 255.255.0.0, /8 = 255.0.0.0.
- Calculate Awards
The tool instantly calculates network address, broadcast, subnet mask, wildcard mask, usable host range and host count. All calculations happen in the browser - no data sent to the server.
- Interpret the result
Network address uniquely identifies the subnet. The broadcast is the last address (used for messages to all hosts). Hosts usable are all addresses between network + 1 and broadcast - 1 (excluding /31 and /32 which follow RFC 3021).
Do you need a custom analysis?
Network design, VLAN segmentation, firewall policies and custom network infrastructure - contact Federico for technical advice.