๐Ÿ“š Network & domain ยท Guide

How to Use a Subnet Calculator: IPv4, CIDR and Masks Explained

Calculate the network address, broadcast address, usable host range and subnet mask for any IPv4 CIDR block. A clear guide to subnetting with examples, tables and common mistakes.

By RexBD Team 24 Nov 2026 7 min read 1,505 words
How to Use a Subnet Calculator: IPv4, CIDR and Masks Explained

Subnetting is one of those topics that every network administrator, cloud engineer and IT student must learn, and one that is easy to get wrong in the binary maths. How many devices fit in a /26? What is the broadcast address of 10.0.5.0/23? Is 192.168.1.130 in the same network as 192.168.1.10 with a /25 mask?

A subnet calculator answers these questions instantly and shows the work. This guide explains how to use the free Subnet Calculator on RexBD and walks through the concepts behind it in plain language, with tables you can refer back to.

IPv4 addresses in a nutshell

An IPv4 address is a 32-bit number, written as four numbers from 0 to 255 separated by dots, such as 192.168.1.10. Each of those four numbers is called an octet, because it represents 8 bits.

Every IP address has two parts:

  • The network part, which identifies the network or subnet.
  • The host part, which identifies a specific device on that network.

The subnet mask decides where the split happens.

๐Ÿงฎ Free tool ยท no sign-upTry the Subnet CalculatorCalculate network, broadcast, host range and mask for any IPv4 CIDR like 192.168.1.0/24. Open tool โ†’

Subnet masks and CIDR notation

A subnet mask is also 32 bits: a run of 1s for the network part, followed by 0s for the host part. For example:

  • 255.255.255.0 is 24 ones followed by 8 zeros.
  • 255.255.255.192 is 26 ones followed by 6 zeros.

CIDR notation (Classless Inter-Domain Routing) writes the same thing more compactly as a slash and the number of network bits. 192.168.1.0/24 means the first 24 bits are the network. CIDR has been the standard way to describe networks since the 1990s, replacing the old Class A, B and C system.

How to use the Subnet Calculator

Step 1: Enter an address with CIDR

Open the Subnet Calculator and type an IPv4 address with its prefix length, such as 192.168.1.0/24 or even a host address such as 192.168.1.130/25.

Step 2: Read the results

The calculator shows:

  • Network address: the first address, which identifies the subnet itself.
  • Broadcast address: the last address, used to send to all hosts on the subnet.
  • Usable host range: the first and last addresses you can assign to devices.
  • Number of usable hosts.
  • Subnet mask in dotted form, and often the wildcard mask used by some router access lists.

Step 3: Use the results in your configuration

Copy the values into your router, firewall, DHCP server or cloud network settings.

Everything is calculated in your browser.

Ad Kothay

Quick reference table

CIDR Subnet mask Total addresses Usable hosts
/30 255.255.255.252 4 2
/29 255.255.255.248 8 6
/28 255.255.255.240 16 14
/27 255.255.255.224 32 30
/26 255.255.255.192 64 62
/25 255.255.255.128 128 126
/24 255.255.255.0 256 254
/23 255.255.254.0 512 510
/22 255.255.252.0 1,024 1,022
/21 255.255.248.0 2,048 2,046
/20 255.255.240.0 4,096 4,094
/16 255.255.0.0 65,536 65,534

The formula is simple: total addresses = 2^(32 โˆ’ prefix). Usable hosts = total โˆ’ 2, because the network and broadcast addresses cannot be given to devices.

There are two special cases. A /31 has two addresses and, under RFC 3021, both can be used on point-to-point links between routers. A /32 is a single address, used for one specific host, such as a loopback interface or a firewall rule for one IP.

A worked example step by step

Let us calculate 192.168.1.130/26 by hand, then compare with the calculator.

  1. Block size. A /26 leaves 6 host bits, so each subnet has 2^6 = 64 addresses.
  2. Which block? In the last octet, subnets start at multiples of 64: 0, 64, 128 and 192. The address 130 falls in the block starting at 128.
  3. Network address: 192.168.1.128.
  4. Broadcast address: the last address in the block, 128 + 64 โˆ’ 1 = 191, so 192.168.1.191.
  5. Usable range: 192.168.1.129 to 192.168.1.190.
  6. Usable hosts: 64 โˆ’ 2 = 62.
  7. Mask: /26 = 255.255.255.192.

The calculator gives exactly the same answer instantly. The manual method is worth learning for exams and interviews, and the calculator is how you double-check it in real work.

Now the earlier question: is 192.168.1.10 in the same /25 network as 192.168.1.130? A /25 splits the last octet into 0โ€“127 and 128โ€“255. 10 is in the first half and 130 in the second, so they are in different subnets and need a router to talk to each other.

Private address ranges

Some address ranges are reserved for private networks, such as homes, offices and cloud internal networks. They are not routed on the public internet (RFC 1918):

Range CIDR Typical use
10.0.0.0 โ€“ 10.255.255.255 10.0.0.0/8 Large organisations, cloud networks
172.16.0.0 โ€“ 172.31.255.255 172.16.0.0/12 Medium networks, Docker defaults
192.168.0.0 โ€“ 192.168.255.255 192.168.0.0/16 Homes and small offices

Your home router probably uses 192.168.0.0/24 or 192.168.1.0/24. Other notable ranges include 127.0.0.0/8 (loopback, your own machine), 169.254.0.0/16 (link-local addresses assigned when DHCP fails) and 100.64.0.0/10 (carrier-grade NAT, used by some internet providers).

Planning subnets for an office

Suppose an office has 10.10.0.0/22 (1,024 addresses) and wants separate subnets for staff, guests, servers and printers. Separating them improves security and keeps broadcast traffic manageable.

A simple plan:

Subnet CIDR Usable hosts Purpose
10.10.0.0/24 /24 254 Staff computers
10.10.1.0/24 /24 254 Guest Wi-Fi
10.10.2.0/25 /25 126 Servers
10.10.2.128/26 /26 62 Printers and cameras
10.10.2.192/26 /26 62 Spare
10.10.3.0/24 /24 254 Future growth

When subnets need different sizes like this, the technique is called VLSM (Variable Length Subnet Masking). The VLSM Calculator plans this automatically from a list of required host counts, allocating the largest subnets first so nothing overlaps.

Subnetting in the cloud

Cloud providers such as AWS, Google Cloud and Azure ask you to choose CIDR blocks when creating virtual networks and subnets. Some tips:

  • Plan for growth. Changing a network's address range later is often difficult.
  • Avoid overlapping ranges between networks you might connect later, for example via VPN or peering. Overlaps cannot be routed.
  • Remember that cloud providers reserve some addresses in each subnet. AWS, for example, reserves five addresses per subnet, so a /24 gives 251 usable addresses instead of 254.

Common subnetting mistakes

  • Using the network or broadcast address for a device. They are not usable host addresses in normal subnets.
  • Mismatched masks. Two devices on the same cable with different masks may disagree about who is local, causing strange one-way connectivity.
  • Overlapping subnets. Two subnets that share addresses confuse routing. Check plans with the calculator or the IP Range โ†” CIDR tool.
  • Forgetting reserved addresses in cloud subnets.
  • Mixing up the wildcard mask and subnet mask in router access lists. The wildcard mask is the inverse: /24 has mask 255.255.255.0 and wildcard 0.0.0.255.

Our subnet calculator tips and mistakes article covers troubleshooting in more detail.

Frequently asked questions

How many usable hosts are in a /24?

  1. A /24 has 256 addresses, minus the network and broadcast addresses.

What is the subnet mask for /27?

255.255.255.224, giving 32 addresses and 30 usable hosts.

What is the difference between the network and broadcast address?

The network address is the first address and identifies the subnet. The broadcast address is the last one and reaches every host in the subnet. Neither is assigned to a normal device.

Does the calculator support IPv6?

This calculator is for IPv4. Use the IPv6 Tool for IPv6 addresses.

What is a wildcard mask?

The inverse of the subnet mask, used in some router and firewall rules. For 255.255.255.0 it is 0.0.0.255.

How do I choose the right subnet size?

Count the devices you need now, add room for growth (doubling is a common rule of thumb), then pick the smallest prefix whose usable host count covers that number. For 40 devices with growth to 80, a /25 with 126 usable hosts is a comfortable fit.

Is the Subnet Calculator free?

Yes. It is free and works in your browser.

Found this useful?Share it with a friend or colleague who needs it.

Keep reading

More network & domain articles
321 free tools, one placeSEO, text, images, code, money, units and design. Private, fast and almost all in your browser.
Ad Kothay