Cidr Calculator - IPv4 Subnet, Network, IP Broadcast

Use this CIDR calculator to convert an IPv4 address and a /0-/32 prefix length into the network address, broadcast, subnet mask, wildcard mask, and usable host range.

Updated: June 19, 2026 • Free Tool

Cidr Calculator

Dotted-decimal IPv4 address. Each octet must be 0-255.

Number of leading 1-bits in the subnet mask. /0 matches the whole IPv4 space, /32 matches one host.

Results

Network Address
0
Broadcast Address 0
First Usable Host 0
Last Usable Host 0
Total Addresses 0
Usable Hosts 0
Subnet Mask 0
Wildcard Mask 0

What Is a CIDR Calculator?

A CIDR calculator is a network planning tool that turns an IPv4 address and a CIDR prefix length (the number after the slash, such as /24 or /26) into the full subnet block: the network address, the broadcast address, the subnet mask, the wildcard mask, and the usable host range. CIDR stands for Classless Inter-Domain Routing and is the addressing scheme that replaced the old classful A, B, and C splits. The calculator handles every prefix from /0 (the default route) to /32 (a single host route), so it works for home networks, office LANs, cloud subnets, and ISP allocations.

  • Plan IPv4 subnets: Pick a prefix length that fits the number of devices you need, then read the usable host count to confirm the block is large enough.
  • Validate a CIDR block in a config or ticket: Paste a CIDR string from a firewall rule, OSPF network statement, or cloud security group and read the network, broadcast, and host range the rule covers.
  • Document a network plan: Generate the dotted-decimal subnet mask and wildcard mask for a documented prefix and copy them into a network diagram or runbook.
  • Study for networking exams: See how the prefix length, mask, and host count relate for the common /24, /26, and /30 sizes used in practice problems.

The prefix length is the number of leading 1-bits in the subnet mask. A /24 prefix means 24 of the 32 bits identify the network and 8 bits identify the host, which yields 256 total addresses and 254 usable hosts. A /26 prefix leaves 6 host bits, which yields 64 total addresses and 62 usable hosts. The calculator does this math for any prefix from /0 to /32, including the /31 point-to-point case and the /32 host route.

Once you have the CIDR block, the IP Address Converter shows the binary and hexadecimal form of the same IPv4 address alongside the network and broadcast.

How the CIDR Calculator Works

The calculator parses the IPv4 address into a 32-bit integer, builds a 32-bit subnet mask from the prefix length, and applies three bitwise operations to expose the rest of the block.

network = ip AND mask; broadcast = network OR NOT(mask); usableHosts = 2^(32-prefix) - 2
  • ip: The 32-bit unsigned integer form of the IPv4 address, parsed octet by octet
  • prefix: The CIDR prefix length, from 0 to 32, that counts the leading 1-bits in the mask
  • mask: The 32-bit subnet mask with leading prefix bits set to 1 and trailing (32 - prefix) bits set to 0
  • network: Lowest 32-bit value in the block, found by ANDing the IP with the mask
  • broadcast: Highest 32-bit value in the block, found by ORing the network with the bitwise inverse of the mask
  • usableHosts: Addresses assignable to devices, equal to 2^(32 - prefix) minus two, two for /31, zero for /32

Once the mask is known, every other output follows from a single bitwise operation. The network address is the IP AND mask, which clears the host bits. The broadcast address is the network OR the inverse of the mask, which sets every host bit to 1. All of the outputs you see in the right panel are computed in a single pass from the parsed IP and prefix length.

Compute the block for 192.168.1.50/26

IP: 192.168.1.50, Prefix: /26

Mask = 255.255.255.192. Network = 192.168.1.0. Broadcast = 192.168.1.63. Usable hosts = 2^6 - 2 = 62.

Network 192.168.1.0, Broadcast 192.168.1.63, First host 192.168.1.1, Last host 192.168.1.62, Total 64, Usable 62, Mask 255.255.255.192, Wildcard 0.0.0.63

The input address 192.168.1.50 sits inside the 192.168.1.0/26 block, which is one of four equal /26 subnets of the 192.168.1.0/24 network.

According to IETF RFC 4632, Classless Inter-Domain Routing (CIDR) uses a prefix length after the address to indicate the number of leading 1-bits in the subnet mask, replacing the older classful A/B/C split.

If you need to also size multiple subnets of the same parent network, the Subnet Calculator steps through a top-down subnet design for the same /24 or /16 parent block.

Key Concepts Explained

Four ideas explain every output the CIDR calculator shows: the prefix length, the subnet mask, the network and broadcast addresses, and the usable host range.

CIDR prefix length

The number after the slash, written as /24 or /26. It counts the leading 1-bits in the subnet mask, so a longer prefix means a smaller block.

Subnet mask

A 32-bit value with the leading prefix bits set to 1 and the trailing 32 - prefix bits set to 0. The mask for /26 is 255.255.255.192 and the mask for /16 is 255.255.0.0.

Network and broadcast addresses

The lowest and highest addresses in a CIDR block. The network has every host bit set to 0, the broadcast has every host bit set to 1, and neither is assignable for prefixes /30 and shorter.

Usable host range

The range of addresses between the network and broadcast that you can assign to devices. For /30 and shorter, that range is network + 1 to broadcast - 1. For /31, both addresses are usable per RFC 3021.

These four concepts cover the inputs and the eight outputs the calculator displays. The prefix length drives the mask, the mask determines the network and broadcast, and the network and broadcast bracket the usable host range.

When the CIDR block backs a storage cluster and you need to size the volumes, the Data Storage Converter translates GB and TB into the same numbers that sit inside the network plan.

How to Use This Calculator

Type an IPv4 address in dotted-decimal form, set the prefix length, and read the network, broadcast, mask, and host counts on the right.

  1. 1 Enter the IPv4 address: Type the address in dotted-decimal form, four octets separated by dots. Each octet must be between 0 and 255.
  2. 2 Set the CIDR prefix length: Pick the prefix length in /0 to /32. Common values are /24 for a 256-address block, /26 for 64, and /30 for 4.
  3. 3 Read the network and broadcast: The first two outputs are the lowest and highest addresses in the block. The network is the block identifier and the broadcast is reserved for directed broadcasts on older stacks.
  4. 4 Check the subnet and wildcard masks: Use the subnet mask in dotted-decimal for device configs and the wildcard mask for access lists and routing protocol network statements.
  5. 5 Confirm the host counts: The total address count is 2^(32 - prefix). The usable host count is that number minus two, except for /31 (two usable) and /32 (zero usable).

A small office has 30 devices that need static IPs on a 10.10.0.0/16 network. Set the IP to 10.10.0.1 and the prefix to /27. The calculator shows the network 10.10.0.0, broadcast 10.10.0.31, 30 usable hosts, and the mask 255.255.255.224, which fits the 30-device requirement with two addresses to spare.

Benefits of Using This Calculator

A CIDR calculator removes the manual binary math that tends to introduce mistakes when you are sizing a subnet or checking a config.

  • Cuts out binary arithmetic: You do not need to convert octets by hand to find the mask, the network, and the broadcast. The calculator shows every output as a dotted-decimal string.
  • Validates prefix length and IP at the same time: Typing the IP and the prefix in the same form surfaces typos and out-of-range octets before they reach a config file.
  • Surfaces the usable host count: The host count is the single most useful number for capacity planning. The calculator shows the total address count and the usable host count side by side.
  • Covers edge cases automatically: /31 point-to-point links and /32 host routes follow RFC 3021, not the usual minus-two rule. The calculator applies both rules and shows the right count.
  • Pins the mask to the prefix: The dotted-decimal mask and the wildcard mask update with the prefix, so the same calculator covers the network statement, the access list, and the documentation.

The strongest use case is validating a CIDR string you did not write yourself. A ticket may say 10.20.0.0/22, and the calculator shows 1024 total addresses, 1022 usable hosts, and the mask 255.255.252.0, which is enough information to confirm the block fits the expected number of devices.

After the block is sized, the Bandwidth Calculator estimates the link throughput available to the same host, which is the next thing most network plans document.

Factors That Affect Your Results

Three things change the eight outputs on the right: the IP you enter, the prefix length you choose, and the special-case rules for /31 and /32.

The IPv4 address you enter

Only the host bits of the address matter. Two addresses in the same block, such as 192.168.1.50 and 192.168.1.60, produce the same network, broadcast, mask, and host count for the same prefix.

The prefix length you choose

The prefix length drives every other output. A /24 block holds 256 addresses, a /26 block holds 64, and a /30 block holds 4. Pick the smallest prefix that fits the number of devices you need.

The /31 point-to-point rule

RFC 3021 makes both addresses in a /31 block usable for point-to-point links, which overrides the usual minus-two rule. The calculator shows two usable hosts for /31.

The /32 host route rule

A /32 block is a single host route. The network, broadcast, first host, and last host are all the same address, and the usable host count is zero because the one address is the network itself.

Reserved-range membership

The same prefix math applies inside 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 127.0.0.0/8, and 224.0.0.0/4. The calculator does not flag the range, so check whether the block is routable before you put it in a config.

  • IPv4 only. IPv6 uses 128-bit addresses, hexadecimal groups, and different prefix conventions, so it needs a separate parser and a separate calculator.
  • The host counts follow the usual minus-two rule, with the /31 and /32 exceptions. Custom subnetting rules used by some carriers and ISPs are not modeled, so always cross-check a non-standard block with the source routing policy.

If you are sizing a block for a known number of devices, work backward from the host count. Pick the smallest prefix that gives you a usable host count greater than the number of devices you need, then round up to the next standard prefix length.

According to IETF RFC 3021, a /31 prefix yields two usable addresses and is intended for point-to-point links, overriding the usual subtract-two rule.

According to IANA IPv4 Special-Purpose Address Registry, blocks such as 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 127.0.0.0/8, and 224.0.0.0/4 are reserved for private, loopback, and multicast use.

For capacity planning, the Upload Time Calculator shows how long a file of a given size takes to move through the same link that sits inside the CIDR block.

CIDR calculator showing IPv4 network, broadcast, subnet mask, wildcard mask, and usable host range for any prefix length
CIDR calculator showing IPv4 network, broadcast, subnet mask, wildcard mask, and usable host range for any prefix length

Frequently Asked Questions

Q: What is a CIDR calculator?

A: A CIDR calculator is a network tool that takes an IPv4 address and a prefix length, such as 192.168.1.50/26, and returns the full subnet block: the network address, broadcast address, subnet mask, wildcard mask, total address count, and usable host range. It removes the manual binary math required to size a subnet or validate a config.

Q: How do I find the subnet mask from a CIDR prefix?

A: Set the leading prefix bits to 1 and the trailing 32 - prefix bits to 0. The mask for /24 is 255.255.255.0, the mask for /26 is 255.255.255.192, and the mask for /16 is 255.255.0.0. The CIDR calculator renders the mask in dotted-decimal form for any prefix from /0 to /32.

Q: How many usable hosts are in a /24 network?

A: A /24 network has 256 total addresses. The first and last are the network and broadcast, so 254 addresses are assignable to devices. The CIDR calculator shows the total count and the usable count side by side for any prefix, including the /31 and /32 edge cases.

Q: What is the network address of 192.168.1.50/26?

A: A /26 mask is 255.255.255.192, and 192.168.1.50 AND 255.255.255.192 = 192.168.1.0. The matching broadcast is 192.168.1.63, the first usable host is 192.168.1.1, and the last usable host is 192.168.1.62. The calculator shows all four values along with the mask and the host count.

Q: How do you convert CIDR to a dotted-decimal mask?

A: Take the prefix length and split it into four 8-bit groups. /26 is 26 leading 1-bits, which is 11111111.11111111.11111111.11000000 in binary and 255.255.255.192 in dotted-decimal. The calculator builds the mask in 32-bit integer form and renders it in dotted-decimal for you.

Q: What is the difference between a network address and a broadcast address?

A: The network address is the lowest 32-bit value in a CIDR block, with every host bit set to 0, and the broadcast address is the highest 32-bit value, with every host bit set to 1. For prefixes /30 and shorter, neither address is assignable to a device, and the usable host range sits between them.