CIDR Calculator (IPv4)

Convert CIDR to IP ranges, subnet and supernet networks, summarize multiple CIDR blocks, and detect overlaps. Built for network engineers, SREs, and students.

1. Single CIDR / Subnet details

Subnet summary

Network

Network address
Broadcast address
First usable
Last usable

Size & mask

Subnet mask
Wildcard mask
Total addresses
Usable hosts
Prefix length
Show binary representation
IP address:
Subnet mask:
Subnetting helper

2. Multiple CIDR tools (summarize & overlap)

Paste one CIDR per line to summarize, merge, or check for overlaps.

How this CIDR calculator works

This CIDR calculator focuses on IPv4 and is designed to be fast, accurate, and practical for day‑to‑day network engineering. It supports:

  • Converting CIDR notation (e.g. 192.168.1.0/24) to full subnet details.
  • Entering an IP address + subnet mask and getting the equivalent CIDR.
  • Listing subnets of a larger network at a new prefix length.
  • Summarizing multiple CIDR blocks into the smallest set of supernets.
  • Detecting overlapping CIDR ranges.

Key CIDR formulas

Total addresses

\( \text{total} = 2^{32 - p} \) where p is the prefix length.

Usable hosts (typical subnets)

\( \text{usable} = \max(0, 2^{32 - p} - 2) \)

For /31 and /32, all addresses are technically usable (point‑to‑point or host routes). This tool reports them accordingly.

From prefix length to subnet mask

The subnet mask is a 32‑bit number with the first p bits set to 1 and the remaining bits set to 0. For example:

  • /24 → 11111111.11111111.11111111.00000000 → 255.255.255.0
  • /26 → 11111111.11111111.11111111.11000000 → 255.255.255.192

Network and broadcast addresses

Internally, the calculator converts the IP to a 32‑bit integer and applies bitwise operations:

Network address

\( \text{network} = \text{ip} \,\&\, \text{mask} \)

Broadcast address

\( \text{broadcast} = \text{network} \,|\, \neg \text{mask} \)

Subnetting vs supernetting

Subnetting

Subnetting splits a larger block into smaller ones by increasing the prefix length. For example, splitting 10.0.0.0/24 into /26 subnets yields:

  • 10.0.0.0/26
  • 10.0.0.64/26
  • 10.0.0.128/26
  • 10.0.0.192/26

Use the Subnetting helper in the tool: choose a target prefix and it lists all child subnets with first/last host.

Supernetting / CIDR aggregation

Supernetting combines multiple contiguous networks into a larger block by decreasing the prefix length. For example:

  • 192.168.0.0/24 + 192.168.1.0/24 → 192.168.0.0/23

Paste multiple CIDRs into the Multiple CIDR tools area and click “Summarize / supernet”. The calculator normalizes, sorts, merges overlaps, and outputs the minimal covering set.

Typical CIDR sizes

CIDR Subnet mask Total addresses Usable hosts*
/30 255.255.255.252 4 2
/29 255.255.255.248 8 6
/28 255.255.255.240 16 14
/24 255.255.255.0 256 254
/22 255.255.252.0 1,024 1,022
/16 255.255.0.0 65,536 65,534

*Usable hosts assumes traditional network/broadcast reservation.

FAQ

Can I use this CIDR calculator for IPv6?

This version focuses on IPv4, which keeps the interface simple and fast. IPv6 support (including /64 planning and address compression) is planned as a separate tool so that each stays easy to use.

Why do /31 and /32 show 0 or 1 usable hosts?

Historically, IPv4 subnets reserved the first address as the network and the last as the broadcast address. For /31 and /32, that convention doesn’t make sense. Modern standards (RFC 3021) allow /31 for point‑to‑point links, and /32 represents a single host route. This calculator reports total addresses accurately and notes that usable host counts are special in these edge cases.

What’s the difference between this and a basic subnet calculator?

Many subnet calculators only handle one CIDR at a time. This tool also:

  • Summarizes multiple CIDRs into minimal supernets.
  • Detects overlapping ranges between blocks.
  • Shows binary representations to help with learning and troubleshooting.