CIDR / Subnet Calculator
Calculate IPv4 subnet ranges and host counts from CIDR notation.
Binary Representation
11000000.10101000.00000001.0000000011111111.11111111.11111111.00000000Divide this network into smaller subnets by choosing a larger prefix.
4 subnets, 62 usable hosts each
| # | Network | First Host | Last Host | Broadcast | Usable |
|---|---|---|---|---|---|
| 1 | 192.168.1.0/26 | 192.168.1.1 | 192.168.1.62 | 192.168.1.63 | 62 |
| 2 | 192.168.1.64/26 | 192.168.1.65 | 192.168.1.126 | 192.168.1.127 | 62 |
| 3 | 192.168.1.128/26 | 192.168.1.129 | 192.168.1.190 | 192.168.1.191 | 62 |
| 4 | 192.168.1.192/26 | 192.168.1.193 | 192.168.1.254 | 192.168.1.255 | 62 |
How It Works
CIDR notation (Classless Inter-Domain Routing) expresses an IP address and its
network prefix in the form a.b.c.d/n. The prefix length n specifies
how many leading bits identify the network — the remaining 32 − n bits identify
individual hosts within that network.
The subnet mask is a 32-bit number with n ones followed by zeros
(e.g. /24 → 255.255.255.0). AND-ing any IP address with the mask
yields the network address; OR-ing with the inverted mask (the wildcard) yields
the broadcast address. All host addresses in between are usable — except the
first (network) and last (broadcast), which are reserved. A /31 or /32 is a special case per RFC 3021: all addresses are usable.
Private address ranges (RFC 1918) are never routed on the public internet: 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16. These
are commonly used behind NAT in home and enterprise networks. 127.0.0.0/8 is the
loopback range, 169.254.0.0/16 is link-local (APIPA), and 224.0.0.0/4 is reserved for multicast.
Subnetting divides a network by increasing the prefix length. Each additional
bit halves the address space: a /24 split into /26 yields 4 subnets
of 62 usable hosts each. This tool uses pure bitwise integer arithmetic — no external libraries.
Related Tools
Frequently Asked Questions
What is CIDR notation?
CIDR (Classless Inter-Domain Routing) notation expresses an IP address and its subnet mask as a single string: address/prefix-length. For example, 192.168.1.0/24 means a network where the first 24 bits are the network address and the remaining 8 bits (256 addresses) are host addresses.
How many hosts does a /24 subnet support?
A /24 subnet has 256 addresses (2^8). Two are reserved — the network address (first) and broadcast address (last) — leaving 254 usable host addresses. General formula: usable hosts = 2^(32 − prefix) − 2.
What are the private IP address ranges?
10.0.0.0/8 (16 million addresses), 172.16.0.0/12 (1 million addresses), and 192.168.0.0/16 (65,536 addresses). These are defined in RFC 1918 and are never routed on the public internet — they are used behind NAT in home and enterprise networks.
How do I split a network into subnets?
Increase the prefix length by the number of bits needed. To split a /24 into 4 subnets, add 2 bits → /26. Each /26 subnet has 64 addresses (62 usable). To split into 8 subnets, add 3 bits → /27 (32 addresses, 30 usable each).
What is the broadcast address?
The broadcast address is the last address in a subnet, where all host bits are 1. A packet sent to this address reaches all hosts on the subnet simultaneously. For 192.168.1.0/24, the broadcast address is 192.168.1.255.