Subnet bits are the leading 1-bits in a 32-bit subnet mask, and the number after the slash in CIDR notation tells you exactly how many there are — a /24 has 24 subnet bits and 8 host bits. Once the split is known, every other value falls out of one formula: usable hosts per block equals 2^(host bits) minus 2 for prefixes up to /30. The network address is the bitwise AND of the IP and the mask, the broadcast is the network OR'd with the wildcard (the mask inverted bit for bit), and the wildcard itself is just the subnet mask flipped. You can compute this by hand with a binary conversion table, but a Subnet Calculator applies that same 32-bit unsigned bitwise math the moment you type an IPv4 address and pick a CIDR prefix or dotted mask, returning the network address, broadcast, first and last usable host, total and usable counts, wildcard mask, IP class, and RFC 1918 private status without sending anything off your machine.

What Subnet Bits Mean in an IPv4 Address
Every IPv4 address is a 32-bit number split into two pieces by the subnet mask: the network portion (the prefix, or subnet bits) and the host portion. Subnet bits are the count of contiguous 1-bits starting at the most significant position of the mask. The host bits are everything that follows — also contiguous, all 0s. In binary the mask is always a string like 11111111.11111111.11111111.00000000; the boundary between the 1s and the 0s is the prefix length.
That prefix length is what CIDR notation exposes: the number after the slash. So /24 says "the first 24 bits identify the network, the last 8 bits identify the host." /16 means 16 subnet bits and 16 host bits. /30 means 30 subnet bits and only 2 host bits. The split between the two is what every other subnet calculation depends on, because the host-bits count is what drives the total address count, the usable host count, and the size of the broadcast block.
From CIDR Prefix to Subnet Mask
The CIDR prefix and the dotted subnet mask are two views of the same split. /24 in slash form becomes 255.255.255.0 in dotted form, because the first three octets are all 1s (eight 1-bits each, summing to 24) and the last octet is all 0s. /16 becomes 255.255.0.0; /30 becomes 255.255.255.252; /8 becomes 255.0.0.0. Once you can convert in either direction, you can read either notation off a router config, a cloud network panel, or a firewall rule without translating in your head.
| CIDR prefix | Subnet bits | Host bits | Subnet mask |
|---|---|---|---|
| /8 | 8 | 24 | 255.0.0.0 |
| /16 | 16 | 16 | 255.255.0.0 |
| /24 | 24 | 8 | 255.255.255.0 |
| /26 | 26 | 6 | 255.255.255.192 |
| /28 | 28 | 4 | 255.255.255.240 |
| /30 | 30 | 2 | 255.255.255.252 |
| /31 | 31 | 1 | 255.255.255.254 |
| /32 | 32 | 0 | 255.255.255.255 |
Usable host counts are computed from the host-bits column with 2^(host bits) − 2 for prefixes up to /30. Use the Subnet Calculator for the exact count for any specific prefix; for a /24 it returns 254 usable hosts out of 256 total addresses.
Calculate Subnet Bits With the Subnet Calculator
- Type an IPv4 address such as 192.168.1.10 into the address field.
- Choose a CIDR prefix like /24, or switch to the Subnet mask field and enter a dotted mask like 255.255.255.0 — the calculator accepts either input.
- Read the results table: the network and broadcast addresses, the first and last usable host, total and usable host counts, subnet and wildcard masks, IP class, and RFC 1918 private status update instantly.
- Confirm the subnet-bit count either by reading the slash form directly or by counting the leading 1-bits in the returned subnet mask, and the rest of the values will line up with the formula.
Every value is computed with 32-bit unsigned bitwise math in your browser, so the address and mask you type never leave your device. That matters when you are working with internal network ranges that you would rather not paste into a remote service.
A Worked Example: 192.168.1.10/24
Take the address 192.168.1.10 with the prefix /24. The number after the slash gives the subnet bits directly: 24. That leaves 32 − 24 = 8 host bits. The total addresses in the block is 2^8 = 256, and the usable host count is 256 − 2 = 254, because the lowest address (the network address, 192.168.1.0) and the highest (the broadcast, 192.168.1.255) are reserved and cannot be assigned to a device.
The subnet mask is the first 24 bits as 1s and the last 8 bits as 0s, which writes out as 255.255.255.0. The wildcard mask inverts every bit, giving 0.0.0.255. AND the address with the mask and you get the network 192.168.1.0; OR the network with the wildcard and you get the broadcast 192.168.1.255. The first usable host is 192.168.1.1 and the last is 192.168.1.254. The Subnet Calculator returns the same set the moment you type the input, with no need to lay out the binary by hand.
Reading the Results: Network, Broadcast, and Host Range
The results table is laid out so each row answers one planning question. The network address is the first address in the block — all host bits set to 0 — and is what routers match against when deciding where to forward a packet. The broadcast address is the last address — all host bits set to 1 — and is what a host sends to when it wants to reach every device on the local subnet at once. Neither can be assigned to a device, which is why the usable host count is always two less than the total address count for prefixes /30 and below.
The first and last usable host rows mark the range you actually configure on hosts. The subnet and wildcard masks are reported together because they are bit-for-bit inverses, and the wildcard is what Cisco access-control lists and OSPF network statements use to match ranges — a 1 bit in the wildcard means "any value here" and a 0 bit means "must match the corresponding bit in the configured address." The IP class row tells you whether the address falls in the historical Class A, B, or C range, a piece of context that still shows up in older documentation even though CIDR (defined in RFC 4632) replaced classful addressing.
Special Cases: /31 and /32
Two prefixes break the 2^(host bits) − 2 rule, and the calculator handles both. A /31 leaves only 1 host bit, so the block has 2 addresses in total. Under RFC 3021, both addresses are valid hosts and there is no separate network or broadcast; a /31 therefore reports 2 usable hosts. RFC 3021 introduced this so that point-to-point links — the link between two routers, for example — do not waste two addresses on a subnet that only ever carries two endpoints.
A /32 has no host bits at all. The network, broadcast, and host are the same single address, and the calculator reports 1 usable host. /32 is how loopback interfaces and single-host firewall rules are written: "this rule applies to one address, not to a range." When you see /32 in a routing table, you are looking at a host route, not a subnet.
Private Ranges and RFC 1918
Three blocks are reserved for internal use and are never routed on the public internet: 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16. RFC 1918 defined them so that organizations can run private networks behind NAT without conflicting with public addresses. Knowing which block an address belongs to matters when you decide whether a service should be exposed externally or stay inside the LAN, and it matters when you read someone else's configuration to understand whether a range is reachable from the public internet at all.
The RFC 1918 row in the calculator output tells you instantly whether the IP you typed falls into one of these blocks. If it does, the address is private; if it does not, the address is either public or belongs to some other reserved range, and you should treat it accordingly before opening a port or publishing a DNS record. For IPv6 work, the equivalent private range is fc00::/7 and the calculation approach differs; if you are moving to v6, the IPv6 subnet mask guide walks through the same prefix logic on a 128-bit address.