CIDR and subnet calculator
Type an IPv4 CIDR block to get its network and broadcast addresses, usable host range and netmask, check whether an address falls inside it, or split it into smaller subnets. IPv4 only — see Known limitations. Runs entirely in your browser.
| Field | Value | Binary |
|---|---|---|
| Nothing to calculate yet. | ||
Enter an address above.
| # | Subnet | Range |
|---|---|---|
| Enter a new prefix length to split. | ||
About this tool
Type a CIDR block — an IPv4 address followed by a slash and a prefix length, like 192.168.1.0/24 — and this page works out every commonly-needed value: the network and broadcast addresses, netmask, wildcard mask, and the range of addresses actually usable by hosts. A separate field checks whether a specific address falls inside the block, and a third splits it into a chosen number of smaller, equally-sized subnets.
How it works
Everything here is direct binary arithmetic on the address as a 32-bit unsigned integer — bitwise AND for the network address, bitwise OR with the inverted mask (the wildcard mask) for the broadcast address — the exact operations a router or an ipcalc-style tool performs, not a lookup table or an approximation.
Two prefix lengths get special-cased on purpose, not as an oversight: a /31 has no network or broadcast address to reserve — RFC 3021 defines both of its two addresses as usable, for point-to-point links where wasting two of only four addresses would be significant. A /32 is a single host — the "network" and "usable range" are that one address. Both are handled explicitly rather than falling out of the general formula, which would otherwise report zero or negative usable hosts for them.
Common questions
Why does my /24 show 254 usable hosts, not 256?
A /24 has 256 total addresses, but the first (the network address) and the last (the broadcast address) are reserved and not assignable to a host — leaving 254. This page shows both the total address count and the usable count separately so the distinction is explicit rather than a source of off-by-two errors.
What happens if I split into more subnets than fit?
Splitting requires the new prefix to be at least as long as the original — you cannot split a /24 into /16s, since that would be growing the block, not dividing it. Asking for a new prefix shorter than the original is rejected with a clear message rather than producing a wrong or negative subnet count.
Known limitations
IPv4 onlyIPv6 subnetting works on 128-bit addresses and different conventions (no broadcast address, for one) — genuinely a different calculator, not an extension of this one, and not built here.Subnet list is cappedSplitting into a very large number of subnets (beyond 4096) stops there with a note, rather than trying to render tens of thousands of table rows.
The same job at the command line
ipcalc 192.168.1.0/24The classic Unix subnet calculator — not installed by default on most distributions, but widely packaged.python3 -c "import ipaddress; n=ipaddress.ip_network('192.168.1.0/24'); print(n.network_address, n.broadcast_address)"Python's standard-libraryipaddressmodule.sipcalc 192.168.1.0/24A more detailed alternative toipcalc, also IPv6-aware.
More tools
See the whole toolbox — thirty-seven free tools planned, all running in your browser.