IP Subnet Calculator
Enter an IPv4 address and a CIDR prefix and read the whole subnet live — network and broadcast, first and last usable host, host count, netmask, wildcard, and the network in binary, integer and hex.
Type a bare address and set the prefix below, or paste a full block like 10.0.0.0/24 — the slider follows.
Runs entirely in your browser. No address you type is uploaded or logged — the subnet maths uses a small committed library and works offline.
IPv6 block: broadcast, netmask and wildcard do not apply to IPv6, so those rows are hidden.
What a subnet actually is
Every IPv4 address is 32 bits, usually written as four decimal octets like 192.168.1.10. A subnet splits those 32 bits into two parts: a leading network portion that every device on the same link shares, and a trailing host portion that is unique to each device. The prefix length — the number after the slash in CIDR notation — is simply how many of the leading bits belong to the network. In 192.168.1.0/24 the /24 means the first 24 bits are the network, leaving the last 8 bits for hosts. Type any address and prefix above and the whole block is worked out as you go.
Reading CIDR notation
CIDR (Classless Inter-Domain Routing) replaced the old fixed Class A/B/C system in 1993 so that networks could be sized to fit rather than snapped to /8, /16 or /24. The notation address/prefix packs two facts into one string: where the block starts and how big it is. The block size is 2^(32 − prefix) total addresses, so each extra bit of prefix halves the block. That is the single most useful number to memorise:
The netmask is the same information written as an address: the prefix's leading one-bits filled in and the rest zero. A /24 is 255.255.255.0 because 24 one-bits is three full octets of 255 then a zero octet. The wildcard mask is the bitwise inverse (0.0.0.255 for a /24) — Cisco access lists and OSPF network statements use the wildcard where most other tools use the netmask, and mixing them up is a classic outage.
Worked example: 192.168.1.0/24
Take the block a home or small-office LAN almost always uses. The prefix is 24, so the network is the first 24 bits and the host part is the last 8. Setting all host bits to zero gives the network address 192.168.1.0 — the name of the subnet itself, never assigned to a machine. Setting all host bits to one gives the broadcast address 192.168.1.255, which reaches every host on the link at once. Everything strictly between them is usable:
So a /24 gives 254 usable addresses, not 256: the network and broadcast addresses are spoken for. That "minus two" is the rule for every prefix from /0 to /30.
Worked example: 10.0.0.0/30 point-to-point
When you connect two routers over a WAN link, only two addresses are ever needed — one for each end. A /30 is the traditional fit: 2^(32−30) = 4 total addresses, minus the network and broadcast, leaves exactly 2 usable hosts.
Modern practice increasingly uses a /31 instead (see below), which squeezes the same link into just two addresses with no waste — but plenty of gear and habits still reach for the /30.
Common mistakes
The usable-host off-by-one. The most frequent slip is quoting 2^(32 − prefix) as the number of assignable hosts and forgetting to subtract two for the network and broadcast addresses. A /26 has 64 addresses but only 62 hosts; a /28 has 16 but only 14. If you hand out .0 or the top address as a host address you will get intermittent, maddening failures.
Assuming /31 gives zero hosts. By the "minus two" rule a /31 (2 addresses) would have no usable hosts, which once made it useless. RFC 3021 fixed this for point-to-point links: on a /31 there is no network or broadcast reservation, so both addresses are usable. This calculator follows RFC 3021 — a /31 reports 2 usable hosts and a /32 reports 1 (a single-host "host route", common in loopbacks and firewall rules). If a device still refuses a /31 on a link, it simply predates the RFC.
Confusing netmask and wildcard. 255.255.255.0 and 0.0.0.255 describe the same /24, but a Cisco ACL wants the wildcard and a host's IP config wants the netmask. Feeding one where the other is expected silently matches the wrong range. Picking a host address as the network address. 192.168.1.10/24 is a perfectly valid host in the block, but the block's network address is still 192.168.1.0; this tool masks the host bits off for you so the network, broadcast and range are always correct no matter which address in the block you type.
Honest limits
This is an IPv4 subnet calculator first. The underlying library can parse a basic IPv6 CIDR and the tool will show its network, first and last address and total size, but IPv6 has no broadcast address and no netmask or wildcard, so those rows are hidden for a v6 block — and IPv6's /64 host boundary and address compression really deserve their own dedicated tool. It also does not know which addresses in a block are already assigned, whether an address is public or private (RFC 1918), or how your routing is configured; it reports the arithmetic of the block, which is exactly the part that is easy to get wrong by hand.
Learn the math behind it
Want to understand where these numbers come from, so you can size a subnet without a calculator? Learn more: CIDR subnetting explained — a worked guide to prefixes, netmasks, the network/broadcast/usable-host math, private ranges, and real "how many hosts do I need?" scenarios.