What the subnet calculator shows
An IPv4 address is 32 bits, written as four numbers from 0 to 255. In CIDR notation, the prefix length after the slash says how many of those bits name the network; the rest number the hosts inside it. 192.168.1.10/24 means the first 24 bits, 192.168.1, are the network and the last 8 bits pick one of its hosts. The netmask writes the same split as an address: 24 ones followed by 8 zeros is 255.255.255.0. The number base converter shows any of these numbers in binary.
The calculator applies the mask to your address. Setting every host bit to 0 gives the network address, setting every host bit to 1 gives the broadcast address, and everything in between is the usable host range you can give to computers, printers and routers. The wildcard mask is the netmask with each bit flipped, which is how Cisco access lists write the same range.
For a /26 that is 26 - 2 = 62 hosts. The two that are subtracted are the network and broadcast addresses.
The /31 and /32 exceptions
The minus 2 does not work for the two longest prefixes. RFC 3021 allows a /31 on a point-to-point link, such as a link between two routers, and says that both of its addresses are hosts, since such a link needs no network or broadcast address. A /32 is one single address, which RFC 4632 calls a host route. The calculator shows 2 and 1 usable hosts for them and no broadcast address. When you plan subnets by host count, it uses /30 for links by default; tick the RFC 3021 option to get /31 and /32 instead.
CIDR cheat sheet
Every IPv4 prefix length with its netmask, wildcard mask, number of addresses and usable hosts. Each step up the table halves the size of the network. The old class C network is a /24, class B a /16 and class A a /8.
| Prefix | Netmask | Wildcard | Addresses | Usable hosts |
|---|---|---|---|---|
| /32 | 255.255.255.255 | 0.0.0.0 | 1 | 1 |
| /31 | 255.255.255.254 | 0.0.0.1 | 2 | 2 |
| /30 | 255.255.255.252 | 0.0.0.3 | 4 | 2 |
| /29 | 255.255.255.248 | 0.0.0.7 | 8 | 6 |
| /28 | 255.255.255.240 | 0.0.0.15 | 16 | 14 |
| /27 | 255.255.255.224 | 0.0.0.31 | 32 | 30 |
| /26 | 255.255.255.192 | 0.0.0.63 | 64 | 62 |
| /25 | 255.255.255.128 | 0.0.0.127 | 128 | 126 |
| /24 | 255.255.255.0 | 0.0.0.255 | 256 | 254 |
| /23 | 255.255.254.0 | 0.0.1.255 | 512 | 510 |
| /22 | 255.255.252.0 | 0.0.3.255 | 1,024 | 1,022 |
| /21 | 255.255.248.0 | 0.0.7.255 | 2,048 | 2,046 |
| /20 | 255.255.240.0 | 0.0.15.255 | 4,096 | 4,094 |
| /19 | 255.255.224.0 | 0.0.31.255 | 8,192 | 8,190 |
| /18 | 255.255.192.0 | 0.0.63.255 | 16,384 | 16,382 |
| /17 | 255.255.128.0 | 0.0.127.255 | 32,768 | 32,766 |
| /16 | 255.255.0.0 | 0.0.255.255 | 65,536 | 65,534 |
| /15 | 255.254.0.0 | 0.1.255.255 | 131,072 | 131,070 |
| /14 | 255.252.0.0 | 0.3.255.255 | 262,144 | 262,142 |
| /13 | 255.248.0.0 | 0.7.255.255 | 524,288 | 524,286 |
| /12 | 255.240.0.0 | 0.15.255.255 | 1,048,576 | 1,048,574 |
| /11 | 255.224.0.0 | 0.31.255.255 | 2,097,152 | 2,097,150 |
| /10 | 255.192.0.0 | 0.63.255.255 | 4,194,304 | 4,194,302 |
| /9 | 255.128.0.0 | 0.127.255.255 | 8,388,608 | 8,388,606 |
| /8 | 255.0.0.0 | 0.255.255.255 | 16,777,216 | 16,777,214 |
| /7 | 254.0.0.0 | 1.255.255.255 | 33,554,432 | 33,554,430 |
| /6 | 252.0.0.0 | 3.255.255.255 | 67,108,864 | 67,108,862 |
| /5 | 248.0.0.0 | 7.255.255.255 | 134,217,728 | 134,217,726 |
| /4 | 240.0.0.0 | 15.255.255.255 | 268,435,456 | 268,435,454 |
| /3 | 224.0.0.0 | 31.255.255.255 | 536,870,912 | 536,870,910 |
| /2 | 192.0.0.0 | 63.255.255.255 | 1,073,741,824 | 1,073,741,822 |
| /1 | 128.0.0.0 | 127.255.255.255 | 2,147,483,648 | 2,147,483,646 |
| /0 | 0.0.0.0 | 255.255.255.255 | 4,294,967,296 | 4,294,967,294 |
Private, shared and special IPv4 ranges
Some ranges are set aside for a purpose and never appear on the public internet. The calculator checks every address against the IANA special-purpose registry and shows each block it belongs to, with the RFC that defines it. The ones you meet most often:
| Block | Purpose | Defined in |
|---|---|---|
| 10.0.0.0/8 | Private networks | RFC 1918 |
| 172.16.0.0/12 | Private networks (172.16.0.0 to 172.31.255.255) | RFC 1918 |
| 192.168.0.0/16 | Private networks | RFC 1918 |
| 100.64.0.0/10 | Shared address space for carrier-grade NAT at internet providers | RFC 6598 |
| 127.0.0.0/8 | Loopback: the device itself | RFC 1122 |
| 169.254.0.0/16 | Link-local: self-assigned when no address configuration is available, such as a missing DHCP server | RFC 3927 |
| 192.0.2.0/24, 198.51.100.0/24, 203.0.113.0/24 | Documentation and examples (TEST-NET-1 to 3) | RFC 5737 |
| 198.18.0.0/15 | Network benchmarking | RFC 2544 |
| 224.0.0.0/4 | Multicast | RFC 5771 |
| 240.0.0.0/4 | Reserved | RFC 1112 |
| 255.255.255.255/32 | Limited broadcast | RFC 919 |
Address classes A to E (historic)
Before CIDR arrived in 1993 with RFC 1519, the first bits of an address fixed the size of its network, as RFC 791 and RFC 1112 defined. RFC 4632, the current CIDR document, points out that a mask can no longer be inferred from the first bits, so the class is shown only as background.
| Class | First octet | Leading bits | Old default mask |
|---|---|---|---|
| A | 0 to 127 | 0 | 255.0.0.0 (/8) |
| B | 128 to 191 | 10 | 255.255.0.0 (/16) |
| C | 192 to 223 | 110 | 255.255.255.0 (/24) |
| D | 224 to 239 | 1110 | Multicast |
| E | 240 to 255 | 1111 | Reserved |
Splitting a network: equal subnets and VLSM
Each bit you add to the prefix doubles the number of subnets and halves their size. Splitting 192.168.1.0/24 into 4 subnets takes 2 bits, which gives four /26 networks of 62 hosts each, starting at .0, .64, .128 and .192. A count that is not a power of two is rounded up: 5 subnets need 3 bits and give 8 subnets of /27, so you keep 3 in reserve. In Hosts mode you enter how many devices each subnet needs and get the smallest prefix that fits, and in Prefix mode you pick the new prefix length directly.
When the subnets need different sizes, VLSM (variable length subnet masking) saves addresses. The calculator sorts the needs from largest to smallest and places each subnet on a boundary of its own size, so none overlap. The default plan in the tool shows how this works inside 192.168.1.0/24:
| Subnet | Hosts needed | Network | Usable hosts |
|---|---|---|---|
| Sales | 100 | 192.168.1.0/25 | 126 |
| Office | 50 | 192.168.1.128/26 | 62 |
| Lab | 20 | 192.168.1.192/27 | 30 |
| Router link | 2 | 192.168.1.224/30 | 2 |
The rest of the range, 192.168.1.228/30, 192.168.1.232/29 and 192.168.1.240/28, stays free for later, and the table lists it as unused.
IPv6 prefixes and notation
An IPv6 address has 128 bits, written as eight groups of four hex digits. RFC 4291 requires 64-bit interface identifiers for almost all unicast addresses, so a single network segment is a /64, and a larger prefix such as a /48 is divided into /64 networks. IPv6 has no broadcast address, which is why the calculator shows the first and last address of the prefix instead of a host range. The numbers get large: a /64 holds 18,446,744,073,709,551,616 addresses, and the calculator counts them exactly instead of rounding.
RFC 5952 sets one canonical short form. Hex letters are lowercase, leading zeros in a group are dropped, and the longest run of two or more zero groups becomes a double colon, the first one if two runs are equally long. A single zero group stays as 0. The calculator shows both this compressed form and the full expanded form with all 32 digits, and it accepts either as input, including a zone index like %eth0 and a dotted IPv4 part at the end. Common special ranges are ::1 for loopback, fe80::/10 for link-local, fc00::/7 for unique local addresses, 2001:db8::/32 and 3fff::/20 for documentation, ff00::/8 for multicast and 2000::/3 for global unicast.
How to use the subnet calculator
- 1Type an IP address with a prefix like /24 or a netmask like 255.255.255.0, or pick the prefix from the list. IPv6 addresses are detected automatically.
- 2Read the network, broadcast address, host range and number of hosts at the top, and every other value with a copy button under All details.
- 3To plan subnets, choose Count, Hosts, Prefix or VLSM under Split into subnets, then copy the table or a link to the whole plan.
Frequently asked questions
How many usable hosts does a /24 have?
254. A /24 holds 256 addresses. The first one is the network address and the last one is the broadcast address, and neither can be given to a device. In general a prefix of length n holds 2 to the power of (32 minus n) addresses, and you subtract 2 for the usable hosts. The exceptions are /31 with 2 hosts and /32 with 1.
Why does a /31 have two usable hosts?
RFC 3021 allows a /31 on a point-to-point link, such as a link between two routers, and treats both of its addresses as hosts, since such a link needs no network or broadcast address. That uses 2 addresses instead of the 4 of a /30. A /32 is a single address, which RFC 4632 lists as a host route.
What is the difference between a netmask and a wildcard mask?
A wildcard mask is the netmask with every bit flipped: 255.255.255.0 becomes 0.0.0.255. Cisco access lists use wildcard masks, where a 0 bit must match and a 1 bit may be anything. The calculator shows both, and you can also type a wildcard mask after the address; it is recognized and converted.
Which IP addresses are private?
RFC 1918 sets aside 10.0.0.0/8, 172.16.0.0/12 (172.16.0.0 to 172.31.255.255) and 192.168.0.0/16 for private networks. 100.64.0.0/10 is shared address space from RFC 6598, meant for internet providers that run carrier-grade NAT, not for home or office networks. None of these blocks is reachable from the internet.
How do I split a network into equal subnets?
Every extra prefix bit doubles the number of subnets and halves their size. To split 192.168.1.0/24 into 4 subnets, add 2 bits: you get four /26 networks with 62 hosts each, starting at .0, .64, .128 and .192. If the count is not a power of two, round up: 5 subnets need 3 bits, which gives 8 subnets of /27.
How is an IPv6 address shortened?
RFC 5952 sets the rules: write hex letters in lowercase, drop leading zeros in each group, and replace the longest run of two or more all-zero groups with a double colon (the first run if two are equally long). A single zero group stays as 0. So 2001:0db8:0000:0000:0000:ff00:0042:8329 becomes 2001:db8::ff00:42:8329.
Does the calculator send my IP address anywhere?
No. All the math runs in your browser, and nothing you type leaves your device. The calculator also does not look up your own IP address; it only works with the addresses you enter.