Subnet Calculator

Classless addressing writes a network as an address plus a slash — 192.168.1.0/24 — and those characters decide where the network starts, where the broadcast ends and which addresses devices may take. Engineers plan office, Wi-Fi and cloud subnets this way, and students meet it in every networking exam. Enter four octets and a prefix; the page masks and flips its way to the five classic answers.

Enter values

The number after the slash in CIDR notation — /24 is the common home-network mask

Results update as you type.

Results

Network address
192.168.1.0
Broadcast address
192.168.1.255
Subnet mask
255.255.255.0
Usable host addresses
254
Assignable range
192.168.1.1 – 192.168.1.254

How is the Subnet calculated?

Five inputs: the four octets of the address, each 0 to 255, and the prefix length 0 to 32 — the number after the slash. Behind the scenes the octets pack into a 32-bit number, the prefix becomes that many leading 1-bits, and masking gives the network address; flipping the host bits gives the broadcast. Five rows report the network, broadcast, dotted-decimal mask, usable host count and assignable range. A /31 reports no assignable range; a /32 shows a single host.

Formula

mask = prefix ones followed by zeros · network = address AND mask · broadcast = network OR (bits outside the mask) · usable hosts = 2^(32 − prefix) − 2

where prefix is the slash number, 0 to 32. A /24 mask is 255.255.255.0 — 24 ones and 8 zeros — giving 2⁸ = 256 addresses, leaving 254 assignable. Prefixes /31 and /32 are clamped specially.

Example

192.168.1.100 with a /24 prefix: the mask 255.255.255.0 zeroes the last octet, so the network reads 192.168.1.0 and the broadcast 192.168.1.255. That is 256 addresses minus the two reserved, leaving 254 usable from 192.168.1.1 to 192.168.1.254. Tighten the prefix to /26 and the mask becomes 255.255.255.192: blocks shrink to 64 addresses with 62 usable, and the same address now sits inside the 192.168.1.64 block.

Things to remember

The two reserved addresses are the traditional rule: point-to-point links may use both under RFC 3021, which is why a /31 shows no range yet still works. Private space — 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16 — is where most planners meet subnets, and halving the prefix doubles every block.

Frequently Asked Questions

What does the number after the slash mean in CIDR?

The prefix length: how many of the address's 32 bits belong to the network rather than the host. /24 means 24 network bits and 8 host bits, so 256 addresses per block, while /26 leaves 6 host bits and 64 addresses. The mask is simply that many 1-bits followed by 0-bits.

How many usable hosts are in a /24 subnet?

254. Eight host bits give 2⁸ = 256 addresses, but the first is the network address and the last the broadcast, so 256 − 2 = 254 remain assignable — 192.168.1.1 through 192.168.1.254 in the usual home range, which is exactly what this calculator prints.

Why does a /31 subnet show no assignable range?

One host bit leaves only two addresses, and the traditional rule reserves both — network and broadcast — for nothing else. RFC 3021 deliberately reuses the pair on point-to-point links, one address per end, so the page reports the traditional answer while the range still functions in modern routing.

What subnet mask does a /26 prefix produce?

255.255.255.192. A /26 keeps 24 network bits in the first three octets plus 2 in the last, where 11000000 equals 192. Each block therefore holds 64 addresses with 62 usable, and four such blocks divide a /24 into equal quarters at .0, .64, .128 and .192.

More Technology & Data calculators

See all 5 Technology & Data calculators