Subnet Calculator

Calculate network address, broadcast, usable host range, netmask and wildcard from any IPv4 CIDR — with the binary breakdown shown. Free, no sign-up — runs locally in your browser.

What is a subnet, and what does this calculator do?

An IPv4 address is 32 bits, and every network splits them into two parts: a prefix that names the network, and the remaining bits that name a host inside it. A subnet is what you get when you fix the prefix: all addresses sharing it can talk to each other directly, and reaching anything outside it means going through a router. This calculator takes any address and prefix — typed as 192.168.1.10/24, or as an address plus a dotted netmask — and works out everything that follows from that split: the network address, the broadcast address, the first and last assignable host, how many addresses exist and how many you can actually use, the netmask and wildcard mask, and whether the address lives in a private, loopback, link-local or public range. It is the arithmetic every network design starts with, done without the bit-twiddling by hand.

How to use this tool

  1. Type an IPv4 address and a prefix length — or leave the prefix blank and give a dotted netmask such as 255.255.255.192 instead.
  2. Press Calculate. The page opens pre-filled with 192.168.1.10/24, the classic home-network example, already calculated.
  3. Read the table top to bottom: the network and broadcast rows bound the subnet; the usable range between them is what DHCP hands out and what you may assign statically.
  4. The binary view shows the address and mask bit by bit — the fastest way to see where the network part ends and the host part begins.

The maths, once, carefully

Everything follows from one AND operation. The netmask for a prefix of length p is p one-bits followed by 32−p zero-bits. AND the address with the mask and you get the network address; OR it with the inverted mask (the wildcard) and you get the broadcast address. The subnet contains 232−p addresses, from network to broadcast inclusive. Two of them are spoken for in the classic rules — the network address identifies the subnet itself, and the broadcast address reaches every host at once — leaving 232−p − 2 usable, which is why capacities always land two short of a round power of two: a /24 has 254 usable addresses, a /30 only 2. Modern practice made two exceptions, both implemented here: on a /31 point-to-point link there is no broadcast and RFC 3021 allows both addresses as hosts, and a /32 is a route to exactly one host.

The other thing the split decides is size versus count. Every bit you move from the host part to the network part doubles the number of subnets and halves each one: carving a /24 into /26s yields four subnets of 62 usable hosts each. Choosing a prefix is therefore always a bet about the future — too large wastes addresses you can never reclaim without renumbering, too small runs out at the worst possible moment. Calculating the real numbers, rather than the remembered ones, is the entire point of the tool.

Examples

192.168.1.10/24 — the address most home routers hand out: network 192.168.1.0, broadcast 192.168.1.255, usable range 192.168.1.1 – 192.168.1.254, netmask 255.255.255.0, in the private RFC 1918 range. 10.20.30.40/30 — a transit link between two routers: network 10.20.30.40, broadcast 10.20.30.43, and exactly two usable addresses, which is all a point-to-point link needs. 203.0.113.7/32 — a single public host: network, broadcast, first and last host are all the same address.

Frequently asked questions

What does /24 actually mean?

It is CIDR notation: the number after the slash is how many of the 32 bits of the IPv4 address are the network prefix — the fixed part every address in the subnet shares. /24 means 24 network bits and 8 host bits, so the subnet holds 2^8 = 256 addresses. The same information is written as the netmask 255.255.255.0: 24 one-bits followed by 8 zero-bits.

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

Two addresses in every classic subnet are reserved: the first (all host bits zero) names the network itself, and the last (all host bits one) is the broadcast address. 256 − 2 = 254 addresses remain for devices. The exceptions are /31, where RFC 3021 allows both addresses on a point-to-point link, and /32, a single host route — this calculator follows both conventions.

What is a wildcard mask?

The bitwise inverse of the netmask: where the netmask has 1s the wildcard has 0s and vice versa. A /24 has netmask 255.255.255.0 and wildcard 0.0.0.255. Wildcard masks appear in Cisco ACLs and some routing protocols (OSPF) — they answer the question "which bits do I ignore when matching?" instead of "which bits are the network?".

Which ranges are private, and can they appear on the internet?

RFC 1918 reserves 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16 for private networks; routers on the public internet do not forward them, which is why every home network can reuse 192.168.1.0/24 without colliding. Also special: 127.0.0.0/8 is loopback, and 169.254.0.0/16 is link-local (the self-assigned addresses a device gives itself when DHCP fails). This calculator labels the range type of the address you enter.

Can I enter a subnet mask instead of a prefix?

Yes — type a dotted mask such as 255.255.255.192 into the netmask field and leave the prefix blank, or fill either one; the calculator converts between them. A mask whose 1-bits are not contiguous (like 255.0.255.0) is rejected, because no prefix length corresponds to it — such masks cannot be written in CIDR notation at all.

Does this tool work for IPv6?

Not yet. IPv6 subnetting uses the same prefix idea but 128-bit addresses, no broadcast address and different conventions for the usable range, so it deserves its own calculator rather than a checkbox here. Everything on this page is IPv4.

Related tools

Related guides