What is a subnet mask?
A 32-bit number that marks which part of an IPv4 address is the network and which part is the host. 255.255.255.0 keeps 24 bits.
Type an IP address with a CIDR prefix or subnet mask to get its network, broadcast address, usable host range and wildcard mask.
With /24 or a mask such as 255.255.255.0 after it, or pick the mask below.
Type an IPv4 address to see its subnet.
The address and mask show here bit by bit once the address reads.
Type how many devices the subnet must hold to pick the smallest mask with room.
Type any address, such as 192.168.1.77.
Type an address above to list its subnets.
With a prefix such as /64 after it, or pick the prefix below.
Type an IPv6 address to see its subnet.
The address and mask show here bit by bit once the address reads.
Type any address, such as 2001:db8:abcd:12::99.
Type an address above to list its subnets.
An address and its size, such as 192.168.10.0/24.
Each subnet's block shows here once the network and host counts are in.
IPv4 or IPv6. A CIDR block such as 10.0.0.0/22 here, with the last box empty, gives its range.
Type the first and last address of a range, or a CIDR block in the first box.
Each block shows here, largest that fits first, ready to paste into a firewall rule or an allow list.
Every IPv4 prefix from /32 to /0 with its mask, wildcard, addresses and hosts. Press one to use it above.
| CIDR | Subnet mask | Wildcard mask | Addresses | Usable hosts |
|---|---|---|---|---|
| 255.255.255.255 | 0.0.0.0 | 1 | 1 | |
| 255.255.255.254 | 0.0.0.1 | 2 | 2 (RFC 3021) | |
| 255.255.255.252 | 0.0.0.3 | 4 | 2 | |
| 255.255.255.248 | 0.0.0.7 | 8 | 6 | |
| 255.255.255.240 | 0.0.0.15 | 16 | 14 | |
| 255.255.255.224 | 0.0.0.31 | 32 | 30 | |
| 255.255.255.192 | 0.0.0.63 | 64 | 62 | |
| 255.255.255.128 | 0.0.0.127 | 128 | 126 | |
| 255.255.255.0 | 0.0.0.255 | 256 | 254 | |
| 255.255.254.0 | 0.0.1.255 | 512 | 510 | |
| 255.255.252.0 | 0.0.3.255 | 1,024 | 1,022 | |
| 255.255.248.0 | 0.0.7.255 | 2,048 | 2,046 | |
| 255.255.240.0 | 0.0.15.255 | 4,096 | 4,094 | |
| 255.255.224.0 | 0.0.31.255 | 8,192 | 8,190 | |
| 255.255.192.0 | 0.0.63.255 | 16,384 | 16,382 | |
| 255.255.128.0 | 0.0.127.255 | 32,768 | 32,766 | |
| 255.255.0.0 | 0.0.255.255 | 65,536 | 65,534 | |
| 255.254.0.0 | 0.1.255.255 | 131,072 | 131,070 | |
| 255.252.0.0 | 0.3.255.255 | 262,144 | 262,142 | |
| 255.248.0.0 | 0.7.255.255 | 524,288 | 524,286 | |
| 255.240.0.0 | 0.15.255.255 | 1,048,576 | 1,048,574 | |
| 255.224.0.0 | 0.31.255.255 | 2,097,152 | 2,097,150 | |
| 255.192.0.0 | 0.63.255.255 | 4,194,304 | 4,194,302 | |
| 255.128.0.0 | 0.127.255.255 | 8,388,608 | 8,388,606 | |
| 255.0.0.0 | 0.255.255.255 | 16,777,216 | 16,777,214 | |
| 254.0.0.0 | 1.255.255.255 | 33,554,432 | 33,554,430 | |
| 252.0.0.0 | 3.255.255.255 | 67,108,864 | 67,108,862 | |
| 248.0.0.0 | 7.255.255.255 | 134,217,728 | 134,217,726 | |
| 240.0.0.0 | 15.255.255.255 | 268,435,456 | 268,435,454 | |
| 224.0.0.0 | 31.255.255.255 | 536,870,912 | 536,870,910 | |
| 192.0.0.0 | 63.255.255.255 | 1,073,741,824 | 1,073,741,822 | |
| 128.0.0.0 | 127.255.255.255 | 2,147,483,648 | 2,147,483,646 | |
| 0.0.0.0 | 255.255.255.255 | 4,294,967,296 | 4,294,967,294 |
Made for subnetting practice, CCNA labs and real networks: every answer shows the mask and the address in binary, so the method is easy to check.
Every subnet, VLSM plan and IPv6 prefix is worked out in this tab with exact maths, and no address you type is sent to a server.
Type an address and mask, read the host range, then split the network into smaller subnets.
Type an address such as 192.168.1.10/24, or pick a mask from the subnet mask list. 255.255.255.0 works there too.
The network, broadcast and usable IP range show at once, each ready to copy: 192.168.1.1 to 192.168.1.254 for a /24.
Pick a smaller size under Split into subnets to list every block: a /24 holds four /26 subnets of 62 hosts each.
A subnet mask splits an IPv4 address in two: network bits on the left, host bits on the right. To find the network address, keep the network bits and set every host bit to 0. That is a bitwise AND of the address and the mask, one octet at a time.
Take 172.16.5.4/20. Its mask is 255.255.240.0, so the cut falls in the third octet: 5 AND 240 is 0, which gives the network 172.16.0.0. The broadcast address sets every host bit to 1 instead, giving 172.16.15.255. The usable hosts run from 172.16.0.1 to 172.16.15.254.
A quick check by hand: 256 minus the mask's cut octet is the block size. For 240 that is 16, so /20 networks start at 0, 16, 32 and so on in the third octet. The In binary view in the calculator draws the line between network and host bits for you.
CIDR notation writes the mask as a slash and the number of network bits. /24 means the first 24 bits are the network, which is 255.255.255.0 written out. Each step from /24 to /25 and on halves the block: 256 addresses, then 128, then 64.
To turn CIDR into a subnet mask, write that many 1s, fill the rest of the 32 bits with 0s and read each group of eight as a number. /26 is 11111111.11111111.11111111.11000000, or 255.255.255.192. To go back, count the 1s.
A block holds 2 to the power of its host bits: a /29 has 3, so 8 addresses. The network and broadcast addresses take two, leaving 6 hosts, and a /30 mask leaves 2. A /31 is the exception: both its addresses work on a point to point link (RFC 3021).
Splitting a network into equal subnets wastes space when groups differ in size. A variable length subnet mask gives each group a block that fits it: a /26 for 50 office machines, a /28 for 12 printers and a /30 for the link to the router.
The VLSM tab builds the plan from host counts. List each subnet with the hosts it needs; the calculator sorts them largest first and places each on the next free boundary, so no blocks overlap and the free space stays in one piece.
For 192.168.10.0/24 with 50, 12 and 2 hosts, the subnets are 192.168.10.0/26, 192.168.10.64/28 and 192.168.10.80/30. Together they use 84 of the 256 addresses, and the plan lists what is left after them as four free CIDR blocks.
An IPv6 address is 128 bits, written as eight groups of four hex digits. Subnetting works as it does in IPv4, only with far bigger numbers: the prefix length counts the network bits, and every bit after it belongs to the interface.
Almost every IPv6 LAN is a /64, because SLAAC, the way devices give themselves an address, needs 64 interface bits. A site is often given a /48, which holds 65,536 /64 subnets, and a home connection usually gets a /56 or a /60.
IPv6 has no broadcast address, so every address in a block counts. The IPv6 tab writes each address in full and in its short form, with leading zeros dropped and the longest run of zero groups written as ::, as RFC 5952 asks.
Split any network into equal smaller subnets and list every one, copied for Excel or as a CSV.
List the hosts each subnet needs and get blocks sized to fit, placed largest first with no overlaps.
Expand or shorten IPv6 addresses, read a prefix's first and last address and count its /64 networks.
The wildcard mask sits beside the subnet mask, 0.0.0.255 for a /24, ready for Cisco ACLs and OSPF.
Type the first and last address of a range to get the fewest CIDR blocks that cover it exactly.
See the address, mask, network and broadcast in binary, network bits set apart from host bits.
Every subnet is worked out in this browser tab, so the addresses of your network stay on your device.
Addresses and masks are worked out by code running in this tab. No IP you type is sent or logged.
No address is kept. Reload the tab and every address box, subnet list and VLSM plan is empty again.
No account, no email and no daily limit: plan one subnet or a whole campus network of them for free.
A 32-bit number that marks which part of an IPv4 address is the network and which part is the host. 255.255.255.0 keeps 24 bits.
A smaller network carved out of a bigger one. Devices in one subnet talk directly; traffic to others goes through a router.
255.255.255.0. A /24 holds 256 addresses, 254 of them usable hosts, the most common size for a home or office network.
65,536, of which 65,534 are usable hosts. Its subnet mask is 255.255.0.0, and it holds 256 networks of /24 each.
The last address of a subnet, with every host bit set to 1. A packet sent to it reaches every device there, so no host can use it.
10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16, set aside by RFC 1918. Use them inside any network; they are never routed online.
The router address devices send traffic to when it leaves their subnet. It sits inside the subnet, often its first usable host.
Classless Inter-Domain Routing: a network written as an address and a prefix length, like 10.0.0.0/8, in place of the old classes.
Still stuck, or found a problem? Email dobliquestudio@gmail.com and we will help.