CIDR IP Subnet Calculator – DataMorph

Determine IP address allocations using CIDR notation. View subnet ranges, host counts, and masks.

What is CIDR Calculator?

CIDR (Classless Inter-Domain Routing) notation represents IP networks using an address followed by a slash and prefix length: 192.168.1.0/24. The prefix length specifies how many bits of the 32-bit IPv4 address define the network portion — the remaining bits identify individual hosts. CIDR replaced the older classful networking scheme (Class A/B/C) and enables efficient, flexible IP address allocation that delays IPv4 exhaustion.

This CIDR calculator takes any IPv4 CIDR block and computes the complete network details: network address, broadcast address, first and last usable host addresses, total host count, subnet mask in dotted decimal and hexadecimal, wildcard mask, and the IP class information. It also supports CIDR aggregation (summarizing multiple subnets into a single supernet) and CIDR splitting (dividing a network into smaller subnets).

Understanding CIDR Prefix Lengths

In IPv4, a /24 prefix means 24 bits are fixed (the network), leaving 8 bits variable (hosts). 2^8 = 256 total addresses, minus 2 reserved (network address and broadcast) = 254 usable hosts. Common CIDR blocks: /8 (Class A, 16,777,214 hosts), /16 (Class B, 65,534 hosts), /24 (Class C, 254 hosts), /30 (point-to-point links, 2 hosts), /32 (single host route).

Smaller prefix = larger network: /16 contains 65,536 addresses while /28 contains only 16. The subnet mask is derived from the prefix length: /24 → 255.255.255.0 (24 ones followed by 8 zeros in binary). The wildcard mask (inverse mask) used in access control lists is the bitwise complement: /24 → 0.0.0.255.

Private Address Ranges and Network Design

RFC 1918 defines three private IPv4 address ranges not routable on the public internet: 10.0.0.0/8 (10.x.x.x), 172.16.0.0/12 (172.16-31.x.x), and 192.168.0.0/16 (192.168.x.x). These ranges are used in private networks, corporate intranets, home networks, and container networking. NAT (Network Address Translation) maps private addresses to public IPs for internet access.

Network design involves allocating CIDR blocks to subnets based on host count requirements, growth projections, and routing efficiency. Subnetting creates smaller, isolated broadcast domains: a /16 can be split into 256 /24 subnets for department isolation. VLSM (Variable Length Subnet Masking) enables allocating appropriately-sized subnets rather than wasteful fixed allocations.

When Developers Use CIDR Calculator

Frequently Asked Questions

What does /24 mean in CIDR notation?

/24 means the first 24 bits of the 32-bit IPv4 address define the network, leaving 8 bits for host identification. This corresponds to the subnet mask 255.255.255.0. A /24 network contains 2^8 = 256 addresses total: 1 network address (first), 1 broadcast address (last), and 254 usable host addresses.

How do I calculate the number of hosts from a CIDR prefix?

Host count = 2^(32 - prefix_length) - 2. The -2 subtracts the network address and broadcast address. /24: 2^8 - 2 = 254 hosts. /28: 2^4 - 2 = 14 hosts. /30: 2^2 - 2 = 2 hosts (point-to-point links). /32: 2^0 - 2 = -1... meaning /32 is a host route with no subnet hosts (it IS the host).

What is the difference between network address and broadcast address?

Network address is the first address in a subnet (all host bits = 0) and identifies the subnet itself — routers use it for routing table entries but it cannot be assigned to a host. Broadcast address is the last address (all host bits = 1) — packets sent to the broadcast address are delivered to all hosts on the subnet. Both are reserved and cannot be assigned to individual network interfaces.

What are RFC 1918 private IP address ranges?

RFC 1918 defines three private (non-internet-routable) IPv4 ranges: 10.0.0.0/8 (16.7M addresses), 172.16.0.0/12 (1M addresses, covers 172.16.x.x through 172.31.x.x), and 192.168.0.0/16 (65K addresses). These are used for private networks with NAT gateways for internet access. The 169.254.0.0/16 range is reserved for link-local auto-configuration (APIPA).

How do I split a /24 network into two /25 subnets?

A /25 has one more bit in the network portion than /24, so borrowing one host bit creates two /25 subnets from each /24. For 192.168.1.0/24: First /25 = 192.168.1.0/25 (hosts 192.168.1.1-126), Second /25 = 192.168.1.128/25 (hosts 192.168.1.129-254). Each /25 has 2^7 - 2 = 126 usable hosts. Further splitting each /25 gives four /26s, etc.

Related Tools