IP Subnet Calculator

Calculate network, broadcast, mask, host range, and total addresses for any IPv4 CIDR. Free online tool, no signup required.

Preparing private browser tool…

Your file will stay on this device.

What an IP subnet calculator works out

Give this calculator an IPv4 address with a CIDR prefix, such as 192.168.1.0/24, and it returns the ten values you normally need when planning or documenting a network: the normalised CIDR, the network address, the broadcast address, the subnet mask in dotted decimal, the wildcard mask, the first and last usable host, the total number of addresses, the number of usable hosts, and the mask written out in binary. Every row has a copy button, which is the fastest way to move a value into a router config or a ticket.

The input does not have to be a network address. Type 192.168.1.77/24 and the calculator applies the mask for you and reports the network as 192.168.1.0/24. That is the same operation a host performs when it decides whether a destination is local or has to go via the default gateway, so entering a real interface address is often more useful than entering the tidy network address you already know.

Results update as you type, and the field turns red with an invalid CIDR notice when the string cannot be parsed. Everything is computed in your browser, so no address is sent anywhere, which matters when the addresses come from a production network.

How the mask splits an address

An IPv4 address is 32 bits. The prefix length says how many of those bits, counting from the left, identify the network; the rest identify a host inside it. A /24 fixes the first 24 bits and leaves 8 for hosts, which is 2^8 = 256 addresses. A /26 fixes 26 bits and leaves 6, which is 2^6 = 64 addresses. Each extra bit given to the network halves the block.

The mask is the same statement written as an address: 24 ones followed by 8 zeros is 11111111.11111111.11111111.00000000, which is 255.255.255.0. The binary mask row in the results makes the boundary visible, which helps most when the prefix is not a multiple of 8 and the split falls in the middle of an octet. The wildcard mask is the bitwise inverse, 0.0.0.255 for a /24, and is the form Cisco access lists and OSPF network statements expect, where a zero bit means the bit must match and a one bit means it is free.

The network address is the block with every host bit set to zero, and the broadcast address is the same block with every host bit set to one. Neither can be assigned to an interface in a normal subnet, which is why usable hosts is two fewer than total addresses: 254 in a /24, 62 in a /26, 14 in a /28, 2 in a /30.

A worked example: splitting 192.168.10.0/24 into four /26 subnets

Moving from /24 to /26 borrows two bits from the host part, which produces 2^2 = 4 subnets of 64 addresses each. The mask becomes 255.255.255.192, the wildcard becomes 0.0.0.63, and the binary mask is 11111111.11111111.11111111.11000000. The block size of 64 also tells you where each subnet starts: 0, 64, 128 and 192.

The four subnets come out as follows. 192.168.10.0/26 has network 192.168.10.0, broadcast 192.168.10.63, and usable hosts 192.168.10.1 to 192.168.10.62. 192.168.10.64/26 has network 192.168.10.64, broadcast 192.168.10.127, and usable hosts 192.168.10.65 to 192.168.10.126. 192.168.10.128/26 has network 192.168.10.128, broadcast 192.168.10.191, and usable hosts 192.168.10.129 to 192.168.10.190. 192.168.10.192/26 has network 192.168.10.192, broadcast 192.168.10.255, and usable hosts 192.168.10.193 to 192.168.10.254. Each block reports 64 total addresses and 62 usable hosts, so the four together hold 248 usable hosts against the 254 of the single /24. The six addresses lost are the three extra network and broadcast pairs the split creates.

To check a specific host, enter it with the new prefix. 192.168.10.77/26 returns network 192.168.10.64 and broadcast 192.168.10.127, which puts it in the second subnet. 192.168.10.130/26 returns network 192.168.10.128, so those two addresses can no longer reach each other directly even though they shared a subnet before the split. That is the failure mode to watch for after a re-subnetting: hosts that used to be neighbours now need a route.

Prefix sizes and the /31 and /32 special cases

Common sizes are worth memorising as block sizes rather than masks. A /30 gives 4 addresses and 2 usable hosts, the classic point to point link. A /29 gives 8 and 6, a /28 gives 16 and 14, a /27 gives 32 and 30, and a /24 gives 256 and 254. A /16 gives 65,536 and 65,534, and a /8 gives 16,777,216 and 16,777,214. A /0 covers the entire 4,294,967,296 address space and is what a default route matches.

Two prefixes do not follow the minus two rule, and the calculator handles them accordingly. A /31 reports 2 total addresses and 2 usable hosts, with the first usable host equal to the network address and the last equal to the broadcast address. RFC 3021 defines this for point to point links, where there is no need to reserve a broadcast address and using a /30 would waste half the block. A /32 reports 1 total address and 1 usable host, which is how a single host route or a loopback interface is written.

Reading the numbers the other way round is what capacity planning usually needs. If a segment has to hold 100 hosts, a /25 with 126 usable addresses fits and a /26 with 62 does not. Size the prefix from the host count, then confirm the block boundaries land where you expect before you commit the addressing to a document.

Limits of this calculator

It handles IPv4 only. IPv6 uses 128 bit addresses, has no broadcast address, and does not reserve an all zeros or all ones host value, so the arithmetic here does not carry over and a /64 in IPv6 means something quite different from a /64 in IPv4 terms.

The input has to be CIDR notation with a slash and a prefix number between 0 and 32. A dotted decimal mask is produced as output but cannot be typed as input, so 192.168.1.0 255.255.255.0 will not parse; convert it to 192.168.1.0/24 first. The parser wants four dotted decimal octets, each between 0 and 255, and rejects anything else with the invalid CIDR message.

The calculator works on one subnet at a time. It does not enumerate child subnets, perform variable length subnet mask allocation, or track which blocks you have already assigned; for a split, calculate each child prefix in turn using the block size to find the next network address, as in the /26 example above. It also makes no judgement about whether an address is private, public, multicast or reserved.

Frequently asked questions

Can I enter a host address instead of a network address?
Yes. The calculator applies the mask and reports the network the address belongs to. Entering 192.168.1.77/24 returns 192.168.1.0/24, which is exactly the check a host performs to decide whether a destination is on its own segment.
Why does a /31 show 2 usable hosts instead of 0?
RFC 3021 allows /31 on point to point links, where no broadcast address is needed. The calculator follows that rule, so a /31 reports 2 total and 2 usable addresses, with the first usable host equal to the network address and the last equal to the broadcast address. A /32 likewise reports a single usable address.
How do I split one network into several smaller subnets?
Choose the child prefix, read its total address count as the block size, then step through the parent in increments of that size. Splitting a /24 into /26 blocks of 64 gives networks at .0, .64, .128 and .192. Enter each one to confirm its broadcast address and host range.
Can I type the mask as 255.255.255.0 instead of /24?
No. The input field expects CIDR notation with a slash and a prefix between 0 and 32. The dotted decimal mask and its binary form appear in the results, but they are output only.
Why are there fewer usable hosts after splitting a network?
Every subnet gives up its own network and broadcast address. One /24 loses 2 of its 256 addresses; four /26 blocks lose 2 each, so 8 in total. That is why the four /26 subnets hold 248 usable hosts where the single /24 held 254.
What does the binary mask row tell me?
It shows the exact bit boundary between the network and host parts, which is hard to see in dotted decimal when the prefix is not a multiple of 8. A /26 reads 11111111.11111111.11111111.11000000, making it clear that only the top two bits of the last octet belong to the network.