IPv4 Subnet Calculator – Calculate Subnets, Masks and Host Ranges

Enter an IPv4 address with a CIDR prefix, such as 192.168.1.0/24, and the calculator shows the network address, subnet mask, broadcast address and usable host range. It saves you the binary arithmetic and helps you avoid overlapping ranges, wasted addresses and mistyped masks.

How IPv4 subnetting works

An IPv4 address has 32 bits, written as four 8-bit blocks called octets. The number after the slash, the prefix length, says how many of those bits identify the network. The rest identify individual devices.

In 192.168.1.0/24, 24 bits belong to the network and 8 bits are left for hosts. That gives 2⁸ = 256 addresses. The first is the network address, and the last is the broadcast address, so 254 can be assigned to devices.

The formula is: usable hosts = 2^(32 − prefix) − 2

CIDR quick reference

CIDR

Subnet mask

Total addresses

Usable hosts

/24

255.255.255.0

256

254

/25

255.255.255.128

128

126

/26

255.255.255.192

64

62

/27

255.255.255.224

32

30

/28

255.255.255.240

16

14

/29

255.255.255.248

8

6

/30

255.255.255.252

4

2

Worked example: 192.168.10.77/26

A /26 uses blocks of 64 addresses. The address ends in .77, which falls between .64 and .127, so:

  • Network Address: 192.168.10.64
  • Subnet Mask: 255.255.255.192
  • First Usable Host: 192.168.10.65
  • Last Usable Host: 192.168.10.126
  • Broadcast Address: 192.168.10.127
  • Usable Hosts: 62
  • Wildcard Mask: 0.0.0.63 (the inverse of the subnet mask, used in some router access lists)

Special cases: /31 and /32

A /31 has only two addresses. Under RFC 3021 both can be used on point-to-point links between two devices, with no network or broadcast address. A /32 is a single address, often used for a specific host route or loopback.

How to choose the right subnet size

Start with the number of devices you have today. Then allow for growth and for the things that are easy to forget, such as printers, IP phones, cameras and WiFi access points. If you need 50 devices, a /26 (62 usable) fits on day one but leaves little room. A /25 (126 usable) is the safer choice.

Typical business layouts

Many organisations give each function its own subnet or VLAN, for example staff computers, guest WiFi, servers, VoIP phones, CCTV and network management. Private ranges for this are defined in RFC 1918: 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16. When you connect offices by VPN, make sure their ranges do not overlap, as that is a common cause of routing problems. Some cloud platforms also reserve extra addresses in each subnet, so check your provider’s documentation.

Common subnetting mistakes

  • Forgetting to subtract the network and broadcast addresses
  • Starting a subnet on the wrong boundary. A /27, for example, must begin on a multiple of 32.
  • Mixing up the subnet mask and the wildcard mask
  • Creating overlapping subnets between sites
  • Sizing a subnet so tightly that it cannot grow

Frequently asked questions

A 32-bit number that identifies a device on an IP network, usually written as four numbers separated by dots.

It shows which part of an IPv4 address identifies the network and which part identifies the device.

It means the first 24 bits are the network portion, leaving 8 bits for hosts.

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

No. It is designed for IPv4. IPv6 uses 128-bit addresses and does not use broadcast addresses.

Network administrators, IT engineers, students preparing for networking exams and anyone planning an office network or VLAN layout.

Planning a new office network or reorganising an existing one? Talk to our team about infrastructure and networking support.