How to use the subnet calculator
- Subnet info: type an IPv4 address with a prefix (
192.168.1.10/24), a mask (192.168.1.10 255.255.255.0), or a CIDR block (192.168.1.0/24) in one field, or split the prefix/mask into the second field. You get the network, broadcast, usable host range, subnet and wildcard masks, IP class, address type (private/public/reserved), binary and hex views, and thein-addr.arpareverse-DNS zone. - Split subnets: enter a base network, then split it evenly into a chosen number of subnets, or by the number of hosts each subnet needs (VLSM) — paste one
label,hostsline per requirement and they are packed largest-first with no overlap. - Range ↔ CIDR: enter a start and end address to get the smallest list of CIDR blocks covering that range. To go the other way — CIDR block to IP range — use the Subnet info tab.
- IPv6: enter an IPv6 address and prefix length to get the network, first and last address, and the exact address count.
What is a subnet mask?
An IPv4 address is 32 bits split into a network part and a host part. A subnet mask marks that split: it is 32 bits too, with a 1 for every network bit and a 0 for every host bit, written in the same dotted-quad form as an address. 255.255.255.0 means the first 24 bits are the network and the last 8 are hosts — the same information as writing /24 after the address.
Applying the mask (address AND mask) to any address in the subnet gives the same network address. For 192.168.1.10/24:
| IP address | 11000000.10101000.00000001.00001010 | 192.168.1.10 |
|---|---|---|
| Subnet mask | 11111111.11111111.11111111.00000000 | 255.255.255.0 |
| Network (AND) | 11000000.10101000.00000001.00000000 | 192.168.1.0 |
Because 192.168.1.10 has non-zero bits in the host part, it is a host address inside 192.168.1.0/24, not the network address itself — the calculator flags this whenever it happens.
How many hosts fit in each prefix? A non-octet example
Prefixes that don't land on an 8-bit boundary work the same way. 192.168.1.40/27 uses mask 255.255.255.224 (only the last octet is split): the block runs from 192.168.1.32 to 192.168.1.63, giving 30 usable hosts, 192.168.1.33 to 192.168.1.62. A smaller /30 such as 10.0.0.4/30 fits exactly 2 hosts — the classic size for a point-to-point link when a full /31 isn't used.
What is CIDR notation?
CIDR (Classless Inter-Domain Routing, RFC 4632) replaced the rigid class-based system (Class A = /8, B = /16, C = /24) with an address plus an explicit prefix length, e.g. 192.168.1.10/24. Any prefix length from /0 (the whole internet) to /32 (one address) is valid, which is what lets internet service providers and cloud platforms hand out blocks sized to what a customer actually needs instead of the nearest class boundary.
Splitting a network into subnets (VLSM)
Splitting 192.168.1.0/24 into 4 equal subnets moves the prefix from /24 to /26 (2 extra bits = 4 blocks), each with 62 usable hosts:
| Subnet | CIDR | Usable range |
|---|---|---|
| 1 | 192.168.1.0/26 | 192.168.1.1 – 192.168.1.62 |
| 2 | 192.168.1.64/26 | 192.168.1.65 – 192.168.1.126 |
| 3 | 192.168.1.128/26 | 192.168.1.129 – 192.168.1.190 |
| 4 | 192.168.1.192/26 | 192.168.1.193 – 192.168.1.254 |
Real networks rarely need equal-sized subnets. Variable Length Subnet Masking (VLSM) gives each department or link only the block it needs: a 100-host office gets a /25, a 50-host one a /26, and a 2-host router link a /30, packed into the base network without gaps or overlap. The "Split subnets" tab does this automatically — list each requirement as label,hosts and it sorts largest-first and allocates each the smallest block that fits.
CIDR to IP range and IP range to CIDR
Converting a CIDR block to a range is direct — the calculator gives it on the Subnet info tab. The reverse is not always one block: a range only maps to a single CIDR block when it starts on a power-of-two boundary and its length is itself a power of two. 192.168.1.5–192.168.1.20 needs 5 blocks:
| CIDR block | Addresses |
|---|---|
192.168.1.5/32 | 1 |
192.168.1.6/31 | 2 |
192.168.1.8/29 | 8 |
192.168.1.16/30 | 4 |
192.168.1.20/32 | 1 |
Private vs public IP addresses
RFC 1918 sets aside three ranges for private networks never routed on the public internet: 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16. A few other ranges have special jobs: 127.0.0.0/8 is loopback, 169.254.0.0/16 is link-local (self-assigned when DHCP fails), 224.0.0.0/4 is multicast, and 192.0.2.0/24, 198.51.100.0/24 and 203.0.113.0/24 are documentation-only ranges, like the examples on this page. The calculator flags all of these under "Address type".
IPv6 subnetting
IPv6 addresses are 128 bits, written as eight hex groups with :: allowed once to compress a run of zero groups. A home allocation is typically a /64 — 264 addresses, more than every IPv4 address ever issued, in one subnet — while an ISP customer often gets a /56 or /48 to split into many /64s. The IPv6 tab gives the network, first/last address and the exact address count as a full integer (JavaScript numbers can't hold it exactly, so it uses arbitrary-precision arithmetic).
Subnet cheat sheet: every prefix /0 to /32
Every prefix length, its mask, wildcard mask, and address/host counts — generated by the same engine as the calculator above, so it always matches:
| Prefix | Subnet mask | Wildcard mask | Total addresses | Usable hosts |
|---|---|---|---|---|
| /0 | 0.0.0.0 | 255.255.255.255 | 4,294,967,296 | 4,294,967,294 |
| /1 | 128.0.0.0 | 127.255.255.255 | 2,147,483,648 | 2,147,483,646 |
| /2 | 192.0.0.0 | 63.255.255.255 | 1,073,741,824 | 1,073,741,822 |
| /3 | 224.0.0.0 | 31.255.255.255 | 536,870,912 | 536,870,910 |
| /4 | 240.0.0.0 | 15.255.255.255 | 268,435,456 | 268,435,454 |
| /5 | 248.0.0.0 | 7.255.255.255 | 134,217,728 | 134,217,726 |
| /6 | 252.0.0.0 | 3.255.255.255 | 67,108,864 | 67,108,862 |
| /7 | 254.0.0.0 | 1.255.255.255 | 33,554,432 | 33,554,430 |
| /8 | 255.0.0.0 | 0.255.255.255 | 16,777,216 | 16,777,214 |
| /9 | 255.128.0.0 | 0.127.255.255 | 8,388,608 | 8,388,606 |
| /10 | 255.192.0.0 | 0.63.255.255 | 4,194,304 | 4,194,302 |
| /11 | 255.224.0.0 | 0.31.255.255 | 2,097,152 | 2,097,150 |
| /12 | 255.240.0.0 | 0.15.255.255 | 1,048,576 | 1,048,574 |
| /13 | 255.248.0.0 | 0.7.255.255 | 524,288 | 524,286 |
| /14 | 255.252.0.0 | 0.3.255.255 | 262,144 | 262,142 |
| /15 | 255.254.0.0 | 0.1.255.255 | 131,072 | 131,070 |
| /16 | 255.255.0.0 | 0.0.255.255 | 65,536 | 65,534 |
| /17 | 255.255.128.0 | 0.0.127.255 | 32,768 | 32,766 |
| /18 | 255.255.192.0 | 0.0.63.255 | 16,384 | 16,382 |
| /19 | 255.255.224.0 | 0.0.31.255 | 8,192 | 8,190 |
| /20 | 255.255.240.0 | 0.0.15.255 | 4,096 | 4,094 |
| /21 | 255.255.248.0 | 0.0.7.255 | 2,048 | 2,046 |
| /22 | 255.255.252.0 | 0.0.3.255 | 1,024 | 1,022 |
| /23 | 255.255.254.0 | 0.0.1.255 | 512 | 510 |
| /24 | 255.255.255.0 | 0.0.0.255 | 256 | 254 |
| /25 | 255.255.255.128 | 0.0.0.127 | 128 | 126 |
| /26 | 255.255.255.192 | 0.0.0.63 | 64 | 62 |
| /27 | 255.255.255.224 | 0.0.0.31 | 32 | 30 |
| /28 | 255.255.255.240 | 0.0.0.15 | 16 | 14 |
| /29 | 255.255.255.248 | 0.0.0.7 | 8 | 6 |
| /30 | 255.255.255.252 | 0.0.0.3 | 4 | 2 |
| /31 | 255.255.255.254 | 0.0.0.1 | 2 | 2 |
| /32 | 255.255.255.255 | 0.0.0.0 | 1 | 1 |
Reverse DNS and the in-addr.arpa zone
Reverse DNS (an IP address to a hostname, via a PTR record) is served from the in-addr.arpa zone, with the address octets reversed: 192.168.1.0/24 is delegated in 1.168.192.in-addr.arpa, and the whole 10.0.0.0/8 block is 10.in-addr.arpa. Prefixes off an octet boundary (like /27) are delegated within their containing /24 (RFC 2317), so the calculator shows that whole-octet zone for those.
Other developer and sysadmin tools
- Chmod calculator: the other half of sysadmin work — set Linux/Unix file permissions, convert octal to symbolic, and build the exact
chmodcommand. - JWT decoder: decode a JSON Web Token and check its claims and expiry.
- JSON formatter and validator: format and validate API responses and config files.
Frequently asked questions
What is CIDR notation?
CIDR (Classless Inter-Domain Routing) notation writes a network as an address plus a slash and a prefix length, e.g. 192.168.1.10/24, where the number after the slash is how many leading bits of the 32-bit address are the network part. It replaced the older class-based system (Class A/B/C) because it lets a network be any size, not just /8, /16 or /24.
How many hosts are in a /24?
A /24 has 256 total addresses and 254 usable hosts: 192.168.1.1 to 192.168.1.254. The first address (192.168.1.0) is the network address and the last (192.168.1.255) is the broadcast address, so both are reserved and not assigned to a device.
What is a subnet mask, and how is it different from a CIDR prefix?
They describe the same split between network bits and host bits in two notations: a subnet mask is a dotted-quad with as many leading 1 bits as the prefix (255.255.255.0 for /24), and a CIDR prefix is just that bit count written after a slash (/24). The calculator accepts either and shows both.
What is a wildcard mask?
A wildcard mask is the inverse of a subnet mask (each bit flipped) — 0.0.0.255 for a /24 mask of 255.255.255.0. Cisco access control lists and OSPF network statements use wildcard masks instead of subnet masks, so the calculator shows both for every prefix.
Why does 192.168.1.0/24 have only 254 usable hosts instead of 256?
A /24 has 256 total addresses, but the first (the network address, .0) identifies the subnet itself and the last (the broadcast address, .255) sends to every host on it — neither can be assigned to a device. The two exceptions are /31, used for point-to-point links with no broadcast (RFC 3021, both addresses usable), and /32, a single host route.
What is VLSM (Variable Length Subnet Masking)?
VLSM splits one network into subnets of different sizes instead of equal ones, so a network with a 100-host department and a 2-host router link does not waste addresses giving both the same size block. The "Split subnets" tab above does this: enter each requirement’s host count and it packs the smallest subnet that fits each one, largest first, with no overlap.
What is a private IP address?
Private addresses (Private use (RFC 1918), e.g. 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16) are reserved for use inside a network and never routed on the public internet; a router performs NAT so they can reach the internet through one public address. Compare a public address like 8.8.8.8 (Public (globally routable)), a loopback address like 127.0.0.1 (Loopback (RFC 1122)), or a link-local address like 169.254.1.5 (Link-local (RFC 3927)), which a device picks for itself when DHCP fails.
What is the difference between a network address and a broadcast address?
The network address (all host bits zero, e.g. 192.168.1.0) identifies the subnet as a whole and is used in routing tables. The broadcast address (all host bits one, e.g. 192.168.1.255) is a special destination that every host on the subnet receives. Both are set aside automatically and excluded from the usable host range.
How do I convert a CIDR block to an IP address range, or the other way round?
Enter the CIDR block (e.g. 192.168.1.0/24) in the Subnet info tab to see its first and last usable address. To go the other way, use the Range ↔ CIDR tab: enter a start and end address and it returns the smallest list of CIDR blocks that exactly covers that range, since a range does not always align to a single power-of-two block.
Does this calculator support IPv6?
Yes, as a bonus tab: enter an IPv6 address and a prefix length (0–128) to get the network, first and last address, and the exact number of addresses in the block as a full integer (IPv6 blocks are astronomically larger than IPv4 ones, so the count is shown in full rather than rounded).