Get online today — Domain + Hosting at discounted prices View Combo Offers ›

IPv4 Subnet Calculator

Work out network address, broadcast, usable host range and mask from any CIDR.

You can paste CIDR notation directly, e.g. 10.0.0.0/16.

Enter an IPv4 address with a CIDR prefix — for example 192.168.1.10/24 — to see the network address, broadcast address, usable host range, subnet mask, wildcard mask and total host count.

The binary breakdown is shown alongside, because seeing exactly where the mask divides network bits from host bits is usually what makes subnetting click.

How it works

An IPv4 address is 32 bits. The prefix length after the slash says how many of those leading bits identify the network; the rest identify a host within it. A /24 reserves 24 bits for the network and leaves 8 for hosts, which is why it holds 256 addresses.

Within any block, two addresses are not usable as hosts:

  • The network address — all host bits zero — names the subnet itself.
  • The broadcast address — all host bits one — reaches every host on the subnet at once.

So a /24 gives 256 total addresses but only 254 usable ones. This is the arithmetic behind the familiar sizes: /24 is 254 hosts, /25 is 126, /26 is 62, /27 is 30, /28 is 14.

Two prefixes behave as special cases. A /31 has no room for network and broadcast addresses at all; RFC 3021 permits it on point-to-point links where both addresses are simply used as hosts. A /32 describes exactly one address, which is how you write a single-host route or firewall rule.

The wildcard mask is the bitwise inverse of the subnet mask. It appears in Cisco access lists and some routing protocols, where a 0 bit means "must match" and a 1 bit means "ignore".

Frequently asked questions

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

The first address in the block is the network address and the last is the broadcast address. Neither can be assigned to a host, so 256 total addresses give 254 usable ones.

What is the difference between a subnet mask and a wildcard mask?

They are bitwise inverses. A subnet mask like 255.255.255.0 marks network bits with 1s; the wildcard 0.0.0.255 marks the bits to ignore. Cisco access lists use wildcard masks, which is the usual reason people need to convert.

Can I really use a /31?

Yes, on point-to-point links. RFC 3021 allows both addresses in a /31 to be used as hosts, since there is nowhere for a broadcast address to live and none is needed. It saves two addresses per link, which adds up across a large network.

How do I pick a prefix for a given number of hosts?

Find the smallest power of two that is at least your host count plus two. For 50 hosts you need 52 addresses, so a /26 (64 addresses, 62 usable). Leave headroom — resizing a subnet later means renumbering.

Which ranges are private?

10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16 are private (RFC 1918). Also reserved: 127.0.0.0/8 for loopback, 169.254.0.0/16 for link-local, and 100.64.0.0/10 for carrier-grade NAT. The calculator flags these.

Does this handle IPv6?

Not this tool — IPv6 subnetting works on 128 bits with different conventions, and has its own calculator. IPv6 subnets are also almost always /64, which makes the arithmetic far less interesting.

Related tools

Need hosting that just works?

Free SSL, daily backups and 24×7 support on every Loudhost plan.

View Hosting Plans