🧮
Every IPv4 detail
Network, broadcast, hosts, mask, wildcard, class, type, binary with highlighted network bits, hex and reverse DNS.
🧩
VLSM planner
Enter host counts per department and get an efficient, back-to-back allocation with waste and efficiency stats.
🌐
IPv6 ready
Expand, compress, find the network and split any IPv6 prefix with exact 128-bit math.
🔗
Range ↔ CIDR
Turn an arbitrary IP range into the minimal CIDR list, check membership and summarize routes.
What is subnetting and how does CIDR work?
An IPv4 address is 32 bits, usually written as four decimal octets such as 192.168.1.10. Subnetting splits those 32 bits into a network part (shared by every device in the subnet) and a host part (unique to each device). CIDR notation – the /26 after an address – states how many leading bits belong to the network. The remaining 32 − 26 = 6 bits identify hosts, so the block holds 26 = 64 addresses.
Two of those addresses are reserved: the first (all host bits 0) is the network address and the last (all host bits 1) is the broadcast address. That leaves 64 − 2 = 62 usable hosts. Worked example for 192.168.1.70/26:
- Mask for /26 is
255.255.255.192 (binary 11111111.11111111.11111111.11000000).
- Block size in the last octet is
256 − 192 = 64, so subnets start at .0, .64, .128 and .192.
- 70 falls in the .64 block: network
192.168.1.64, broadcast 192.168.1.127.
- Usable hosts:
192.168.1.65 – 192.168.1.126 (62 addresses).
The calculator does exactly this with a bitwise AND between the address and the mask, and it also shows the result in binary so you can see which bits are fixed.
Subnet mask vs wildcard mask (Cisco ACLs)
A subnet mask uses 1s for network bits and 0s for host bits. A wildcard mask is the exact inverse: 0 means "this bit must match", 1 means "ignore this bit". For /24 the mask is 255.255.255.0 and the wildcard is 0.0.0.255; for /27 they are 255.255.255.224 and 0.0.0.31. Cisco IOS uses wildcard masks in access lists and in OSPF/EIGRP network statements, for example access-list 10 permit 192.168.1.0 0.0.0.255 or network 10.1.0.0 0.0.255.255 area 0. The quick conversion is to subtract each octet of the subnet mask from 255 – the IPv4 tab shows both side by side and accepts either form as input.
VLSM step by step
With fixed-length subnetting every subnet gets the same size, which wastes space when a point-to-point link only needs 2 addresses but a /26 gives it 64. Variable Length Subnet Masking (VLSM) fixes this by allocating different sizes from one block:
- List each network with the number of hosts it needs and sort them from largest to smallest.
- For each requirement, pick the smallest block that holds hosts + 2 (network and broadcast). 50 hosts → 64 addresses → /26; 25 → 32 → /27; 10 → 16 → /28; 2 → 4 → /30 (or /31 on point-to-point links, RFC 3021).
- Allocate them back to back starting from the base network. Because sizes are powers of two and sorted descending, every block is automatically aligned to its boundary.
- Document each subnet's mask, range and broadcast, and keep the leftover space for growth.
The VLSM tab runs this algorithm for the example of Sales (50), IT (25), Management (10) and two WAN links from 192.168.10.0/24, and tells you how many addresses are wasted and how much of the base block remains.
IPv6 basics: no broadcast, /64 everywhere
IPv6 addresses are 128 bits written as eight hexadecimal groups, with leading zeros dropped and one run of zero groups collapsible to :: (RFC 5952 compression). The first 64 bits identify the network and the last 64 the interface. Unlike IPv4 there is no broadcast address: IPv6 uses multicast (for example ff02::1 for all nodes on the link) and there are no reserved network/broadcast addresses, so every address in a prefix is usable. LANs use a /64 so that SLAAC (stateless autoconfiguration) can build the interface identifier; organizations typically receive a /48 (65,536 /64 subnets) or a /56. Point-to-point links are often numbered from a /127. The IPv6 tab shows the compressed and expanded forms, the network and the address type (global unicast, unique local fc00::/7, link-local fe80::/10, multicast, documentation 2001:db8::/32 and more).
Subnetting cheat sheet
| CIDR | Subnet mask | Wildcard | Addresses | Usable hosts | Subnets per /24 |
| /24 | 255.255.255.0 | 0.0.0.255 | 256 | 254 | 1 |
| /25 | 255.255.255.128 | 0.0.0.127 | 128 | 126 | 2 |
| /26 | 255.255.255.192 | 0.0.0.63 | 64 | 62 | 4 |
| /27 | 255.255.255.224 | 0.0.0.31 | 32 | 30 | 8 |
| /28 | 255.255.255.240 | 0.0.0.15 | 16 | 14 | 16 |
| /29 | 255.255.255.248 | 0.0.0.7 | 8 | 6 | 32 |
| /30 | 255.255.255.252 | 0.0.0.3 | 4 | 2 | 64 |
| /31 | 255.255.255.254 | 0.0.0.1 | 2 | 2 (P2P) | 128 |
| /32 | 255.255.255.255 | 0.0.0.0 | 1 | 1 (host) | 256 |
Memorize the "magic numbers" 128, 192, 224, 240, 248, 252, 254, 255 – each adds one more network bit – and the block sizes 128, 64, 32, 16, 8, 4, 2, 1. The full /0–/32 table is in the CIDR ↔ Range tab.
Tips for the CCNA exam
- Find the interesting octet. It is the octet where the mask is neither 255 nor 0. The block size is 256 minus that mask octet; subnets start at multiples of the block size.
- Count host bits, not subnet bits. Hosts = 2host bits − 2. For "how many subnets" questions, subnet bits = new prefix − original prefix.
- Remember the exceptions. A /31 has 2 usable addresses on point-to-point links and a /32 is a single host route; both appear in real configs and in exam questions.
- Know the special ranges. RFC 1918 private (10/8, 172.16/12, 192.168/16), loopback 127/8, link-local 169.254/16, CGNAT 100.64/10, multicast 224/4 and the documentation blocks 192.0.2.0/24, 198.51.100.0/24 and 203.0.113.0/24.
- Practice with VLSM. Exam scenarios usually list departments with host counts; sort descending, allocate largest first, and double-check that the total fits the base block.
- Convert wildcards instantly. 255 − mask octet = wildcard octet. For OSPF you can also use the subnet mask of the interface as a wildcard (0.0.0.0 for a single interface).
Frequently asked questions
How do I calculate a subnet?
Write the IP address and the subnet mask in binary. The network address is the bitwise AND of the two; the broadcast address is the network address with all host bits set to 1. For 192.168.1.10/26 the mask is 255.255.255.192, the network is 192.168.1.0, the broadcast is 192.168.1.63 and the usable hosts run from .1 to .62. The number of addresses in a block is 2 to the power of (32 minus the prefix length), and usable hosts are that number minus 2.
What is the difference between a subnet mask and a wildcard mask?
A subnet mask marks the network bits with 1s (255.255.255.0 for /24). A wildcard mask is its bitwise inverse: 0s mark bits that must match and 1s mark bits that are ignored (0.0.0.255 for /24). Routing protocols such as OSPF and EIGRP, and Cisco access lists, use wildcard masks. You can convert one to the other by subtracting each octet from 255.
How many hosts are in a /27?
A /27 has 32 addresses (2 to the power of 5) and 30 usable hosts, because one address is the network address and one is the broadcast address. Its subnet mask is 255.255.255.224 and its wildcard mask is 0.0.0.31. A /24 can be divided into eight /27 subnets.
What is VLSM?
Variable Length Subnet Masking means dividing a network into subnets of different sizes instead of equal blocks, so each department or link gets a subnet that matches its host count. Sort the requirements from largest to smallest, give each one the smallest block that fits its hosts plus the network and broadcast addresses, and allocate them back to back starting from the base network. The VLSM tab automates this and reports wasted addresses and efficiency.
Does IPv6 have a broadcast address?
No. IPv6 replaced broadcast with multicast groups such as ff02::1 (all nodes on the link). Because there is no broadcast and no reserved network address in the same sense, every address in an IPv6 prefix is usable. Standard LANs use a /64 so that stateless address autoconfiguration (SLAAC) works, and sites typically receive a /48 or /56 from their provider.
Is this subnet calculator free?
Yes. The IPv4 and IPv6 calculators, subnet splitting, VLSM for up to five networks, CIDR to range conversion, the in-subnet checker, copy and share links are free with no sign-up, and everything runs in your browser. An optional one-time Pro licence adds unlimited VLSM networks, the route summarization tool, CSV downloads, saved projects and printable subnet plans.