SeaMeWe4 Net Tools Subnet calculator

CIDR Calculator — CIDR to IP range and IP range to CIDR

A CIDR calculator converts between CIDR notation (an IP address plus a slash and a prefix length) and the IP address range it represents — and the other direction too: give it any IP range and it finds the smallest set of CIDR blocks that covers it exactly.

CIDR calculator

Switch between the two directions below.

Network / host bits
Start address192.168.4.0
End address192.168.7.255
Subnet mask255.255.252.0
Total addresses1,024

CIDR notation explained

Diagram of network bits versus host bits, the basis for CIDR prefix notation

CIDR (Classless Inter-Domain Routing) writes a network as an IP address, a slash, and the number of fixed network bits — 192.168.4.0/22 means the first 22 bits are fixed and the remaining 10 bits identify hosts inside that block. It replaced the older fixed classful system (RFC 4632) because it lets a network be any size, not just a /8, /16 or /24.

CIDR to subnet mask table

CIDRSubnet maskTotal addresses
/20255.255.240.04,096
/21255.255.248.02,048
/22255.255.252.01,024
/23255.255.254.0512
/24255.255.255.0256
/25255.255.255.128128
/26255.255.255.19264

Supernetting: combine routes

Four /24 networks from 10.0.0.0 to 10.0.3.0 combined into one 10.0.0.0/22 route

Supernetting is the reverse of subnetting: combining several contiguous, aligned networks into one larger block so a router only needs a single route. Four consecutive /24 networks — 10.0.0.0/24, 10.0.1.0/24, 10.0.2.0/24 and 10.0.3.0/24 — are exactly one /22 (10.0.0.0/22), as long as they start on a /22 boundary and nothing in between is missing. This is exactly what the “IP range → CIDR” tab above works out automatically.

Frequently asked questions

Why does an IP range sometimes need several CIDR blocks?

A single CIDR block must start on an address boundary that matches its own size (a /28 must start on a multiple of 16, for example). If your range’s start or end address doesn’t line up with a convenient boundary, it takes more than one block, often of different sizes, to cover it exactly.

What’s the smallest and largest CIDR prefix?

/0 represents the entire IPv4 address space (4,294,967,296 addresses) and /32 represents a single address. Everything in between is a valid CIDR prefix.

Is CIDR the same as a subnet mask?

They describe the same thing in two notations. A /24 and a mask of 255.255.255.0 both mean 24 fixed network bits — see the subnet calculator for the full conversion both ways.

This calculator is part of SeaMeWe4 Net Tools, an independent set of free networking calculators.

Was this page helpful?

One tap tells us which guides need more detail.