Subnet Calculator

Enter any IPv4 address with a CIDR prefix, such as 192.168.1.10/24, and get the full subnet breakdown instantly. All maths happens locally in your browser.

Calculate a subnet

What is a subnet, and why divide a network at all?

An IPv4 address is 32 bits long, conventionally written as four decimal numbers such as 192.168.1.10. Every address silently answers two questions at once: which network does this device belong to, and which device is it on that network? Subnetting is the act of drawing that dividing line deliberately. Smaller subnets contain broadcasts, organise departments or floors of a building, separate guest Wi-Fi from company servers, and let firewalls apply different rules to different groups.

CIDR notation and the netmask

The slash number in CIDR notation — the /24 in 192.168.1.10/24 — is the prefix length: the number of leading bits, counted from the left, that identify the network. The remaining bits identify individual hosts. A /24 therefore leaves 8 host bits and 256 addresses; a /16 leaves 16 host bits and 65,536 addresses. The same prefix can be written as a netmask, a 32-bit value of continuous ones followed by continuous zeros: /24 is 255.255.255.0, because each 255 is eight one-bits. The wildcard mask is the exact inverse — 0.0.0.255 for a /24 — and appears in firewall and routing access lists, where it marks which bits should be ignored when matching.

Network, broadcast, and usable hosts

Two addresses in every conventional subnet are reserved. The network address has all host bits set to zero and names the subnet itself; routers use it in their tables. The broadcast address has all host bits set to one, and traffic sent to it reaches every host in the subnet. Everything between them is assignable, so a /24 offers 254 usable hosts, from 192.168.1.1 to 192.168.1.254, between network 192.168.1.0 and broadcast 192.168.1.255. The total address count is always 2 raised to the number of host bits, and the traditional usable count is that total minus two. Two prefixes break the pattern. A /31 has just two addresses, and under RFC 3021 both may be used on a point-to-point link between two routers, where broadcast is meaningless. A /32 is a single host route: network, broadcast, first and last address are all the same address, and it is used to pin traffic to exactly one destination.

A worked example

Take 10.0.5.23/20. The /20 netmask is 255.255.240.0, so the third octet moves in blocks of 16. The address falls in the block starting at 0, giving a network address of 10.0.0.0 and a broadcast of 10.0.15.255. Hosts run from 10.0.0.1 to 10.0.15.254 — 4,096 addresses in total, 4,094 of them usable. Try it with the example button above and compare each row.

How to use this calculator

Type an IPv4 address and prefix, then press Calculate. The tool validates each octet (0–255) and the prefix (0–32) before doing any maths, and it computes with unsigned 32-bit arithmetic so results stay correct even for addresses above 128.0.0.0, where naive signed calculations flip negative. Nothing you type is sent anywhere; the calculation is pure client-side arithmetic, so feel free to use real internal addresses.

Frequently asked questions

What does /24 mean in plain English?

It means the first 24 bits of the address identify the network and the last 8 bits identify hosts, giving 256 addresses of which 254 are normally usable.

Why are two addresses always “missing”?

The all-zeros host part is the network address and the all-ones host part is the broadcast address. Neither is assigned to a device on a conventional subnet, except on /31 point-to-point links and /32 host routes.

Can two devices with different subnet masks still talk?

Only if each one believes the other is reachable — directly, or via a gateway. Mismatched masks are a classic cause of “can ping one way but not back” faults, so checking both ends with this calculator is a good first step.

Does this calculator support IPv6?

Not yet. IPv6 uses 128-bit addresses and a related but larger notation; the IPv4 maths shown here covers the private and public IPv4 networks most people configure day to day.

Related tools