Skip to content

Practical technology help for homes and small businesses, from someone who knows how to make it work. Based in Martinez, serving Contra Costa County.

Practical IT guides, cheatsheets, and references from Jeremiah Ellington, drawn from more than 20 years of IT work in public sector and higher education.

Contact Info
Location Martinez, CA (Serving Contra Costa County)
Contact Info
Location Martinez, CA (Serving Contra Costa County)

IT tool

IPv4 Subnet Calculator

Network and broadcast addresses, usable host range, wildcard and binary masks for any IPv4 address and prefix, with correct /31 and /32 handling and a subnet split helper.

Your input stays in your browser. The calculation runs there, and what you type isn't sent to this site or anyone else, isn't saved, and isn't added to the page address. Your browser's own features, such as form autofill and extensions, are outside this site's control. On a shared computer, clear anything sensitive before you walk away.

This calculator needs JavaScript. Turn it on for this page to use the calculator; the explanation below works without it.

How the calculator works

An IPv4 address is 32 bits. The prefix length (the number after the /) says how many of those bits identify the network; the rest identify hosts on it. A subnet mask is the same thing written as four numbers: /24 and 255.255.255.0 both mean the first 24 bits are the network.

  • Network address: all host bits set to 0. It names the subnet and isn't assigned to a device.
  • Broadcast address: all host bits set to 1. Traffic sent to it reaches every host on the subnet.
  • Usable hosts: everything between the two, so a subnet has 2(32 − prefix) − 2 usable addresses.
  • Wildcard mask: the subnet mask with every bit flipped, as used in Cisco access lists and OSPF network statements.

Example: 192.168.10.77/26

A /26 leaves 6 host bits, so each subnet holds 64 addresses: 192.168.10.0, .64, .128 and .192. The address .77 falls in the second block.

  • Network address: 192.168.10.64
  • Broadcast address: 192.168.10.127
  • Usable hosts: 192.168.10.65 to 192.168.10.126 (62 addresses)
  • Subnet mask: 255.255.255.192; wildcard mask: 0.0.0.63

/31, /32 and /0

  • /31 has two addresses and, under RFC 3021, both are usable on a point-to-point link; there's no network or broadcast address. Older equipment may not support it.
  • /32 is a single address, used for host routes and loopback interfaces.
  • /0 is the whole IPv4 address space; in a routing table it's the default route. Its usable host count (4,294,967,294) is theoretical.

What the calculator accepts

The calculator is deliberately strict, so a typo can't quietly give you the wrong network. It rejects numbers above 255, leading zeros such as 010 (some systems read them as octal), masks whose 1 bits aren't contiguous, and stray spaces or characters. If you paste a wildcard mask where a subnet mask belongs, it tells you the subnet mask to use instead.

Address classes (A to E) are shown for reference only. Networks have been classless since CIDR (RFC 4632), so the prefix length, not the class, decides the network size.

For a printable subnet-size table, see the IPv4 Subnetting cheat sheet by Jeremy Stretch in the PacketLife library. For how subnets fit into a small network's VLAN plan, see IP addresses and subnets in Building a Reliable Home or Small Business Network, and more networking guides under Networking & Wi-Fi.

Standards and references

For how the IT Resource Center is researched, reviewed and corrected, see How These Guides Are Made.

More IT tools