IP Subnet Calculator: IPv4 CIDR Mask, Host Range, Wildcard

Enter an IPv4 address and a CIDR prefix to get the network and broadcast addresses, usable host range, subnet mask, wildcard mask, binary view, class and address type.

Analysing an IPv4 address: network, private scope and CIDR mask

The network address is a bitwise AND of the IP address and the mask; the broadcast address sets every host bit to 1. A /n prefix holds 2^(32−n) addresses, 2 of them reserved up to /30. The tool also tells you whether the address is private (RFC 1918), loopback, link-local or public, and shows the mask in binary and hexadecimal.

This page is for qualifying a given address: which network it belongs to, whether it is routable on the Internet and how its mask is written in a firewall rule or a script. It also gives the wildcard mask used in ACLs, and the presets from /8 to /30 help when splitting a network into subnets.

Method

  • Mask = n bits set to 1 followed by 32 − n zeros; wildcard mask = its inverse.
  • Network = IP AND mask; broadcast = network OR wildcard.
  • Usable hosts = 2^(32−n) − 2 up to /30; 2 for a /31 (point-to-point link, RFC 3021); 1 for a /32.

Example

For 172.20.45.10/20 the mask is 255.255.240.0, i.e. 0xFFFFF000 (11111111.11111111.11110000.00000000). The network is 172.20.32.0 and the broadcast 172.20.47.255: 4,096 addresses, 4,094 of them hosts, from 172.20.32.1 to 172.20.47.254. First octet 172: historical class B. The second octet, 20, lies between 16 and 31, so the address is private, in 172.16.0.0/12. With /31, 10.0.0.6 gives the pair 10.0.0.6 and 10.0.0.7, both usable.

What the tool recognises

  • Private RFC 1918: 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16.
  • Loopback 127.0.0.0/8 and link-local 169.254.0.0/16 (self-assigned when DHCP fails).
  • Carrier-grade shared space (CGNAT) 100.64.0.0/10, RFC 6598. Everything else shows as public: documentation blocks and multicast get no label of their own.
  • Class A to E comes from the first octet; it plays no part in routing since CIDR but helps when reading old configurations.

Sources and dates: RFC 4632 on CIDR (August 2006), RFC 1918 on private addressing (February 1996), RFC 3021 on /31 prefixes (December 2000), RFC 3927 for 169.254.0.0/16 (May 2005), RFC 6598 for 100.64.0.0/10 (April 2012), as listed in the IANA IPv4 special-purpose address registry updated on 9 October 2025 (checked 14/10/2026).

Frequently Asked Questions

How can I tell if an IP address is private?

It is private if it falls in one of the three RFC 1918 blocks: 10.0.0.0/8, 172.16.0.0/12 (172.16 to 172.31) or 192.168.0.0/16. These addresses are not routed on the Internet and go out through address translation (NAT). 127.x.x.x (loopback) and 169.254.x.x (link-local) are not routable either.

How many hosts are in a /20 network?

A /20 leaves 12 host bits, so 2^12 = 4,096 addresses. Removing the network and broadcast addresses leaves 4,094 usable hosts. The matching mask is 255.255.240.0.

Why does a /31 have 2 usable hosts instead of 0?

RFC 3021 (December 2000) allows /31 prefixes on point-to-point links: there is no network or broadcast address, and both addresses serve the two ends. The tool applies this rule and shows 2 hosts. A /32 designates a single machine, such as a host route or a loopback interface.

What does a 169.254.x.x address on my computer mean?

It is a link-local address (RFC 3927) that the system assigns itself when no DHCP server answers. It only reaches machines on the same segment, not the Internet. Most of the time it points to an unplugged cable or an unreachable DHCP server.

How do I split a /24 into several subnets?

Add bits to the prefix: one bit gives two /25s of 126 hosts, two bits four /26s of 62 hosts, three bits eight /27s of 30 hosts. Blocks start at multiples of their size: .0, .64, .128 and .192 for /26s. Pick the prefix from the largest number of hosts to fit, plus some headroom.

What is a wildcard mask?

It is the bitwise inverse of the subnet mask: 255.255.255.192 becomes 0.0.0.63. Cisco access lists and the OSPF network command use it to state which address bits must match (0) and which are free (1). The tool computes it for every prefix.

Which prefix should I use for 50 machines?

You need at least 52 addresses (50 hosts plus network and broadcast), so a block of 64: a /26 with 62 usable hosts. A /27 offers only 30. If the fleet is going to grow, a /25 (126 hosts) leaves room.

How does the tool classify 127.0.0.1?

As a loopback address (RFC 1122): the 127.0.0.0/8 block refers to the machine itself and is never sent on the network, so it is not one of the private addresses. The real RFC 1918 blocks are 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16.

Is this tool really free?

Yes, all tools on Kristools are 100% free and accessible without registration.

Is my data protected?

Yes. All processing is performed directly and securely inside your browser. No personal data is sent to our servers.