Skip to content
CalcTide logo
Tech

CIDR Calculator

192.168.1.10/24 breaks down to network 192.168.1.0, broadcast 192.168.1.255, and 254 usable hosts. A CIDR calculator takes an IPv4 address written in CIDR notation, meaning an address and a prefix length such as /24, and works out everything that notation implies: the subnet mask, the network address, the broadcast address, the first and last usable host, and the total number of addresses in that block. Enter an address and prefix like 10.0.0.5/16 or 172.16.5.200/20, and the tool applies standard IPv4 bitwise subnetting rules to return every value at once. It is built for network engineers, sysadmins, students studying for certification exams, and anyone who needs to read a CIDR block without working through binary math by hand.

TechBy

Quick answer

CIDR notation combines an IPv4 address with a prefix length, written as address/prefix, such as 192.168.1.10/24.

What this tells you

  • CIDR notation combines an IPv4 address with a prefix length, written as address/prefix, such as 192.168.1.10/24.
  • The prefix length tells the tool how many leading bits of the address are the network portion, with the remaining bits available for host addresses.
  • Results include the subnet mask, network address, broadcast address, and the usable host range for that block.
  • Usable host counts follow standard IPv4 convention: the network address and broadcast address are excluded from the usable range for prefixes /0 through /30.
  • Prefixes /31 and /32 are special cases. A /31 has no separate network or broadcast address under the usual rule, and a /32 identifies a single host.
  • This calculator handles IPv4 CIDR only. It does not parse or validate IPv6 prefixes.

How to Use

  1. 1Enter a CIDR string in the single input field, combining an IPv4 address and a prefix length separated by a slash, such as 10.0.0.5/16.
  2. 2Make sure the address has four octets between 0 and 255 and the prefix is a whole number between 0 and 32. Anything outside those ranges will not calculate.
  3. 3Click calculate to generate the subnet mask, network address, broadcast address, first usable host, last usable host, and total usable host count.
  4. 4Compare the network address against the address you entered. If they differ, your input address sits somewhere inside the block rather than exactly on the network boundary, which is normal and expected.
  5. 5Review the usable host range and the /31 or /32 special-case behavior before applying the result to a real routing table, firewall rule, or subnet plan.

How It Works

Formula

Mask = prefix bits set to 1, remaining bits set to 0 Network address = IP address AND mask Broadcast address = Network address OR (NOT mask) Total addresses = 2^(32 - prefix) Usable hosts = 2^(32 - prefix) - 2, except /31 and /32 where usable hosts = 0

A 32-bit IPv4 address is treated as a string of 32 binary digits. The prefix length, the number after the slash, says how many of those leading bits belong to the network. The tool builds a subnet mask by setting that many leading bits to 1 and the rest to 0, so a /24 mask is 24 ones followed by 8 zeros, which is 255.255.255.0. It finds the network address by running a bitwise AND between your IP address and the mask, which clears every host bit to 0. It finds the broadcast address by taking the mask, flipping every bit with a bitwise NOT, and OR-ing that against the network address, which sets every host bit to 1. Total addresses in the block is 2 raised to the power of the remaining host bits, or 2^(32-prefix). Usable hosts is normally that total minus 2, because the lowest address in the block is reserved as the network address and the highest is reserved as the broadcast address. The two exceptions are /31, defined by RFC 3021 for point-to-point links where both addresses in the pair are usable endpoints, and /32, which represents exactly one host address with no network or broadcast concept at all. This calculator reports usable hosts as 0 for both /31 and /32 to reflect that the standard network/broadcast/usable-range model does not apply there, even though a /31 link genuinely uses both of its two addresses.

Calculation note: values are processed in the order shown above, using the current input units.

Worked Examples

Standard /24 home or office network

C I D R192.168.1.10/24
ResultNetwork 192.168.1.0, broadcast 192.168.1.255, usable range 192.168.1.1 to 192.168.1.254 (254 hosts)

A /24 prefix sets a mask of 255.255.255.0, leaving 8 host bits and 256 total addresses. The network address zeroes out those 8 bits to get 192.168.1.0, and the broadcast address sets them all to 1 to get 192.168.1.255. That leaves 254 usable addresses, which is the most common block size for home routers and small office LANs.

Larger /16 block for a campus or site network

C I D R10.0.0.5/16
ResultNetwork 10.0.0.0, broadcast 10.0.255.255, usable range 10.0.0.1 to 10.0.255.254 (65,534 hosts)

A /16 prefix leaves 16 host bits, so the block spans 65,536 total addresses across the third and fourth octets. The mask 255.255.0.0 zeroes out both of those octets for the network address and sets them both to 255 for the broadcast address. Private /16 blocks like this one are common for larger internal networks that get split into smaller subnets later.

Mid-size /20 subnet

C I D R172.16.5.200/20
ResultNetwork 172.16.0.0, broadcast 172.16.15.255, usable range 172.16.0.1 to 172.16.15.254 (4,094 hosts)

A /20 prefix leaves 12 host bits, for 4,096 total addresses and 4,094 usable ones. The mask is 255.255.240.0, so only the last 4 bits of the third octet plus the whole fourth octet vary within the block. Notice the input address 172.16.5.200 is not the network address itself, it just falls inside the 172.16.0.0 to 172.16.15.255 range.

Small /27 subnet carved from a larger block

C I D R192.168.1.130/27
ResultNetwork 192.168.1.128, broadcast 192.168.1.159, usable range 192.168.1.129 to 192.168.1.158 (30 hosts)

A /27 prefix leaves only 5 host bits, giving 32 total addresses per block in steps of 32, so this block runs from .128 through .159. The mask 255.255.255.224 clears the low 5 bits for the network address and sets them for the broadcast address. Blocks this size are typical when a /24 gets split into multiple smaller subnets for different departments or VLANs.

Point-to-point /30 link between two routers

C I D R10.10.10.10/30
ResultNetwork 10.10.10.8, broadcast 10.10.10.11, usable range 10.10.10.9 to 10.10.10.10 (2 hosts)

A /30 prefix leaves 2 host bits, for exactly 4 total addresses: one network address, one broadcast address, and 2 usable addresses. This is the classic block size for a serial or WAN link connecting exactly two routers, since it wastes only 2 addresses instead of the 252 a /24 would waste on the same link. The input address 10.10.10.10 turns out to be the last usable host in its block, not the network address.

Edge case: /31 point-to-point link

C I D R203.0.113.5/31
ResultNetwork-style address 203.0.113.4, broadcast-style address 203.0.113.5, usable hosts reported as 0

A /31 prefix leaves only 1 host bit, so the block has just 2 total addresses. Under the classic network/broadcast model neither address is usable, which is why this tool reports 0 usable hosts here, but RFC 3021 defines /31 specifically for point-to-point links where both addresses act as real host endpoints. Router and firewall configuration guides often call this out explicitly, since it is one of the few places the 'usable hosts equals total minus 2' rule breaks down.

Common IPv4 Prefix Reference

Subnet mask, total addresses, and usable hosts for the prefix lengths seen most often in practice.

PrefixSubnet MaskTotal AddressesUsable Hosts
/8255.0.0.016,777,21616,777,214
/16255.255.0.065,53665,534
/24255.255.255.0256254
/25255.255.255.128128126
/26255.255.255.1926462
/27255.255.255.2243230
/28255.255.255.2401614
/29255.255.255.24886
/30255.255.255.25242
/31255.255.255.25420 (point-to-point exception)
/32255.255.255.25510 (single host)

Every step down by 1 in prefix length doubles the block size. Going from /24 to /23 doubles a 256-address block into a 512-address block.

Reading CIDR notation correctly

CIDR stands for Classless Inter-Domain Routing, and it replaced the older class A, B, and C address system in the 1990s so network sizes could be defined by any prefix length instead of only a few fixed sizes. The prefix number after the slash is what makes a block classless. A /24 does not have to align with a traditional class C boundary, it just means the first 24 bits are fixed as the network portion, wherever that boundary happens to fall.

A smaller prefix number means a bigger block. This trips up a lot of people learning subnetting for the first time, because it feels backward. A /8 covers over 16 million addresses while a /30 covers only 4, so as the prefix number goes up, the network portion of the address grows and the space left for hosts shrinks.

The network address and broadcast address are not addresses you assign to a device. The network address, the lowest address in the block, identifies the subnet itself for routing purposes. The broadcast address, the highest address in the block, is used to send a packet to every host on that subnet at once. Assigning either one to a workstation or server is a common misconfiguration that causes connectivity problems.

VLSM, or variable length subnet masking, is the practice of splitting one larger CIDR block into several smaller ones with different prefix lengths to match the actual number of hosts on each segment. A /24 assigned to a point-to-point router link wastes 252 addresses, while a /30 fits that link with only 2 wasted. This calculator checks one block at a time rather than planning a full VLSM layout, but understanding a single block's network, broadcast, and usable range is the starting point for that kind of design work.

Common mistakes

  • Entering a prefix length outside the 0-32 range, or a non-numeric value after the slash, both of which the tool rejects as invalid CIDR notation.
  • Assuming /31 and /32 follow the standard 'total minus 2' usable-host rule. A /31 is a documented point-to-point exception and a /32 is a single host with no network or broadcast concept.
  • Confusing the network address with the first usable host. The network address, such as 192.168.1.0 in a /24, cannot be assigned to a device, the first usable host starts one address later.
  • Typing an address that already has a broadcast or network-style value in it and assuming that address is what the calculator will show back. The tool always derives the block's actual network and broadcast addresses from the mask, which may differ from the address you typed if it was not exactly on a boundary.
  • Mixing up the direction of the prefix. A smaller number like /8 means a larger block with more hosts, while a larger number like /30 means a smaller block. It is easy to read this backward when first learning subnetting.
  • Treating this IPv4-only tool as if it handles IPv6 prefixes. IPv6 CIDR notation uses the same slash format but a completely different address length and subnetting convention, and this calculator does not parse it.

Embed this calculator on your site

Drop this single line where you want the calculator to appear. It is responsive, mobile-friendly, resizes automatically, and is free to use with attribution.

<script src="https://calctide.com/embed.js" data-tool="cidr-calculator" async></script>

Preview the embed at /embed/cidr-calculator/.

Frequently Asked Questions

It means the first 24 bits of the address are fixed as the network portion, which is equivalent to a subnet mask of 255.255.255.0. The remaining 8 bits are available for host addresses, giving 256 total addresses and 254 usable ones once the network and broadcast addresses are set aside.
A /24 network has 254 usable hosts under standard IPv4 convention. The block contains 256 total addresses, but the lowest address is reserved as the network address and the highest is reserved as the broadcast address, leaving 254 for devices.
No, this version supports IPv4 CIDR notation only, covering prefix lengths from /0 through /32. IPv6 uses a 128-bit address and a different subnetting convention, so it needs a separate calculator built around that address length.
A /31 has only 2 total addresses, and under the classic network-plus-broadcast model neither one is left over as a usable host, so the tool reports 0. In practice, RFC 3021 allows both addresses in a /31 to be used as endpoints on a point-to-point link, which is a documented exception to the general rule.
The network address identifies the subnet itself and cannot be assigned to a device, while the first usable host is the next address after it, ready to assign. For example, in 192.168.1.0/24 the network address is 192.168.1.0 and the first usable host is 192.168.1.1.
A smaller prefix number leaves more bits available for host addresses, which is what makes the block bigger. A /8 fixes only 8 bits for the network and leaves 24 bits for hosts, over 16 million addresses, while a /24 fixes 24 bits and leaves only 8 bits, 256 addresses, for hosts.
Yes, you can enter any valid address inside the block along with its prefix, such as 192.168.1.130/27, and the tool works out which block that address belongs to. The calculated network and broadcast addresses reflect the actual block boundaries, which may differ from the exact address you typed.
The broadcast address is the highest address in a CIDR block and is used to send a single packet to every host on that subnet at once. Like the network address, it is reserved by convention and should not be assigned to an individual device.
A /30 or /31 wastes far fewer IP addresses than a /24 on a link that only ever connects two routers. A /24 assigned to a two-router link wastes 252 addresses that could be used elsewhere, while a /30 wastes only 2 and a /31 wastes none at all.
It estimates cidr calculator outputs using the visible inputs and formula assumptions on this page.

Explore More in Tech