calculatorkong

Subnet Calculator

Try:

Usable hosts

Network

Broadcast

First – last usable

Subnet mask

Binary view

CIDR arithmetic
network = IP AND mask · broadcast = network OR NOT mask · hosts = 2^(32−n) − 2

Every IPv4 address is a 32-bit number wearing dotted decimals, and a subnet is just a split point: the first n bits name the network, the rest name hosts. From that one split, everything else is bitwise arithmetic — which this calculator performs and shows in binary.

The /24 worked example

192.168.1.10/24: the mask is 255.255.255.0, ANDing gives network 192.168.1.0, ORing the inverted mask gives broadcast 192.168.1.255, and hosts .1 through .254 — 254 usable — live between. The two reserved endpoints are the price every ordinary subnet pays.

Reading prefixes at a glance

Each prefix step halves the network: /25 = 126 hosts, /26 = 62, /27 = 30, /28 = 14. Going the other way, /16 holds 65,534 and the whole 10.0.0.0/8 private block over 16 million. The binary expander makes the split visible — network bits bright, host bits dimmed.

The special cases people forget

/31 breaks the minus-two rule on purpose: RFC 3021 defines both addresses usable for point-to-point router links, where broadcast is meaningless. /32 is a single-host route — the notation firewalls and routing tables use to mean "exactly this machine." The calculator labels both instead of reporting a nonsensical "0 usable hosts."

Private ranges and neighbors

RFC 1918 reserves 10/8, 172.16/12 and 192.168/16 for private networks — the presets cover all three families. The bit manipulation underneath is plain base-2 arithmetic: see it standalone in the number base converter and the binary translator.

IPv4 only; all math is exact 32-bit bitwise arithmetic.

Frequently Asked Questions

What does /24 mean in CIDR notation? +

The first 24 of 32 bits identify the network; the remaining 8 identify hosts. A /24 holds 2⁸ = 256 addresses — 254 usable after network and broadcast.

How do I calculate usable hosts? +

2^(32 − prefix) − 2: subtract the network address (all host bits 0) and broadcast (all host bits 1). A /26 gives 64 − 2 = 62 usable hosts.

What is the network address? +

The IP with all host bits zeroed — computed by ANDing the address with the mask. It names the subnet itself and cannot be assigned to a device.

What is the broadcast address? +

The IP with all host bits set to one — packets sent to it reach every host on the subnet. Also unassignable to devices.

What are /31 and /32 used for? +

/31 (RFC 3021) has exactly two addresses, both usable — designed for point-to-point router links. /32 is a single host route: one address, commonly used in routing tables and firewall rules.

What are the private IP ranges? +

RFC 1918 reserves 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16 for private networks — the addresses behind home and office routers, never routed on the public internet.

Powered by Calculator Kong ↗

Related Calculators