IP Subnet Calculator
192.168.1.0/24 · 192.168.1.1 – 192.168.1.254
- Network
- 192.168.1.0
- Broadcast
- 192.168.1.255
- First host
- 192.168.1.1
- Last host
- 192.168.1.254
- Subnet mask
- 255.255.255.0
- Wildcard mask
- 0.0.0.255
- CIDR
- /24
- Total addresses
- 256
How to calculate a subnet from an IP address and mask
Enter an address with a prefix (192.168.1.10/24), a dotted mask (192.168.1.10 255.255.255.0) or a hex mask (192.168.1.10/0xffffff00). The network address is the IP AND the mask, the broadcast address is the network OR the wildcard mask, and a /N block holds 2^(32−N) addresses, of which 2^(32−N) − 2 are usable hosts. For 192.168.1.10/24 that gives network 192.168.1.0, broadcast 192.168.1.255, hosts 192.168.1.1–192.168.1.254 and 254 usable hosts. The result also shows the wildcard mask, IP class, address scope (private, public, CGNAT, loopback and so on) and the network address in binary with the prefix bits highlighted. Two cases do not subtract 2: a /31 has 2 usable addresses for point-to-point links (RFC 3021) and a /32 is a single host route.
IPv6 prefix calculation
For an IPv6 prefix such as 2001:db8::1/64 you get the first and last address, the total number of addresses, the number of interface ID bits, and the address in both RFC 5952 compressed form and full 128-bit expanded form. IPv6 has no broadcast address (RFC 4291 §2.1), so none is shown. A /64 is the standard size for one LAN; /127 is marked as a router-to-router link (RFC 6164) and /128 as a single address.
How to split a network into subnets (VLSM)
VLSM mode divides an IPv4 parent block into subnets sized for each requirement. Enter the parent CIDR and one row per subnet with a name and host count. Requirements are allocated largest first, each in the smallest block that fits hosts + 2 addresses and aligned to its own size; a 2-host link gets a /31 and a single host a /32. Example: 10.0.0.0/24 with sales 50, eng 25 and dmz 10 gives 10.0.0.0/26 (62 usable), 10.0.0.64/27 (30) and 10.0.0.96/28 (14), using 112 of 256 addresses. The table shows each subnet's mask, host range, broadcast and unused hosts.
CIDR aggregation (supernet)
Aggregate mode takes up to 256 IPv4 or IPv6 CIDRs, one per line, and returns the smallest single prefix that covers all of them (RFC 4632). It also counts the gap addresses inside that prefix that none of your inputs cover, and labels each input as exact, contained or overlapping. 10.0.0.0/24 and 10.0.1.0/24 aggregate to 10.0.0.0/23 with no gaps; 10.0.0.0/24 and 10.0.2.0/24 need 10.0.0.0/22, which leaves 512 gap addresses.
How to use the IP subnet calculator
- Pick a mode: Choose IPv4, IPv6, VLSM or Aggregate from the tabs.
- Enter an address: Type a CIDR such as 192.168.1.10/24, an address with a dotted or hex mask, a parent block and host counts for VLSM, or a list of CIDRs to aggregate.
- Read the result: Network, broadcast, host range, usable hosts, masks and scope update as you type.
- Copy the summary: Click Copy to copy the result as plain text.
Subnet calculator FAQ
How many usable hosts are in a /24, /26 or /28?
Usable hosts = 2^(32 − prefix) − 2. Common sizes: /24 (255.255.255.0) has 254, /25 (255.255.255.128) 126, /26 (255.255.255.192) 62, /27 (255.255.255.224) 30, /28 (255.255.255.240) 14, /29 (255.255.255.248) 6 and /30 (255.255.255.252) 2. The two subtracted addresses are the network address and the broadcast address.
What subnet size do I need for 50 hosts?
Add 2 for the network and broadcast addresses, then round up to the next power of two: 50 + 2 = 52, which fits in 64 addresses, so a /26 with 62 usable hosts. 100 hosts need a /25 (126 usable) and 200 hosts a /24 (254 usable). VLSM mode applies the same rule to a list of requirements.
Why does a /31 have 2 usable hosts?
RFC 3021 (2000) allows 31-bit prefixes on IPv4 point-to-point links. A link has only two ends, so no network or broadcast address is needed and both addresses can be assigned. A tool that always subtracts 2 reports 0 usable hosts for a /31.
Why is there no broadcast address in IPv6?
IPv6 does not have broadcast addresses (RFC 4291 §2.1). Functions that use broadcast in IPv4, such as finding neighbours, use multicast instead, for example ff02::1 for all nodes on a link. The last address of an IPv6 prefix is an ordinary address.
What is a wildcard mask?
The bitwise inverse of the subnet mask, used in Cisco ACLs and OSPF network statements: 255.255.255.0 becomes 0.0.0.255. It works for any prefix length, so a /27 (255.255.255.224) has the wildcard 0.0.0.31.
How do I tell if an IP address is private or public?
The private ranges in RFC 1918 are 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16. 100.64.0.0/10 is shared address space for carrier-grade NAT (RFC 6598), 127.0.0.0/8 is loopback and 169.254.0.0/16 is link-local. Enter any address and the scope label in the result shows which range it belongs to; for IPv6 it identifies global unicast, unique local (fc00::/7), link-local and other ranges.
Related tools
Related articles
- Your Subnet Calculator Says /31 Has 0 Usable Hosts. RFC 3021 Says 2.
/31 has 2 usable hosts (RFC 3021), /32 has 1, IPv6 has no broadcast, and IPv6 point-to-point uses /127. Four subnet calculator errors, checked against the RFCs.