Subnet Calculator
Enter any IPv4 address and prefix to get the network address, broadcast, usable host range, subnet mask, wildcard mask and binary breakdown. Then split the block into smaller subnets, or work backwards from the number of hosts you actually need.
- ✓ CIDR and dotted mask
- ✓ Binary view
- ✓ Subnet splitting
- ✓ Hosts → prefix
- ✓ RFC 1918 detection
Network
Enter four numbers from 0 to 255, separated by dots.
Jump to a common block
Split into smaller subnets
Size a subnet by hosts needed
Everything is computed locally in your browser using 32-bit integer maths. No address you type is sent anywhere, which matters when the subnet you are planning is real infrastructure.
What CIDR notation actually says
An address like 192.168.1.0/24 is two statements joined together. The first 24 bits identify the network, so every device on it shares 192.168.1. The remaining 8 bits identify the host, giving 256 addresses of which 254 can be assigned. Change the prefix and you are simply moving the boundary between those two halves.
2 ^ (32 − prefix)2 ^ (32 − prefix) − 2IP AND masknetwork OR NOT mask255.255.255.255 − mask2 ^ (new prefix − old prefix)Why this beats the usual subnet page
Binary you can actually read
The address is shown in binary with the network bits highlighted, so the prefix boundary stops being abstract. This is the part that makes subnetting click.
Splits the block for you
Pick a longer prefix and get the resulting child subnets listed with their network, broadcast and usable range — not just a count.
Works backwards from hosts
Enter the number of devices you need to support and get the smallest prefix that fits. That is the direction real network planning runs in.
Nothing leaves your browser
Pure client-side integer maths. No request is made with the address you type, which matters when you are planning production infrastructure.
Flags the special ranges
RFC 1918 private space, loopback, link-local and carrier-grade NAT are identified automatically instead of leaving you to remember the boundaries.
Handles the edge cases
/31 point-to-point links under RFC 3021 and /32 host routes are calculated correctly rather than returning a nonsensical negative host count.
How to use the subnet calculator
- Enter an address and prefix
Any address inside the block works — type 192.168.1.77/24 and it resolves to the 192.168.1.0 network. You do not need to know the network address in advance.
- Read the range
The usable host range is what you can hand out via DHCP or assign statically. The network and broadcast addresses sitting either side of it are not assignable.
- Split if you need to
Choose a longer prefix to carve the block into equal children. A /24 split at /26 gives four subnets of 62 usable hosts each.
- Or size from demand
Enter how many hosts a segment needs and take the prefix it returns. Leave headroom — a /26 sized exactly to 62 devices has nowhere to grow.
CIDR to subnet mask chart
Every IPv4 prefix with its dotted mask, total addresses and assignable hosts.
| CIDR | Subnet mask | Addresses | Usable hosts | Typical use |
|---|---|---|---|---|
| /8 | 255.0.0.0 | 16,777,216 | 16,777,214 | Legacy class A, 10.0.0.0/8 |
| /12 | 255.240.0.0 | 1,048,576 | 1,048,574 | 172.16.0.0/12 private space |
| /16 | 255.255.0.0 | 65,536 | 65,534 | Large campus, 192.168.0.0/16 |
| /20 | 255.255.240.0 | 4,096 | 4,094 | Large VPC or site block |
| /21 | 255.255.248.0 | 2,048 | 2,046 | Site aggregation |
| /22 | 255.255.252.0 | 1,024 | 1,022 | Four contiguous /24s |
| /23 | 255.255.254.0 | 512 | 510 | Large office floor |
| /24 | 255.255.255.0 | 256 | 254 | The standard LAN segment |
| /25 | 255.255.255.128 | 128 | 126 | Half a /24, VLAN split |
| /26 | 255.255.255.192 | 64 | 62 | Department or VLAN |
| /27 | 255.255.255.224 | 32 | 30 | Small office, DMZ |
| /28 | 255.255.255.240 | 16 | 14 | Server rack, small DMZ |
| /29 | 255.255.255.248 | 8 | 6 | Small block from an ISP |
| /30 | 255.255.255.252 | 4 | 2 | Classic point-to-point link |
| /31 | 255.255.255.254 | 2 | 2 | Point-to-point, RFC 3021 |
| /32 | 255.255.255.255 | 1 | 1 | Single host or loopback |
Reserved and private IPv4 ranges
Ranges that are not routable on the public internet, or are set aside for a specific purpose.
| Range | Prefix | Addresses | Purpose |
|---|---|---|---|
| 10.0.0.0 | /8 | 16,777,216 | Private network, RFC 1918 |
| 172.16.0.0 | /12 | 1,048,576 | Private network, RFC 1918 |
| 192.168.0.0 | /16 | 65,536 | Private network, RFC 1918 |
| 100.64.0.0 | /10 | 4,194,304 | Carrier-grade NAT, RFC 6598 |
| 127.0.0.0 | /8 | 16,777,216 | Loopback |
| 169.254.0.0 | /16 | 65,536 | Link-local, APIPA |
| 224.0.0.0 | /4 | 268,435,456 | Multicast, class D |
| 240.0.0.0 | /4 | 268,435,456 | Reserved, class E |
Planning habits worth keeping
- ✓Leave room to grow. Sizing a segment to exactly the device count you have today guarantees a renumbering project later. Take the next prefix up.
- ✓Align on bit boundaries. Subnets that start on clean boundaries summarise into a single route. Ad hoc ranges bloat routing tables.
- ✓Avoid 192.168.0.0/24 and 192.168.1.0/24 for VPN sites. Every home router uses them, and overlapping ranges break split tunnels.
- ✓Reserve the low addresses. Convention puts gateways and infrastructure at the bottom of the range and DHCP pools above them.
- ✓Use /31 on point-to-point links. A /30 wastes half its addresses on a network and broadcast neither router needs.
- ✓Document the plan. An IP allocation table costs an hour now and saves days during an incident.
Subnetting FAQs
How many usable hosts are in a /24?
254. A /24 contains 256 total addresses, and two are reserved: the first is the network address and the last is the broadcast address. That leaves 254 that can be assigned to devices. The general formula is 2 to the power of 32 minus the prefix, minus 2.
What is the subnet mask for /26?
255.255.255.192. A /26 uses 26 network bits, leaving 6 host bits for 64 total addresses and 62 usable hosts. Splitting a /24 at /26 produces exactly four subnets, ending in .0, .64, .128 and .192.
How do I calculate the network address?
Perform a bitwise AND between the IP address and the subnet mask. For 192.168.1.77 with a /24 mask, the first 24 bits are kept and the last 8 are zeroed, giving 192.168.1.0. The broadcast is the opposite operation: set every host bit to 1, giving 192.168.1.255.
What is a wildcard mask?
The bitwise inverse of the subnet mask, used by Cisco access lists and OSPF network statements. A /24 has a subnet mask of 255.255.255.0 and a wildcard mask of 0.0.0.255. A zero bit means the corresponding address bit must match, a one bit means it is ignored.
Why do you subtract 2 from the host count?
Because the all-zeros host address identifies the network itself and the all-ones address is the directed broadcast for that network. Neither can be assigned to an interface. The exceptions are /31, where RFC 3021 allows both addresses on a point-to-point link, and /32, which describes a single host.
What is the difference between /24 and 255.255.255.0?
Nothing — they are two notations for the same mask. CIDR counts the network bits, and 24 bits set to 1 written in dotted decimal is 255.255.255.0. CIDR is shorter and is what modern routing, cloud consoles and firewall rules use.
How many subnets do I get if I split a /16 into /24s?
256. The formula is 2 to the power of the difference between the prefixes, and 24 minus 16 is 8, giving 2 to the 8th. Each of those /24s carries 254 usable hosts, so the /16 supports 65,024 hosts once subnetted this way.
Which private IP range should I use?
10.0.0.0/8 gives the most room and is the usual choice for anything that might grow or connect to other networks. 172.16.0.0/12 is a good middle ground and is less commonly used, which reduces the risk of overlap during VPN or acquisition work. 192.168.0.0/16 is fine for home and very small offices but collides with consumer router defaults constantly.
Plan the block before you configure it
Enter an address, read the range, split it where you need to, and copy the numbers straight into your config.
Open the calculator →