Skip to content

Subnet and IP calculator

  • Runs on your device
  • Works offline once loaded

Work out the details of any network from an address and prefix or mask. See the network and broadcast addresses, the host range, the wildcard mask and the binary layout, then split a network into equal parts, plan subnets by host count, convert an address range to CIDR blocks or check whether an address belongs to a list of networks.

How it works

  1. Enter an address with a prefix or mask.
  2. Read the network details.
  3. Use the tabs to split, plan, convert ranges or test membership.

Why use it

  • IPv4 and IPv6 with big number support.
  • VLSM planning and even splits.
  • Range to CIDR and network aggregation.
  • Address type, class and reverse DNS.

Subnets and CIDR: calculating, splitting and checking ranges

Reading CIDR notation

An address such as 192.168.1.10/24 has two parts. The number after the slash says how many of the 32 bits, counted from the left, identify the network; the rest number the hosts inside it. A /24 leaves 8 bits for hosts, so 256 addresses, of which 254 can be given to devices: the first is the network itself and the last is the broadcast address. Each step down in the prefix doubles the size of the network.

PrefixNetmaskAddressesUsable hosts
/30255.255.255.25242
/29255.255.255.24886
/28255.255.255.2401614
/26255.255.255.1926462
/24255.255.255.0256254
/22255.255.252.01,0241,022
/16255.255.0.065,53665,534
A /31 is the exception: it links two routers and uses both addresses (RFC 3021). A /32 is a single host.

The calculator shows all of these for any address you type, plus the wildcard mask that firewalls and Cisco access lists use, the reverse DNS name, the address as a number and in hexadecimal, whether it is private, public, loopback or another special range, and the address in binary with the network bits in bold.

Splitting a network

  • Equal parts divides a block into subnets of one size: a /24 into four /26 networks of 62 hosts each, for example.
  • By host count (VLSM) fits subnets of different sizes into one block. Type how many hosts each needs, such as 100 for an office floor, 50 for Wi-Fi and 2 for a router link, and the planner assigns the smallest block that fits each, largest first, without overlaps.

Ranges and merging

Range to CIDR turns a start and end address, as many allow lists and firewall exports write them, into the smallest set of CIDR blocks that covers exactly that range. Aggregate networks does the reverse cleanup: paste a list of networks and adjacent or overlapping ones are merged into the fewest blocks, which keeps routing tables and firewall rules short. Contains checks whether an address falls inside a network, the quick way to answer "is this IP in our range?".

IPv6

IPv6 works the same way with 128 bits, written in hexadecimal groups. Networks are much larger: the standard subnet for a home or office LAN is a /64, with 18 quintillion addresses, and providers usually hand out a /48 or /56. The calculator shows both the compressed form, 2001:db8::1, and the full expanded form, and IPv6 has no broadcast address.

If something goes wrong

  • It asks for a prefix. Add /24 or a netmask such as 255.255.255.0 after the address.
  • The network address differs from what you typed. You typed a host address; the network address is where its block starts. 192.168.1.10/24 belongs to 192.168.1.0/24.
  • A VLSM plan does not fit. The requested hosts need more space than the block has. Use a larger block or fewer hosts.

Questions and answers

How many hosts are in a /24?

A /24 has 256 addresses and 254 usable hosts, because the network and broadcast addresses are reserved.

What is a wildcard mask?

It is the inverse of the subnet mask and is used in some router access lists.

Does it work for IPv6?

Yes, including compression and expansion of addresses.

Esc