CalcOak

IP Subnet Calculator: network, broadcast, host range and mask for any CIDR block

Binary view (network bits highlighted)

Split into smaller subnets

#NetworkUsable rangeBroadcastHosts

How to use the subnet calculator

Type an address in CIDR form such as 10.20.30.40/22, or type the address on its own and pick the prefix or the dotted mask from the menus; the two menus mirror each other, so choosing 255.255.240.0 sets /20 and vice versa. The results update as you type. The cards show the network and broadcast addresses, the first and last usable host, the usable and total counts, the wildcard mask used in Cisco access lists, and the address as a 32-bit integer and in hex. A line above the cards tells you the class and whether the address falls in a private, loopback, link-local, CGNAT, multicast or documentation range.

The binary table lays out the address, mask, network and broadcast bit by bit with the network portion shaded, which is the quickest way to see why 192.168.1.130/25 lands in the upper half of the /24. Under "split into smaller subnets" choose a longer prefix to carve the block up: a /24 into four /26s, a /16 into 256 /24s, and so on. The table lists each child network with its usable range and broadcast, and the Download CSV button saves the full list even when the page only displays the first 256 rows. Switch to the IPv6 tab for compressed and expanded forms, the network prefix, the first and last address of the block and the address type.

Why use it

Subnetting mistakes are cheap to make and expensive to find. An access list written with a subnet mask instead of a wildcard, a DHCP scope that starts one address too early, or two VLANs that quietly overlap because someone assumed a /23 ended at .255 can each cost an afternoon of troubleshooting. Checking the boundaries here before committing a change takes seconds and removes the guesswork from the arithmetic.

It is also a practical study aid. If you are preparing for a networking exam, work the example on paper first, then compare your answer with the binary view to see exactly which bit you got wrong. All of the calculation runs in your browser with unsigned 32-bit integer maths for IPv4 and 128-bit BigInt maths for IPv6, so nothing you type is sent anywhere and the page keeps working offline once it has loaded.

Frequently asked questions

What is the difference between a subnet mask and a CIDR prefix?+

They describe the same thing in two notations. A prefix such as /24 says the first 24 bits of the address identify the network; the dotted mask 255.255.255.0 is those same 24 one-bits written as four decimal octets. Every valid mask has contiguous ones followed by zeros, which is why the two selectors on this page always stay in step with each other.

Why does a /24 have 254 usable hosts and not 256?+

A /24 contains 256 addresses, but the lowest one is the network address and the highest is the broadcast address, and neither can be assigned to a device. That leaves 254. The same two are subtracted from every ordinary subnet, so a /30 has 4 addresses and only 2 usable ones.

How can a /31 have two usable hosts?+

RFC 3021 allows point-to-point links to use a /31 with no network or broadcast address, so both addresses are assigned to the two ends of the link. Routers from all major vendors support this and it halves the address cost of WAN links compared with a /30. A /32 is a single host route and is shown here as one usable address.

Is the address I typed private or public?+

The classification line tells you. 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16 are the RFC 1918 private ranges, 100.64.0.0/10 is carrier-grade NAT space used by ISPs, 169.254.0.0/16 is link-local, 127.0.0.0/8 is loopback and 224.0.0.0/4 is multicast. Anything outside those and the other reserved blocks is treated as public.

Why does the IPv6 tab show host counts as a power of two?+

A /64 contains 18,446,744,073,709,551,616 addresses, and a /48 contains 65,536 times more. Numbers that size are easier to reason about as 2^64 or 2^80, so the tool shows the exponent first and the exact figure underneath. IPv6 has no broadcast address, so every address in the block is shown as part of the range.