IPv4 Subnet Calculator (CIDR and Netmask)

Enter an IP address with a prefix like /24 or a netmask to get the network, broadcast, wildcard mask, host range and usable host count.

Enter an IPv4 address

You can also type 192.168.1.0/24 or 192.168.1.10 255.255.255.0 in the first box.

How to use the subnet calculator

  1. Type an IPv4 address into IP address (optionally with /prefix or netmask). You can paste 192.168.1.0/24 or 192.168.1.10 255.255.255.0 and the prefix box follows along.
  2. Or leave the address bare and pick a length in Prefix length (CIDR). Each option shows its netmask, such as /24 (255.255.255.0).
  3. Read the results, then press Copy results to paste them into a ticket or config.
  4. To plan smaller networks, choose a size in Split into smaller subnets. The tool lists each subnet with its host range and broadcast address (the first 64 when there are more).

How the numbers are calculated

An IPv4 address is a 32-bit number and the prefix says how many leading bits name the network (RFC 4632). The netmask is that many 1 bits followed by 0 bits. The network address is the IP address AND the netmask. The broadcast address is the network address OR the inverted mask, which is also the wildcard mask. Total addresses are 2 to the power of (32 minus the prefix). Usable hosts are the total minus two, because the network and broadcast addresses cannot be assigned. Two prefixes are special: a /31 has 2 usable hosts for point-to-point links (RFC 3021), and a /32 is one host.

Worked example

The default input is 192.168.1.10 with /24. The tool shows CIDR notation 192.168.1.0/24, Netmask 255.255.255.0, Wildcard mask 0.0.0.255, Network address 192.168.1.0 and Broadcast address 192.168.1.255. The First usable host is 192.168.1.1 and the Last usable host is 192.168.1.254. Total addresses are 256 and Usable hosts are 254. The address type is Private (RFC 1918), the class is Class C, and the netmask in binary is 11111111.11111111.11111111.00000000. Choose /26 in the split box and you get four subnets: 192.168.1.0/26, 192.168.1.64/26, 192.168.1.128/26 and 192.168.1.192/26, each with 62 usable hosts.

Limits and edge cases

Related tools: MAC address lookup names the maker of a network card, port lookup explains common port numbers, and the number base converter turns octets into binary or hex.

Frequently asked questions

How many usable hosts are in a /24?

A /24 has 256 addresses and 254 usable hosts. Two addresses are reserved: the network address (all host bits 0) and the broadcast address (all host bits 1).

What subnet mask is /27?

A /27 uses the netmask 255.255.255.224. It has 32 addresses and 30 usable hosts, and the subnets start every 32 addresses (for example 192.168.1.0, 192.168.1.32 and 192.168.1.64).

What is a wildcard mask?

A wildcard mask is the netmask with every bit flipped. For /24 the netmask is 255.255.255.0 and the wildcard mask is 0.0.0.255. Cisco access lists and OSPF network statements use it to say which address bits may vary.

Why does a /31 show 2 usable hosts?

RFC 3021 lets a point-to-point link use both addresses of a /31 because there is no need for a network or broadcast address. A /32 is a single host route with one usable address.

Does this calculator support IPv6?

No. It covers IPv4 only. IPv6 subnets are almost always a /64 for a single LAN, with a /48 or /56 assigned to a site, so there is little host counting to do.

Sources: RFC 4632 (CIDR), RFC 3021 (/31 links), RFC 1918 (private addresses).