CIDR Calculator

Format: address/prefix. Prefix 0-32. Examples: 10.0.0.0/8, 172.16.0.0/12, 192.168.1.0/24, 10.0.0.0/31.

CIDR block
192.168.1.0/24
Network address
192.168.1.0
Broadcast address
192.168.1.255
First usable host
192.168.1.1
Last usable host
192.168.1.254
Subnet mask
255.255.255.0
Wildcard mask
0.0.0.255
Total IPs
256
Usable IPs
254
IPv4 class
C
Host bits / Prefix
8 host / /24
Subnet mask (binary)
11111111.11111111.11111111.00000000
IP address (binary)
11000000.10101000.00000001.00000000

How CIDR math works

CIDR (Classless Inter-Domain Routing) replaces the old A/B/C class system with a prefix length — the number of leading 1-bits in the subnet mask. A /24 means the top 24 bits identify the network and the bottom 8 bits identify the host, giving 28 = 256 addresses per block. Two of those (network and broadcast) aren't usable for hosts, so a /24 fits 254 hosts. A /16 fits 65,534. A /30 fits 2.

The two edge cases worth knowing: /31 blocks (RFC 3021) are used for point-to-point links and have no network or broadcast address — both addresses are usable, total = usable = 2. A /32 represents a single host; total = usable = 1. The calculator handles both.

PrefixSubnet maskTotal IPsUsable
/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.25422
/32255.255.255.25511

The CIDR Calculator takes an IPv4 CIDR block — say 10.0.0.0/16 — and returns the full subnet breakdown: network address, broadcast, the first and last usable host, total IP count, usable host count, the subnet mask, the wildcard mask (the inverse — useful for ACLs), the mask in binary, and the legacy IPv4 class (A through E). It handles every edge case the math allows: /31 point-to-point links (RFC 3021, both addresses usable), /32 single hosts, /0 the whole IPv4 space. There's a reverse path too — paste an IP and a dotted-decimal mask (255.255.255.0) and it figures out the CIDR. Subnet planning is the kind of work a router admin does ten times a week. A bookmark for this beats a paper cheat sheet.

Built by Bob QA by Ben Shipped

How to use

  1. 1

    Pick a mode: CIDR notation (the default), or IP + mask if you have a dotted-decimal subnet mask.

  2. 2

    In CIDR mode, paste a block like 192.168.1.0/24, 10.0.0.0/8, or 172.16.5.10/20. The prefix can be 0-32 — host bits below the prefix get truncated to the network address.

  3. 3

    In IP + mask mode, enter the IP (e.g. 192.168.1.10) and the dotted-decimal mask (e.g. 255.255.255.0). The mask must be contiguous — all 1-bits before all 0-bits, like every real-world mask.

  4. 4

    Read the breakdown: network, broadcast, host range, totals, masks, binary representation, and class. Every value has a copy button.

  5. 5

    For /31 you'll see two usable addresses and no broadcast/network reservation — that's RFC 3021. For /32 every field collapses to the single host. The calculator does not invent rules to fill the cells; it shows you what the math says.

Frequently asked questions

Ratings & Reviews

Rate this tool

Sign in to rate and review this tool.

Loading reviews…