CIDR Calculator

Calculate network address, broadcast address, usable host range, subnet mask and host count from any IPv4 CIDR block. Runs entirely in your browser.

Runs entirely in your browser. Your input is never sent to our servers.

Try:

192.168.1.0/24 Private range

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
Prefix length
/24
Total addresses
256
Usable hosts
254
Binary representation
Address
11000000.10101000.00000001.00000000
Mask
11111111.11111111.11111111.00000000

The mask’s leading 24 bits identify the network; the remaining 8 bits identify hosts within it.

What is CIDR?

CIDR (Classless Inter-Domain Routing) notation writes an IP network as an address followed by a prefix length, such as 192.168.1.0/24, where the prefix length is the number of leading bits that identify the network rather than a host within it.

What this CIDR Calculator does

Give this calculator any IPv4 block and it derives every value that block implies: the network address, the broadcast address, the first and last usable host, the subnet mask in both dotted-decimal and wildcard form, and how many addresses the block contains.

It accepts a prefix length (192.168.1.0/24) or a dotted-decimal mask in the same position (192.168.1.0/255.255.255.0), because router and firewall configuration syntax varies and both forms are common in the field.

How to use it

  1. Type or paste an IPv4 address with a prefix, for example 172.16.5.130/26.
  2. The address does not have to be the network address. Give it any host inside the block and the calculator finds the network the host belongs to.
  3. Read the derived values. Expand Binary representation to see which bits the mask covers.

Understanding your results

Network address — the first address in the block, formed by zeroing every host bit. It names the subnet; it is not assigned to an interface.

Broadcast address — the last address, with every host bit set to one. Traffic sent here reaches every host on the segment, so it is not assignable either.

First and last usable host — the assignable range, which normally excludes the two addresses above. This is why a /24 holds 256 addresses but only 254 hosts.

Wildcard mask — the bitwise inverse of the subnet mask. Cisco ACLs and OSPF network statements take a wildcard rather than a mask, and mixing the two up is a classic cause of a rule silently matching nothing.

Private range — whether the network falls inside RFC 1918 space (10/8, 172.16/12, 192.168/16), loopback, carrier-grade NAT space or link-local. Private addresses are not routable across the public internet.

Why this matters

Subnetting decisions are difficult to reverse. A block that is too small forces a renumbering exercise across DHCP scopes, firewall rules, monitoring targets and documentation. A block that is far too large wastes address space and, on a flat layer-2 segment, enlarges the broadcast domain and the blast radius of anything that moves laterally.

Getting the arithmetic right also matters for security controls. A firewall rule written against 10.0.0.0/16 when the author meant 10.0.0.0/24 exposes 255 times more address space than intended, and nothing in the rule’s syntax will flag the mistake.

Worked examples

Splitting a /24 into four /26s. Each /26 has 64 addresses and 62 usable hosts. The four networks are .0/26, .64/26, .128/26 and .192/26. Enter 172.16.5.130/26 and the calculator returns the 172.16.5.128/26 block, because .130 sits inside the third quarter.

A point-to-point link. 203.0.113.6/31 yields two usable addresses and no broadcast address. RFC 3021 permits this on point-to-point links where a broadcast address serves no purpose, halving the addresses a WAN link consumes compared with the older /30 convention.

A host route. 8.8.8.8/32 describes exactly one address. Routing tables and firewall rules use /32 to refer to a single host.

Common mistakes

Confusing prefix length with usable hosts. A /24 provides 254 usable addresses, not 256. Subtract two for the network and broadcast addresses on any prefix shorter than /31.

Assuming a smaller prefix means a smaller network. It is the reverse: a /16 is far larger than a /24, because fewer bits are spent identifying the network and more remain for hosts.

Writing a wildcard mask where a subnet mask belongs. 255.255.255.0 and 0.0.0.255 describe the same boundary but are not interchangeable, and most devices accept both without complaint.

Overlapping allocations. 10.1.0.0/16 and 10.1.5.0/24 overlap. Routing usually follows the most specific match, so the result is often subtly wrong rather than obviously broken.

Technical background

Before CIDR, IPv4 used fixed classes: class A networks had an 8-bit prefix, class B 16 bits and class C 24 bits. An organisation needing 500 addresses had to take a class B with 65,534 of them, which wasted address space at scale and inflated the global routing table. CIDR, specified in RFC 4632, replaced classes with an explicit prefix length, allowing allocations at any bit boundary and letting adjacent blocks be aggregated into a single routing entry.

An IPv4 address is a 32-bit unsigned integer; dotted-decimal notation is a convenience for humans. The prefix length says how many leading bits are the network portion. The network address is the bitwise AND of the address and the mask, and the broadcast address is the network address with every remaining bit set. This calculator performs exactly those operations on 32-bit unsigned integers.

Limitations

This calculator handles IPv4 only. IPv6 uses the same prefix concept but a 128-bit address space and no broadcast address, so the arithmetic and the conventions differ.

It reports what an address block means, not how your network is actually configured. It cannot tell you whether a range is already allocated, reachable, or filtered.

Frequently asked questions

Why does a /24 have 254 usable hosts instead of 256?

The first address in the block is the network address and the last is the broadcast address. Neither can be assigned to an interface, so 256 total addresses leave 254 for hosts.

What is the difference between a subnet mask and a wildcard mask?

They are bitwise inverses. A subnet mask marks network bits with 1s (255.255.255.0); a wildcard mask marks the bits that are allowed to vary (0.0.0.255). Cisco access lists and OSPF network statements expect wildcard masks.

Can I use a /31 for a normal subnet?

Only for point-to-point links. RFC 3021 allows both addresses in a /31 to be used because a broadcast address is unnecessary when exactly two devices share the link. On a multi-access segment you need /30 or shorter.

Does the address I enter have to be the network address?

No. Enter any host address with its prefix and the calculator masks it down to the network the host belongs to. Entering 172.16.5.130/26 returns the 172.16.5.128/26 block.

Is my input sent anywhere?

No. The arithmetic runs entirely in your browser using JavaScript. Nothing is transmitted to our servers or logged.

References

Last reviewed