Subnet Calculator

Subnetting is binary arithmetic dressed up in dotted decimal, and doing it in your head at the end of a long day is how outages start. Given a network address and a prefix length, you need the netmask, the usable host range, the broadcast address and the number of available hosts, and every one of those is easy to get slightly wrong.

The calculator produces them all instantly. That matters when you are planning an address plan that must not overlap, configuring a firewall rule that should cover exactly one department, splitting a range across VLANs, or checking whether two hosts are actually on the same network and therefore able to talk without a router.

CIDR notation is the shorthand to get comfortable with: /24 gives 256 addresses of which 254 are usable, /25 halves that, and each additional bit halves it again. Two addresses in every subnet are reserved, one for the network itself and one for broadcast, which is why the usable count is always two lower than the total.

How to use the Subnet Calculator

  1. Enter the network address you are working with.
  2. Enter the prefix length in CIDR notation, or choose the equivalent subnet mask.
  3. Read the network address, broadcast address and usable host range.
  4. Check the host count against the number of devices you need to accommodate.
  5. Adjust the prefix and recalculate until the subnet is the right size.

Examples

Frequently asked questions

How many hosts fit in a /24?

A /24 contains 256 addresses, of which 254 are usable once the network and broadcast addresses are reserved.

What does the prefix length mean?

It is the number of leading bits that identify the network. The remaining bits identify hosts, so a larger prefix means a smaller subnet.

Why are two addresses unusable?

The first identifies the network itself and the last is the broadcast address, so neither can be assigned to a device.

Can I subnet an IPv6 network the same way?

The principle is identical, but IPv6 uses far larger prefixes, commonly /64 per network segment, and the concept of a broadcast address does not apply.

SwiftMultiTool — free online tools for everyone. Home · Blog · About · FAQ · Contact