Subnet Calculator

IP address

Network address192.168.1.0
Broadcast address192.168.1.255
Subnet mask255.255.255.0
First usable host192.168.1.1
Last usable host192.168.1.254
Usable hosts254
Total addresses256
How this was calculated
  1. A /24 prefix fixes the first 24 bits as the network part; the mask is 255.255.255.0.
  2. Network address = IP AND mask = 192.168.1.10 AND 255.255.255.0 = 192.168.1.0. Setting every host bit to 1 gives the broadcast address 192.168.1.255.
  3. The block holds 256 addresses; reserving the network and broadcast addresses leaves 254 usable host addresses, from 192.168.1.1 to 192.168.1.254.
  4. Every step down in prefix length doubles the block: a /23 would hold 512 addresses.

A subnet calculator takes an IP address and a prefix length, then returns the network address, broadcast address, usable host range, netmask, and wildcard mask. A prefix length sets the mask: /24 means 255.255.255.0, leaving 8 host bits and 2^8 − 2 = 254 usable addresses (network and broadcast are reserved). Verified examples include 192.168.1.73/24 sitting in network 192.168.1.0 with broadcast 192.168.1.255 and usable hosts 192.168.1.1–192.168.1.254, and 10.20.30.40/16 having network 10.20.0.0, broadcast 10.20.255.255 and 65,534 usable hosts. The wildcard mask is the bitwise inverse of the netmask (0.0.0.255 for /24) and is what Cisco ACLs and OSPF statements use. Note that /31 links (point-to-point) and /32 host routes are the exceptions to the minus-two rule in modern practice.

The underlying method is the accepted standard because it follows the fixed rules of binary arithmetic: each prefix length defines a specific boundary, so every device on a network computes identical results. This page shows the formula, step-by-step workings, worked examples and sources. You can trace how 172.16.5.99/26 has network 172.16.5.64, broadcast 172.16.5.127 and 62 usable hosts — /26 carves a /24 into four subnets — and confirm each value against the references provided.

Worked examples

A home /24

Primary result: network 192.168.1.0, with 254 usable hosts. (192 · 168 · 1 · 10 · 24)

Network address192.168.1.0
Broadcast address192.168.1.255
Subnet mask255.255.255.0
First usable host192.168.1.1
Last usable host192.168.1.254
Usable hosts254
Total addresses256

A /16 office block

Primary result: network 10.0.0.0, with 65,534 usable hosts. (10 · 0 · 5 · 200 · 16)

Network address10.0.0.0
Broadcast address10.0.255.255
Subnet mask255.255.0.0
First usable host10.0.0.1
Last usable host10.0.255.254
Usable hosts65,534
Total addresses65,536

A tight /28

Primary result: network 172.16.3.64 — the .77 address sits in the .64 block. (172 · 16 · 3 · 77 · 28)

Network address172.16.3.64
Broadcast address172.16.3.79
Subnet mask255.255.255.240
First usable host172.16.3.65
Last usable host172.16.3.78
Usable hosts14
Total addresses16

How subnetting works

Subnetting works by combining an IP address with a subnet mask to determine which network that address belongs to. The mask is set by a prefix length written after the address with a slash. For example, /24 means a mask of 255.255.255.0. In binary, that mask is 24 ones followed by 8 zeros, which leaves 8 host bits. Those 8 host bits provide 2 raised to the 8th power, minus 2, equals 254 usable addresses, because the network address and the broadcast address are reserved.

To see this bit by bit, take the verified example 192.168.1.73 with a /24 prefix. The first 24 bits of the address match the network portion, and the last 8 bits identify the host. The subnet calculator takes the address and the mask and applies a bitwise AND operation: each bit in the address is compared with the matching bit in the mask, and a 1 results only when both bits are 1. The first three octets of the address, 192.168.1, pass through unchanged because the mask is all ones there. The last octet, 73, is masked by zeros, so it becomes 0. The result is the network address 192.168.1.0. The broadcast address is found by setting every host bit to 1, which gives 192.168.1.255. The usable hosts fall between those two values, from 192.168.1.1 through 192.168.1.254.

The same logic applies at other prefix lengths. The verified example 10.20.30.40 with a /16 prefix has network 10.20.0.0, broadcast 10.20.255.255, and 65,534 usable hosts. The verified example 172.16.5.99 with a /26 prefix has network 172.16.5.64, broadcast 172.16.5.127, and 62 usable hosts. A /26 carves a /24 into four subnets, which shows how a longer prefix creates smaller networks with fewer hosts.

A related value is the wildcard mask, which is the bitwise inverse of the netmask. For a /24, the wildcard mask is 0.0.0.255. This is what Cisco ACLs and OSPF statements use. Two exceptions to the minus-two rule exist in modern practice: /31 links for point-to-point connections and /32 host routes, which treat a single address as its own network.

Worked examples

The fastest way to understand what a subnet calculator produces is to trace three verified examples through every derived value. A prefix length sets the mask: /24 means 255.255.255.0, leaving 8 host bits and 2^8 − 2 = 254 usable addresses, because the network and broadcast are reserved. The same logic scales up for wider prefixes and narrows for longer ones, as the rows below demonstrate.

Take 192.168.1.73/24. The mask 255.255.255.0 fixes the first three octets, so the network address is 192.168.1.0 and the broadcast address is 192.168.1.255. Every address between them is assignable, giving usable hosts of 192.168.1.1 through 192.168.5.254. The wildcard mask is the bitwise inverse of the netmask — 0.0.0.255 for /24 — and is what Cisco ACLs and OSPF statements use when you need to match that range.

A wider prefix changes the scale but not the method. For 10.20.30.40/16, the mask 255.255.0.0 fixes only the first two octets, so the network becomes 10.20.0.0 and the broadcast becomes 10.20.255.255. That leaves 65,534 usable hosts, a range large enough for a major campus or datacenter block. A longer prefix carves the same space into smaller pieces: 172.16.5.99/26 has network 172.16.5.64, broadcast 172.16.5.127, and 62 usable hosts. The /26 prefix carves a /24 into four subnets, each with its own network and broadcast pair.

Two exceptions to the minus-two rule appear in modern practice. Point-to-point /31 links skip the broadcast address entirely, and /32 host routes identify a single interface with no local broadcast at all. A subnet calculator still reports these correctly, but the usable-host count follows the special rules rather than the standard formula.

Input addressPrefixNetmaskNetwork addressBroadcast addressUsable hostsWildcard mask
192.168.1.73/24/24255.255.255.0192.168.1.0192.168.1.255192.168.1.1–192.168.1.254 (254)0.0.0.255
10.20.30.40/16/16255.255.0.010.20.0.010.20.255.25565,5340.0.255.255
172.16.5.99/26/26255.255.255.192172.16.5.64172.16.5.127620.0.0.63

CIDR prefixes and netmasks

A CIDR prefix length sets the subnet mask by fixing how many bits identify the network portion of an address. The remaining bits are available for hosts. A /24 prefix, for example, means a mask of 255.255.255.0, leaving 8 host bits. The number of usable addresses is 2^8 − 2 = 254, because the network address and broadcast address are reserved. This pattern scales across every prefix: fewer host bits means more subnets but fewer hosts per subnet.

Reading a prefix quickly comes down to recognizing the mask and the host bit count. A /16 has a mask of 255.255.0.0, leaving 16 host bits and 65,534 usable addresses. A /26 has a mask of 255.255.255.192, leaving 6 host bits and 62 usable addresses. A /26 carves a /24 into four subnets, which is a common way to divide a larger block into smaller segments. A subnet calculator applies this same logic to any prefix from /8 to /30 and returns the network address, broadcast, and usable host range without manual bit arithmetic.

Concrete examples show how the prefix determines the boundaries. 192.168.1.73/24 sits in network 192.168.1.0 with broadcast 192.168.1.255 and usable hosts 192.168.1.1 through 192.168.1.254. 10.20.30.40/16 has network 10.20.0.0, broadcast 10.20.255.255, and 65,534 usable hosts. 172.16.5.99/26 has network 172.16.5.64, broadcast 172.16.5.127, and 62 usable hosts. In each case the network and broadcast addresses fall on bit-aligned boundaries, not on arbitrary decimal round numbers.

The wildcard mask is the bitwise inverse of the netmask. For a /24, the netmask 255.255.255.0 inverts to 0.0.0.255. Cisco ACLs and OSPF statements use the wildcard mask rather than the netmask, so converting between the two is a routine step when configuring equipment. A subnet calculator typically displays both forms side by side.

  • /8 — 255.0.0.0 — 16,777,214 usable hosts
  • /16 — 255.255.0.0 — 65,534 usable hosts
  • /24 — 255.255.255.0 — 254 usable hosts
  • /26 — 255.255.255.192 — 62 usable hosts
  • /30 — 255.255.255.252 — 2 usable hosts
/31 links (point-to-point) and /32 host routes are the exceptions to the minus-two rule in modern practice. A /31 uses both addresses for endpoints with no broadcast, and a /32 identifies a single host with no network or broadcast overhead.

Usable hosts and the minus-two rule

Every IP subnet reserves two addresses for special purposes. The network address identifies the subnet itself, while the broadcast address is used to send a packet to every host in that subnet at once. Because these two addresses cannot be assigned to individual devices, the number of usable hosts is always two less than the total number of addresses. A prefix length sets the mask: /24 means 255.255.255.0, leaving 8 host bits and 2^8 − 2 = 254 usable addresses (network and broadcast are reserved). This minus-two rule is the foundation of how a subnet calculator reports usable host counts.

The rule applies consistently across prefix lengths. A /16 such as 10.20.30.40/16 has network 10.20.0.0, broadcast 10.20.255.255 and 65,534 usable hosts. A /26 such as 172.16.5.99/26 has network 172.16.5.64, broadcast 172.16.5.127 and 62 usable hosts — /26 carves a /24 into four subnets. For a /24 such as 192.168.1.73/24, the subnet sits in network 192.168.1.0 with broadcast 192.168.1.255 and usable hosts 192.168.1.1–192.168.1.254. In each case, the first address in the range is the network identifier and the last is the broadcast, leaving the addresses in between for actual devices.

Related to the netmask is the wildcard mask, which is the bitwise inverse of the netmask (0.0.0.255 for /24) and is what Cisco ACLs and OSPF statements use. While a standard netmask uses ones to mark the network portion, a wildcard mask uses zeros for the same purpose. Network engineers encounter both forms when configuring routing and access control, so understanding the relationship between them helps when translating between subnet calculator output and device configuration syntax.

Two prefix lengths break the minus-two rule in modern practice. A /31 provides exactly two addresses with none reserved, which makes it ideal for point-to-point links where there is no need for a broadcast. A /32 represents a single host route with one address and no network or broadcast overhead. These exceptions exist because point-to-point links and individual host routes do not require the traditional network and broadcast reservations. When a subnet calculator encounters /31 or /32, it accounts for these special cases rather than applying the standard two-address deduction.

Wildcard masks

A wildcard mask is the bitwise inverse of the netmask, and it shows up wherever Cisco devices need to match a range of addresses rather than a single host. For a /24 network, the standard netmask is 255.255.255.0. Flip every bit and you get 0.0.0.255, the wildcard mask for that same network. While a regular subnet mask uses 1s to mark the network portion, a wildcard mask uses 1s to mark the bits you want to ignore. That inversion is what makes wildcard masks useful in access control lists and OSPF configuration statements, where you describe traffic flows or routing neighbors by what should match and what can vary.

Because the wildcard mask is just the netmask flipped, any prefix length converts directly. A /24 leaves 8 host bits, producing 2^8 − 2 = 254 usable addresses after reserving the network and broadcast values. The matching wildcard mask is 0.0.0.255, meaning the first three octets must match exactly while the last octet can be anything from 0 through 255. A /16 network works the same way: 10.20.30.40/16 has network 10.20.0.0, broadcast 10.20.255.255, and 65,534 usable hosts, so its wildcard mask is 0.0.255.255. A /26 carves a /24 into four subnets, and 172.16.5.99/26 sits in network 172.16.5.64 with broadcast 172.16.5.127 and 62 usable hosts; its wildcard mask is 0.0.0.63.

When you use a subnet calculator that also reports wildcard masks, the tool is doing that bitwise inversion for you so you can copy the result straight into a router config. In an ACL, the line that permits traffic for the 192.168.1.0/24 network pairs the address 192.168.1.0 with the wildcard mask 0.0.0.255. Verified: 192.168.1.73/24 sits in network 192.168.1.0 with broadcast 192.168.1.255 and usable hosts 192.168.1.1 through 192.168.1.254. The ACL does not care which specific host in that range sent the packet; it only checks that the first 24 bits match 192.168.1, and the wildcard mask tells the router to skip the last 8 bits.

Two prefix lengths break the usual minus-two rule in modern practice, and both affect how wildcard masks behave. /31 links are used for point-to-point connections with no broadcast address, and /32 host routes identify a single device. A /32 wildcard mask is 0.0.0.0, meaning every bit must match exactly one address. These exceptions matter in OSPF, where /31 and /32 entries appear regularly and the wildcard mask must reflect the exact prefix length to route correctly.

Splitting a network: a practical pass

Say you have a /24 network and you need to divide it among four departments or VLANs. A prefix length sets the mask: /24 means 255.255.255.0, leaving 8 host bits and 2^8 − 2 = 254 usable addresses (network and broadcast are reserved). To carve that /24 into four subnets, you borrow two more bits, moving from /24 to /26. Each /26 block leaves 6 host bits, which gives 2^6 − 2 = 62 usable addresses per subnet — enough for a department or VLAN without wasting the bulk of your range.

A subnet calculator confirms the boundaries. Take 172.16.5.99/26 as a verified example: it sits in network 172.16.5.64 with broadcast 172.16.5.127 and 62 usable hosts. That same /24 spans 172.16.5.0 through 172.16.5.255, so the four /26 blocks fall at 172.16.5.0/26, 172.16.5.64/26, 172.16.5.128/26, and 172.16.5.192/26. Each block follows the same pattern: a network address at the bottom, a broadcast address at the top, and 62 usable hosts in between. You can hand one block to Finance, one to Engineering, one to Operations, and keep one for infrastructure — all from a single /24.

For comparison, the same logic scales up or down. Verified: 192.168.1.73/24 sits in network 192.168.1.0 with broadcast 192.168.1.255 and usable hosts 192.168.1.1–192.168.1.254. Verified: 10.20.30.40/16 has network 10.20.0.0, broadcast 10.20.255.255 and 65,534 usable hosts. The /16 is far larger, but the math is the same: count the host bits, subtract two, and you have your usable count.

Two exceptions to the minus-two rule appear in modern practice. /31 links serve point-to-point connections where there is no need for a separate network or broadcast address, so both addresses are usable. /32 host routes identify a single exact address with no network or broadcast overhead at all. Outside those cases, the minus-two rule holds.

  • /26 carves a /24 into four subnets, each with 62 usable hosts
  • Block boundaries for 172.16.5.0/24 split into /26: .0–.63, .64–.127, .128–.191, .192–.255
  • The wildcard mask is the bitwise inverse of the netmask (0.0.0.255 for /24) and is what Cisco ACLs and OSPF statements use
  • /31 links (point-to-point) and /32 host routes are the exceptions to the minus-two rule in modern practice
When planning VLANs, map each subnet to a VLAN ID and document the network, broadcast, and usable range before you configure switches or firewalls. A subnet calculator does the math instantly, but the documentation is what saves you during troubleshooting.

FAQs

How many usable hosts are in a /24?

A /24 provides 254 usable hosts. It contains 256 total addresses, but you must subtract 2: one for the network address, such as 192.168.1.0, and one for the broadcast address, such as 192.168.1.255. Neither of those two addresses can be assigned to an individual host, leaving 254 available for devices.

What is the network address of 172.16.5.99/26?

The network address is 172.16.5.64. The corresponding broadcast address is 172.16.5.127. Usable hosts range from .65 to .126, giving 62 hosts in total. The /26 mask divides the address block into smaller segments, and 172.16.5.99 falls within the range that starts at 172.16.5.64 and ends at 172.16.5.127.

What netmask is /16?

A /16 netmask is 255.255.0.0. It leaves 65,534 usable hosts available for assignment. For example, in the 10.20.0.0 network, the first two octets identify the network portion while the last two octets are available for host addresses, minus the network and broadcast addresses that cannot be assigned to any device.

What is a wildcard mask?

A wildcard mask is the inverse of the netmask. For a /24, the wildcard mask is 0.0.0.255. It is commonly used in Cisco ACLs and OSPF network statements. While a regular netmask uses 1s to identify the network portion, a wildcard mask uses 0s for the same purpose, flipping the bits to match addresses.

Why subtract 2 from the host count?

You subtract 2 because two addresses in every subnet are reserved. The all-zeros host part names the network itself, and the all-ones part is the broadcast address. Neither can be given to a host. These two addresses are required for the network to function properly, so they are excluded from the pool of addresses available for assignment to devices.

What is the difference between /24 and /26?

A /26 has 64 addresses and 62 usable hosts, which is a quarter of a /24. Because a /24 contains 256 addresses and a /26 contains 64, four /26 subnets fit inside one /24. The larger prefix number means more bits are used for the network portion, leaving fewer bits for hosts and resulting in a smaller subnet size.

Sources

Related calculators

Unix Timestamp Converter
Convert a Unix timestamp in seconds to its exact UTC date, time and weekday — or build a timestamp from days since the epoch. Pure UTC arithmetic, no timezone surprises.
Military Time Converter
Convert 24-hour military time to standard AM/PM time — with the spoken form ('thirteen thirty hours') and minutes since midnight.
Data Size Converter
Storage sizes in both ladders at once — decimal KB, MB, GB and TB (powers of 1,000) against binary KiB, MiB, GiB and TiB (powers of 1,024) — and why the two never quite agree.