IP Subnet Calculator

Enter an address in CIDR form, such as 192.168.1.10/24, and get the full subnet breakdown.

What you get

The tool shows the network address, broadcast address, subnet mask, wildcard mask, first and last usable host, total addresses, usable hosts and the IP class.

Reading CIDR

The number after the slash is how many leading bits belong to the network. A /24 leaves 8 bits for hosts, giving 256 addresses and 254 usable hosts, because the network and broadcast addresses are reserved.

How to use it

  1. Enter an address with a prefix, for example 192.168.1.10/24.
  2. Press Calculate.
  3. Read the results.

Example

For 192.168.1.10/24 the tool shows:

Network    192.168.1.0
Broadcast  192.168.1.255
Mask       255.255.255.0
Wildcard   0.0.0.255
Hosts      192.168.1.1 - 192.168.1.254 (254 usable of 256)

Common use cases

Worked examples you can check by hand

A /26 is a good test because the block size (64) does not divide evenly into what people expect. Enter 10.0.5.77/26. The mask 255.255.255.192 keeps the first 26 bits, and 77 falls in the block that starts at 64, so the network address is 10.0.5.64, the broadcast address is 10.0.5.127, the usable range is 10.0.5.65 to 10.0.5.126, and the wildcard mask is 0.0.0.63. That is 64 addresses and 62 usable hosts.

Larger blocks work the same way. 172.16.0.0/12 covers 172.16.0.0 to 172.31.255.255, which is the whole RFC 1918 private range that starts with 172, and contains 1,048,576 addresses. A small block such as 203.0.113.9/29 has 8 addresses: network 203.0.113.8, hosts .9 to .14, broadcast 203.0.113.15.

Input:      192.168.10.130/25
Network:    192.168.10.128
Broadcast:  192.168.10.255
Mask:       255.255.255.128
Wildcard:   0.0.0.127
Hosts:      192.168.10.129 - 192.168.10.254 (126 usable)

Edge cases: /31, /32 and /0

The usual rule of subtracting two only applies when a subnet has more than two addresses. This tool follows the point-to-point convention for the smallest blocks: a /31 reports 2 usable hosts (both addresses, as described in RFC 3021 for router links) and a /32 reports 1 usable host, the single address itself. If you have been told that a /31 “has zero hosts”, that is the older classful rule.

At the other end, /0 is accepted and shows all 4,294,967,296 addresses. The input must be written as four dotted decimal octets followed by a slash and a prefix of 0 to 32, so 192.168.1.10 on its own, or a netmask written as 192.168.1.10/255.255.255.0, is rejected with an error message.

Mistakes people make with CIDR

What it does not do

It calculates one subnet at a time for IPv4. It does not split a network into several equal subnets, summarise a list of routes into one supernet, work with IPv6, or check whether two CIDR blocks overlap. For overlap checks, compute the network and broadcast of each block and compare the ranges yourself.

Frequently asked questions

How do I calculate usable hosts?

Total addresses minus two: the network address and the broadcast address. The exceptions are /31 (2 usable, point-to-point) and /32 (1 usable), which this tool reports as such.

What is a wildcard mask?

The inverse of the subnet mask, used by some routers and access lists.

Does it support IPv6?

The calculator is for IPv4 CIDR addresses.

Is my data uploaded?

No. This tool runs entirely in your browser, so what you type or paste is not sent to our servers.

Why does my /31 show 2 usable hosts instead of 0?

Because the calculator treats /31 as a point-to-point link, where both addresses are usable, and /32 as a single host. Only blocks larger than two addresses lose the network and broadcast addresses.

Can I type a netmask instead of a prefix length?

No. The input must be in the form address/prefix, such as 10.0.5.77/26. Convert a mask like 255.255.255.192 to its prefix by counting the one bits, which is 26 here.

Related tools

Explore all developer tools →