IP subnet calculator (IPv4 and IPv6)

Enter an IP address with a CIDR prefix or subnet mask to see the network address, broadcast address, usable host range and masks. You can also split the network into smaller subnets.

Examples: 10.0.0.0/8 · 172.16.5.130 255.255.255.192 · 2001:db8:abcd::/48

How to use the subnet calculator

  1. Type an address such as 192.168.1.10/24. A mask such as 255.255.255.0 after the address works too, and so does an IPv6 address.
  2. Read the network, broadcast, host range and masks. Click any value to copy it.
  3. To divide the network, pick a longer prefix under Split into subnets and copy or download the list.

What the results mean

  • Network address: the first address in the block. It names the subnet and is not given to a device.
  • Broadcast address: the last address in an IPv4 block. Packets sent to it reach every host on the subnet.
  • Usable host range: the addresses between those two that you can assign to devices.
  • Subnet mask: the prefix written as four numbers, for example /24 is 255.255.255.0.
  • Wildcard mask: the mask inverted, used in Cisco access lists and OSPF, for example 0.0.0.255.

IPv4 CIDR cheat sheet

PrefixSubnet maskAddressesUsable hosts
/8255.0.0.016,777,21616,777,214
/16255.255.0.065,53665,534
/20255.255.240.04,0964,094
/22255.255.252.01,0241,022
/23255.255.254.0512510
/24255.255.255.0256254
/25255.255.255.128128126
/26255.255.255.1926462
/27255.255.255.2243230
/28255.255.255.2401614
/29255.255.255.24886
/30255.255.255.25242
/31255.255.255.25422 (point-to-point links)
/32255.255.255.25511 (a single host)

How the calculation works

An IPv4 address is 32 bits. The prefix says how many of those bits, counted from the left, belong to the network. The rest identify the host. A /26 leaves 6 host bits, which is 26 = 64 addresses. Take away the network and broadcast addresses and 62 are left for devices.

IPv6 works the same way with 128 bits. There is no broadcast address in IPv6, and a /64 is the normal size for one network segment.

Planning several networks of different sizes? Use the VLSM subnet planner. To turn a start and end address into CIDR blocks, use IP Range to CIDR.

Private by design

This tool runs entirely in your web browser. Nothing you type or paste is sent to a server, logged or stored, so it is safe to use with internal addresses, configuration files and other work data. There is no sign-up and it keeps working offline once the page has loaded.

Frequently asked questions

How many usable hosts are in a /24?

254. A /24 has 256 addresses, and the first (network) and last (broadcast) cannot be assigned to devices.

What is the subnet mask for /27?

255.255.255.224. A /27 has 32 addresses and 30 usable hosts.

What is a wildcard mask?

The subnet mask with every bit flipped. For 255.255.255.0 the wildcard is 0.0.0.255. Cisco access lists and OSPF network statements use it.

Does this calculator support IPv6?

Yes. Enter an IPv6 address with a prefix, such as 2001:db8::/48, to see the network, address range, total addresses and both the short and full forms.

Why does a /31 show two usable hosts?

RFC 3021 allows both addresses of a /31 to be used on point-to-point links, where no broadcast address is needed.