IPv4 Subnet Calculator
Enter an IPv4 address with a CIDR prefix (like 10.0.0.0/24) or an address plus a subnet mask, and this calculator instantly returns the network address, broadcast address, usable host range, host count, and the equivalent netmask and wildcard mask — computed entirely in your browser, with no data ever sent to a server.
Invalid input:
Result
- Network address
- Broadcast address
- First usable host
- Last usable host
- Usable hosts
- Total addresses
- Prefix length
- Netmask
- Wildcard mask
- Netmask (binary)
IPv4 Subnet Calculator
The prefix length in a CIDR block (the number after the slash) says how many of the address's 32 bits are fixed as the network portion; the remaining bits identify hosts within that network. A netmask is the same information written as a dotted-decimal number — 255.255.255.0 and /24 mean exactly the same thing. The network address is the block with every host bit set to 0, and the broadcast address is the same block with every host bit set to 1; every address in between is a usable host address, except for the /31 and /32 special cases covered below.
For example, 192.168.1.100/24 sits inside the network 192.168.1.0, whose broadcast address is 192.168.1.255 — 254 usable hosts from .1 through .254. Shrink the prefix to /26 and the same address falls in 192.168.1.64/26, a block of only 64 addresses with 62 usable hosts (.65 through .126). Widening the prefix works the other way: a /16 like 10.0.0.0/16 spans 65,536 addresses across the whole 10.0.x.x range, useful for planning a large private network before subnetting it further with VLSM below.
Two prefix lengths break the general host-range rule: a /31, per RFC 3021, has no network or broadcast address at all — both of its two addresses are usable point-to-point hosts, a common choice for router-to-router links; a /32 identifies a single host, where the network, broadcast and only usable address are all that same one address. The mask↔prefix reference table below covers every prefix from /0 to /32, each row with its own bookmarkable id.
How to use this calculator
-
Enter the address
Type an IPv4 address with a CIDR prefix (like 10.0.0.0/24), or switch to “IP + mask” and enter the address and netmask separately.
-
Calculate
Click Calculate (or just open a permalink URL) to compute the network, broadcast, host range and equivalent masks instantly, with no page reload.
-
Read the result
The result card shows the network and broadcast addresses, the first and last usable host, the host count, and the netmask in both dotted-decimal and binary form.
-
Split or plan further (optional)
Use the equal-split tool to divide the block into N same-size subnets, or the VLSM planner to allocate a right-sized subnet for each of several different host-count requirements.
-
Share or copy
Copy the result to your clipboard with one click, or share the current page URL — it already encodes your input as a permalink.
Split into equal subnets
Divide the block above into a chosen number of equal-size subnets. A count that isn't a power of two still returns exactly that many blocks, sized to the next power of two.
Can't split:
| Network | Prefix | First host | Last host | Usable hosts |
|---|---|---|---|---|
VLSM planner
List the number of hosts each subnet needs (comma or newline separated) and this planner allocates a right-sized block for each one out of the parent network above, largest first, so no space is wasted between blocks.
Can't allocate:
| Requested hosts | Network | Prefix | First host | Last host | Usable hosts |
|---|---|---|---|---|---|
Mask ↔ prefix reference (/0–/32)
Every IPv4 prefix length with its netmask, wildcard mask, binary form and usable host count. Each row has its own id (e.g. #prefix-24) so you can link directly to a specific prefix instead of a separate page.
| Prefix | Netmask | Wildcard mask | Binary | Usable hosts |
|---|---|---|---|---|
| /0 | 0.0.0.0 | 255.255.255.255 | 00000000.00000000.00000000.00000000 | 4,294,967,294 |
| /1 | 128.0.0.0 | 127.255.255.255 | 10000000.00000000.00000000.00000000 | 2,147,483,646 |
| /2 | 192.0.0.0 | 63.255.255.255 | 11000000.00000000.00000000.00000000 | 1,073,741,822 |
| /3 | 224.0.0.0 | 31.255.255.255 | 11100000.00000000.00000000.00000000 | 536,870,910 |
| /4 | 240.0.0.0 | 15.255.255.255 | 11110000.00000000.00000000.00000000 | 268,435,454 |
| /5 | 248.0.0.0 | 7.255.255.255 | 11111000.00000000.00000000.00000000 | 134,217,726 |
| /6 | 252.0.0.0 | 3.255.255.255 | 11111100.00000000.00000000.00000000 | 67,108,862 |
| /7 | 254.0.0.0 | 1.255.255.255 | 11111110.00000000.00000000.00000000 | 33,554,430 |
| /8 | 255.0.0.0 | 0.255.255.255 | 11111111.00000000.00000000.00000000 | 16,777,214 |
| /9 | 255.128.0.0 | 0.127.255.255 | 11111111.10000000.00000000.00000000 | 8,388,606 |
| /10 | 255.192.0.0 | 0.63.255.255 | 11111111.11000000.00000000.00000000 | 4,194,302 |
| /11 | 255.224.0.0 | 0.31.255.255 | 11111111.11100000.00000000.00000000 | 2,097,150 |
| /12 | 255.240.0.0 | 0.15.255.255 | 11111111.11110000.00000000.00000000 | 1,048,574 |
| /13 | 255.248.0.0 | 0.7.255.255 | 11111111.11111000.00000000.00000000 | 524,286 |
| /14 | 255.252.0.0 | 0.3.255.255 | 11111111.11111100.00000000.00000000 | 262,142 |
| /15 | 255.254.0.0 | 0.1.255.255 | 11111111.11111110.00000000.00000000 | 131,070 |
| /16 | 255.255.0.0 | 0.0.255.255 | 11111111.11111111.00000000.00000000 | 65,534 |
| /17 | 255.255.128.0 | 0.0.127.255 | 11111111.11111111.10000000.00000000 | 32,766 |
| /18 | 255.255.192.0 | 0.0.63.255 | 11111111.11111111.11000000.00000000 | 16,382 |
| /19 | 255.255.224.0 | 0.0.31.255 | 11111111.11111111.11100000.00000000 | 8,190 |
| /20 | 255.255.240.0 | 0.0.15.255 | 11111111.11111111.11110000.00000000 | 4,094 |
| /21 | 255.255.248.0 | 0.0.7.255 | 11111111.11111111.11111000.00000000 | 2,046 |
| /22 | 255.255.252.0 | 0.0.3.255 | 11111111.11111111.11111100.00000000 | 1,022 |
| /23 | 255.255.254.0 | 0.0.1.255 | 11111111.11111111.11111110.00000000 | 510 |
| /24 | 255.255.255.0 | 0.0.0.255 | 11111111.11111111.11111111.00000000 | 254 |
| /25 | 255.255.255.128 | 0.0.0.127 | 11111111.11111111.11111111.10000000 | 126 |
| /26 | 255.255.255.192 | 0.0.0.63 | 11111111.11111111.11111111.11000000 | 62 |
| /27 | 255.255.255.224 | 0.0.0.31 | 11111111.11111111.11111111.11100000 | 30 |
| /28 | 255.255.255.240 | 0.0.0.15 | 11111111.11111111.11111111.11110000 | 14 |
| /29 | 255.255.255.248 | 0.0.0.7 | 11111111.11111111.11111111.11111000 | 6 |
| /30 | 255.255.255.252 | 0.0.0.3 | 11111111.11111111.11111111.11111100 | 2 |
| /31 | 255.255.255.254 | 0.0.0.1 | 11111111.11111111.11111111.11111110 | 2 |
| /32 | 255.255.255.255 | 0.0.0.0 | 11111111.11111111.11111111.11111111 | 1 |
Glossary
- CIDR
- Classless Inter-Domain Routing — the address/prefix-length notation (e.g. 192.168.1.0/24) that replaced fixed address classes; the prefix length says how many leading bits identify the network.
- Network address
- The lowest address in a subnet, with every host bit set to zero — identifies the subnet itself rather than any specific host on it.
- Broadcast address
- The highest address in a subnet, with every host bit set to one — traditionally used to reach every host on the subnet at once. /31 and /32 blocks have no broadcast address.
- Usable host range
- Every address in a subnet except the network and broadcast addresses — the addresses that can actually be assigned to a device. For /31 both addresses are usable; for /32 the single address is.
- Wildcard mask
- The bitwise complement of a netmask (e.g. 0.0.0.255 for /24), used in Cisco-style access control lists and firewall rules, where a 1 bit means “don’t care” instead of “must match”.
- VLSM
- Variable Length Subnet Masking — subdividing one network into subnets of different sizes, each sized to what it actually needs, instead of one fixed size for every subnet.
API equivalent
The subnet math above is computed entirely on your device — this page makes zero network requests to calculate any result on it, which is the whole point: your address plans never leave your browser. If you'd rather get network/broadcast facts about a real, routable IP address server-side as part of a larger lookup, the network group of our main API returns the same kind of facts:
curl "https://ip.xakki.pro/api/v1/ip?ip=9.9.9.9&include=network"
Example response (trimmed):
{
"schemaVersion": 15,
"status": "ok",
"ip": "9.9.9.9",
"version": 4,
"network": {
"asn": 19281,
"prefix": "9.9.9.0/24",
"registry": "arin"
}
}
Frequently asked questions
- What's the difference between a netmask and a prefix length?
- They're two notations for the same information. A prefix length like /24 counts how many leading bits are fixed as the network portion; a netmask like 255.255.255.0 writes those same fixed bits out in dotted-decimal form. This calculator's mask↔prefix table converts between both forms, and their binary representation, for every possible IPv4 prefix.
- How is the broadcast address calculated?
- Take the network address and set every host bit (every bit outside the prefix) to 1. For 192.168.1.0/24 the prefix covers the first 24 bits, leaving 8 host bits — setting all 8 to 1 gives 192.168.1.255. /31 and /32 blocks have no broadcast address by definition.
- Why would I split a subnet into equal parts instead of using VLSM?
- Equal splitting is simpler when every subnet genuinely needs the same size — for example dividing a /24 office network into four identical /26 floors. VLSM is for the more common case where subnets need different sizes (a 50-host department next to a 5-host lab), since giving everyone the largest required size wastes address space.
- Does this tool send my IP address or subnet plan anywhere?
- No. Every calculation on this page — the main result, the mask table, subnet splitting and the VLSM planner — runs entirely in your browser using plain arithmetic; nothing you type here is sent to our servers or anywhere else.
- Why do /31 and /32 have host counts of 2 and 1 instead of 0 and -1?
- A normal subnet reserves its lowest address (network) and highest address (broadcast), leaving the rest usable. RFC 3021 made an explicit exception for /31 point-to-point links, where reserving two addresses out of only two would leave zero usable — both are host-usable instead. A /32 has only one address total, which is the host itself.
- What happens if I request VLSM sizes that don't fit in the parent block?
- The planner reports an error instead of silently truncating or overlapping subnets — allocate a larger parent block (a smaller prefix number) or reduce one of the requested host counts, then try again.
Like this tool? Our API gives free accounts 1,000 requests/day.See the API docs →