Subnet Calculator
Free web tool: Subnet Calculator
About Subnet Calculator
The Subnet Calculator takes an IPv4 address in CIDR notation (e.g. 192.168.1.0/24) or with a separate subnet mask (e.g. 192.168.1.0 255.255.255.0) and instantly computes the full set of network parameters: subnet mask, wildcard mask, network address, broadcast address, first usable host, last usable host, total address count, usable host count, IP address class (A/B/C/D/E), whether the address is private (RFC 1918), and the IP address in binary dotted notation.
Network administrators, IT students, DevOps engineers, and anyone configuring routers, firewalls, VLANs, or cloud VPCs use this tool to verify their addressing before deployment. CIDR planning is a critical skill for network segmentation — knowing exactly how many hosts fit in a /24 versus a /26, or whether a given address falls in the private 10.0.0.0/8, 172.16.0.0/12, or 192.168.0.0/16 ranges, prevents costly misconfiguration in production environments.
All calculations are performed using bitwise operations in JavaScript — the same operations a CPU performs when routing packets. The subnet mask is derived from the CIDR prefix length using a 32-bit left shift, the network address by ANDing the IP with the mask, and the broadcast address by ORing the network address with the wildcard mask. Ten common CIDR preset buttons (/8, /16, /20, /24, /25, /26, /27, /28, /30, /32) let you quickly explore how different prefix lengths affect the address space without retyping.
Key Features
- Accepts input as CIDR notation (192.168.1.0/24) or IP + subnet mask (192.168.1.0 255.255.255.0)
- Calculates subnet mask, wildcard mask, network address, and broadcast address using bitwise operations
- Shows first usable host, last usable host, total address count, and usable host count
- Identifies IP address class (A, B, C, D Multicast, E Reserved) from the first octet
- Detects private IP ranges: 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16 (RFC 1918)
- Displays the IP address in binary dotted notation (e.g. 11000000.10101000.00000001.00000000)
- Ten common CIDR preset buttons (/8 through /32) for fast exploration without retyping
- 100% client-side calculation using bitwise arithmetic — no server calls, instant results
Frequently Asked Questions
What is CIDR notation and how do I enter it?
CIDR (Classless Inter-Domain Routing) notation expresses an IP address and its network prefix together as `IP/prefix`. For example, `192.168.1.0/24` means the IP is 192.168.1.0 and the first 24 bits are the network portion (leaving 8 bits for hosts). Enter it exactly as `192.168.1.0/24` in the input field, or use a space-separated subnet mask like `192.168.1.0 255.255.255.0`.
How many usable hosts does a /24 subnet have?
A /24 subnet has 256 total addresses (2^8). Two are reserved — the network address (first) and broadcast address (last) — leaving 254 usable host addresses. Similarly, /25 = 126 hosts, /26 = 62 hosts, /27 = 30 hosts, /28 = 14 hosts, /29 = 6 hosts, /30 = 2 hosts. For /31 and /32, special rules apply: /31 has 2 addresses used as point-to-point links, /32 is a single host route.
What is the wildcard mask used for?
The wildcard mask is the bitwise inverse of the subnet mask. It is used in Cisco ACLs (Access Control Lists) and OSPF area configurations to specify which bits of an IP address must match and which can be any value. For a /24 subnet with mask 255.255.255.0, the wildcard mask is 0.0.0.255, meaning the first three octets must match exactly but the last octet can be anything.
How do I know if an IP address is private?
Private IP ranges defined by RFC 1918 are: 10.0.0.0–10.255.255.255 (10.0.0.0/8), 172.16.0.0–172.31.255.255 (172.16.0.0/12), and 192.168.0.0–192.168.255.255 (192.168.0.0/16). The calculator automatically detects if your input falls in one of these ranges and labels it as "Private IP". These addresses are not routable on the public internet.
What is the difference between network address and broadcast address?
The network address is the first address in the subnet (all host bits set to 0). It identifies the network itself and cannot be assigned to a device. The broadcast address is the last address in the subnet (all host bits set to 1). A packet sent to the broadcast address is delivered to all devices on the subnet. Both are reserved and not usable as host addresses.
How do I split a /24 into smaller subnets?
To split 192.168.1.0/24 into two equal halves, use /25: 192.168.1.0/25 (hosts .1–.126) and 192.168.1.128/25 (hosts .129–.254). To split into four /26 subnets: .0/26, .64/26, .128/26, .192/26. Each increment of 1 in the CIDR prefix halves the number of available hosts. Use the preset buttons to quickly calculate each sub-range.
What does IP binary notation show?
The binary representation shows each of the four octets of the IP address as 8-bit binary numbers separated by dots. For 192.168.1.1, the binary is 11000000.10101000.00000001.00000001. This helps visualize which bits are in the network portion (covered by the subnet mask) versus the host portion, which is fundamental to understanding how subnetting works at the bit level.
What are IP address classes and are they still relevant?
Classful IP addressing divided the address space into Class A (first octet 0–127, /8 default), Class B (128–191, /16 default), Class C (192–223, /24 default), Class D (224–239, multicast), and Class E (240–255, reserved). While classful routing is obsolete — replaced by CIDR in the 1990s — understanding IP class is still useful for recognizing address ranges and for exam purposes (CompTIA Network+, CCNA).