CIDR Notation & IP Subnet Calculator (IPv4, IPv6 & IP Range)

Calculate Classless Inter-Domain Routing (CIDR) subnets, subnet and wildcard masks, and standard or cloud Virtual Private Cloud (VPC) usable hosts for IPv4 and IPv6. Convert IP ranges to CIDR, split or summarize blocks, and check overlaps in your browser.

Exact 128-bit BigInt math
Try:
24 network bits · 8 host bits · 256 addresses
11000000 10101000 00000001 00000000
Live default 192.168.1.0/24 Edit input or slide prefix to recompute
Private internal network
Canonical network
192.168.1.0/24
Mask 255.255.255.0
Full IP range
192.168.1.0
to 192.168.1.255
Standard usable / total
254 / 256
192.168.1.1 to 192.168.1.254
Cloud VPC usable
251 / 252
AWS & Azure 251 · GCP 252
Calculated CIDR network breakdown
Field Value
Canonical network 192.168.1.0/24
Subnet mask 255.255.255.0
Wildcard mask (Cisco ACL, flipped mask) 0.0.0.255
Full IP range 192.168.1.0 to 192.168.1.255
Usable host range 192.168.1.1 to 192.168.1.254
Broadcast address 192.168.1.255
Total addresses 256
Standard usable hosts 254 (2^8 - 2 (network and broadcast addresses reserved))
AWS VPC usable 251 (AWS reserves 5 IPs; /16 to /28)
Azure VNet usable 251 (Azure reserves 5 IPs; /2 to /29)
Google Cloud VPC usable 252 (GCP primary range reserves 4 IPs; /4 to /29)
Address scope Private internal network (192.168.0.0/16)
Reverse DNS zone hint 1.168.192.in-addr.arpa
100% Free · No Sign Up IPv4, IPv6 & IP Range to CIDR Split, Summarize & Overlap
Runs Locally in Your Browser

How to read your CIDR results and cloud VPC host counts

Under the official internet standard for classless routing (IETF RFC 4632), the prefix number after the slash splits an IP address into fixed network bits on the left and assignable host bits on the right. Every network boundary, dotted subnet mask, Cisco Access Control List (ACL) wildcard mask (the bitwise inverse of the subnet mask), and usable address range derives directly from that bit split. IPv4 blocks report a subnet mask, a wildcard mask, and a broadcast address on /0 through /30 networks; IPv6 blocks report the first address, last address, and total capacity because IPv6 uses multicast instead of broadcast.

Worked binary example: 192.168.1.130/26

A /26 keeps the first 26 bits fixed (subnet mask 255.255.255.192, wildcard 0.0.0.63) and leaves 6 host bits (64 addresses per block). Applying the mask aligns 192.168.1.130 to network 192.168.1.128/26, spanning 192.168.1.128 through broadcast 192.168.1.191, with 62 standard usable hosts from 192.168.1.129 to 192.168.1.190.

Usable host capacity depends on where the subnet runs. Standard local networks reserve two addresses (network ID and broadcast), whereas cloud Virtual Private Cloud (VPC) and Virtual Network (VNet) platforms reserve additional internal gateway and DNS addresses and enforce different minimum IPv4 subnet sizes:

IPv4 subnet reservation counts and minimum prefix sizes across standard networks, AWS VPC, Azure VNet, and Google Cloud VPC
Environment Reserved IPs per subnet Supported IPv4 bounds /29 usable /28 usable /24 usable
Standard IPv4 subnet 2 (network, broadcast) /0 to /30 6 14 254
AWS VPC 5 (.0, .1 router, .2 DNS, .3 future, broadcast) /16 to /28 Not supported 11 251
Microsoft Azure VNet 5 (.0, .1 gateway, .2/.3 DNS, broadcast) /2 to /29 3 11 251
Google Cloud VPC (primary range) 4 (.0, .1 gateway, second-to-last, broadcast) /4 to /29 (subject to range rules) 4 12 252

Cloud values reflect standard documented reservations (Google Cloud primary IPv4 ranges support /4 to /29 subject to non-overlapping and allowed-range rules, while secondary IPv4 ranges reserve zero addresses; AWS Bring Your Own IP blocks can use network and broadcast addresses). Always confirm provider console limits before deploying production networks, and review full internal, Carrier-Grade NAT (CGNAT), and documentation blocks in the reserved and private IP ranges reference.

How to size subnets, convert IP ranges, and avoid overlaps

Follow this workflow to size subnets accurately, convert firewall or email IP lists into clean CIDR notation, and prevent routing collisions:

  1. Add platform reservations before choosing a prefix. Count peak hosts plus reserved addresses (+5 for AWS VPC or Azure VNet, +4 for a Google Cloud primary IPv4 range) before picking a block size. For example, 60 hosts fit inside a standard /26 (62 usable) or a Google Cloud /26 (60 usable), but require a /25 (123 usable) on AWS or Azure where a /26 leaves only 59 usable addresses.
  2. Assign separate private blocks per region and environment. Give each cloud region and stage its own non-overlapping private block (such as 10.10.0.0/16 for production and 10.20.0.0/16 for staging) so future Virtual Private Network (VPN) tunnels and VPC peering connect without renumbering.
  3. Convert arbitrary IP ranges and summarize mail-server lists into minimal CIDRs. Firewall rules and email Sender Policy Framework (SPF) ip4: or ip6: entries require aligned prefixes and consume zero of SPF's 10 DNS lookups. Use the IP Range tab to convert start-to-end spans without pulling in neighboring IPs, review CIDR rules in the SPF record syntax guide, or compact large sender lists with the SPF flattener.
  4. Use dedicated point-to-point and IPv6 local-network prefix sizes. Under the point-to-point IPv4 link standard (IETF RFC 3021), a /31 subnet gives two usable router endpoints without wasting addresses on network or broadcast IDs. In IPv6, use /127 for router-to-router links and keep every local network at /64 so Stateless Address Autoconfiguration (SLAAC) lets devices configure addresses automatically; compare both families in the IPv4 vs IPv6 guide.
  5. Check for overlaps and pack uneven tiers cleanly. Pack mixed host requirements with Variable-Length Subnet Masking (VLSM), locate your next unallocated subnet in the Overlap & Next Free tab, and export your subnet table to CSV before modifying route tables or security groups.

Checking boundary alignment, cloud reservations, and overlap ahead of deployment prevents both early IP exhaustion and overly broad firewall permissions.

Verify CIDR math from the command line (Python and ipcalc)

Python's built-in ipaddress module reproduces every calculation mode on this page locally from any terminal, and Linux ipcalc prints a quick subnet breakdown. These commands verify address arithmetic rather than live internet routing:

# 1. Canonical network, dotted mask, wildcard (hostmask), and total addresses
python3 -c "import ipaddress; n=ipaddress.ip_network('192.0.2.141/26', strict=False); print(n, n.netmask, n.hostmask, n.num_addresses)"
# -> 192.0.2.128/26 255.255.255.192 0.0.0.63 64

# 2. Convert a start-to-end range into the smallest exact CIDR list
python3 -c "import ipaddress; print([str(x) for x in ipaddress.summarize_address_range(ipaddress.ip_address('192.0.2.10'), ipaddress.ip_address('192.0.2.25'))])"
# -> ['192.0.2.10/31', '192.0.2.12/30', '192.0.2.16/29', '192.0.2.24/31']

# 3. Summarize adjacent or overlapping CIDRs into minimal blocks
python3 -c "import ipaddress; nets=[ipaddress.ip_network(x) for x in ['192.168.0.0/24','192.168.1.0/24','192.168.2.0/23']]; print([str(x) for x in ipaddress.collapse_addresses(nets)])"
# -> ['192.168.0.0/22']

# 4. Check whether two networks overlap or contain an address
python3 -c "import ipaddress; print(ipaddress.ip_address('10.24.5.9') in ipaddress.ip_network('10.24.0.0/16'))"
# -> True

# 5. Quick Linux subnet summary
ipcalc 192.168.1.0/24

Passing strict=False to ipaddress.ip_network() mirrors this calculator's automatic host-bit normalization, aligning inputs like 192.0.2.141/26 to their canonical network address 192.0.2.128/26.

Complete IPv4 (/0 to /32) and IPv6 prefix reference tables

Every IPv4 prefix length from /0 (the entire IPv4 space) to /32 (a single host IP) has a fixed subnet mask, Cisco ACL wildcard mask, total address count, and cloud-provider usable capacity. Click any row to load that prefix into the calculator above:

Complete IPv4 CIDR prefix reference from /0 to /32 with subnet masks, wildcard masks, and standard, AWS, Azure, and GCP usable host counts
Prefix Subnet mask Wildcard mask Total IPs Usable hosts AWS (-5) Azure (-5) GCP (-4)
/0 0.0.0.0 255.255.255.255 4,294,967,296 4,294,967,294 - - -
/1 128.0.0.0 127.255.255.255 2,147,483,648 2,147,483,646 - - -
/2 192.0.0.0 63.255.255.255 1,073,741,824 1,073,741,822 - 1,073,741,819 -
/3 224.0.0.0 31.255.255.255 536,870,912 536,870,910 - 536,870,907 -
/4 240.0.0.0 15.255.255.255 268,435,456 268,435,454 - 268,435,451 268,435,452
/5 248.0.0.0 7.255.255.255 134,217,728 134,217,726 - 134,217,723 134,217,724
/6 252.0.0.0 3.255.255.255 67,108,864 67,108,862 - 67,108,859 67,108,860
/7 254.0.0.0 1.255.255.255 33,554,432 33,554,430 - 33,554,427 33,554,428
/8 255.0.0.0 0.255.255.255 16,777,216 16,777,214 - 16,777,211 16,777,212
/9 255.128.0.0 0.127.255.255 8,388,608 8,388,606 - 8,388,603 8,388,604
/10 255.192.0.0 0.63.255.255 4,194,304 4,194,302 - 4,194,299 4,194,300
/11 255.224.0.0 0.31.255.255 2,097,152 2,097,150 - 2,097,147 2,097,148
/12 255.240.0.0 0.15.255.255 1,048,576 1,048,574 - 1,048,571 1,048,572
/13 255.248.0.0 0.7.255.255 524,288 524,286 - 524,283 524,284
/14 255.252.0.0 0.3.255.255 262,144 262,142 - 262,139 262,140
/15 255.254.0.0 0.1.255.255 131,072 131,070 - 131,067 131,068
/16 255.255.0.0 0.0.255.255 65,536 65,534 65,531 65,531 65,532
/17 255.255.128.0 0.0.127.255 32,768 32,766 32,763 32,763 32,764
/18 255.255.192.0 0.0.63.255 16,384 16,382 16,379 16,379 16,380
/19 255.255.224.0 0.0.31.255 8,192 8,190 8,187 8,187 8,188
/20 255.255.240.0 0.0.15.255 4,096 4,094 4,091 4,091 4,092
/21 255.255.248.0 0.0.7.255 2,048 2,046 2,043 2,043 2,044
/22 255.255.252.0 0.0.3.255 1,024 1,022 1,019 1,019 1,020
/23 255.255.254.0 0.0.1.255 512 510 507 507 508
/24 255.255.255.0 0.0.0.255 256 254 251 251 252
/25 255.255.255.128 0.0.0.127 128 126 123 123 124
/26 255.255.255.192 0.0.0.63 64 62 59 59 60
/27 255.255.255.224 0.0.0.31 32 30 27 27 28
/28 255.255.255.240 0.0.0.15 16 14 11 11 12
/29 255.255.255.248 0.0.0.7 8 6 - 3 4
/30 255.255.255.252 0.0.0.3 4 2 - - -
/31 255.255.255.254 0.0.0.1 2 2 (point-to-point) - - -
/32 255.255.255.255 0.0.0.0 1 1 - - -

Each additional network bit halves the address pool, placing the practical global Border Gateway Protocol (BGP) routing floor at /24. Learn how networks originate and filter public prefixes in the Autonomous System Number (ASN) guide.

IPv6 replaces variable host-bit sizing with standardized prefix boundaries focused on how many /64 subnets each allocation provides:

Common IPv6 prefix lengths, /64 subnet counts, total addresses, and typical infrastructure roles
IPv6 prefix /64 subnets Total addresses Typical infrastructure role
/32 4,294,967,296 2^96 Typical Regional Internet Registry (RIR) allocation to an Internet Service Provider (ISP)
/48 65,536 2^80 Common enterprise or multi-site organization assignment
/56 256 2^72 Common residential broadband or small-business site delegation
/64 1 18,446,744,073,709,551,616 Standard local network subnet required for automatic SLAAC addressing
/127 n/a 2 Point-to-point inter-router link
/128 n/a 1 Single host route or loopback address (::1/128)

Keeping every client Local Area Network (LAN) at /64 ensures automatic IPv6 device configuration works across operating systems, while /48 and /56 site sizes are common conventions rather than one mandatory rule. Translate individual IPv4 addresses into IPv6 representations with the IPv4 to IPv6 converter.

Verified edge cases and exact-cover examples

Every boundary case below is checked against Python's ipaddress module to confirm host-bit normalization, two-endpoint /31 behavior, exact range decomposition, and 128-bit IPv6 summarization:

Verified IPv4 and IPv6 CIDR edge-case fixtures
Input Computed output Why it matters
192.0.2.141/26 Aligns to 192.0.2.128/26 (mask 255.255.255.192, wildcard 0.0.0.63) Usable 192.0.2.129 to 192.0.2.190 (62 hosts); broadcast 192.0.2.191
198.51.100.0/31 Point-to-point router link (2 total, 2 usable, no broadcast) Both endpoints usable: 198.51.100.0 and 198.51.100.1
192.0.2.10 to 192.0.2.25 192.0.2.10/31, 192.0.2.12/30, 192.0.2.16/29, 192.0.2.24/31 Exact 4-block cover of 16 addresses with 0 extra addresses
2001:db8::1/128 + 2001:db8::2/128 Stays 2 separate /128 blocks when summarized Neither merges into ::/0 nor expands to cover ::0 or ::3

What this CIDR calculator does not check

Because every calculation runs locally on IP arithmetic without making network queries, keep these operational boundaries in mind:

  • Live BGP routing or network ownership: Address math validates block boundaries without checking which ISP or Autonomous System announces that prefix on the public internet.
  • Active IP utilization or DHCP leases: Theoretical usable counts do not scan which addresses inside your LAN or cloud VPC are already assigned by Dynamic Host Configuration Protocol (DHCP) or static rules.
  • Non-standard cloud subnet exceptions: Cloud counts reflect default subnet reservations; specialized gateway subnets, Google Cloud secondary IPv4 ranges, or Bring Your Own IP (BYOIP) ranges follow separate provider rules.
  • Discontiguous legacy subnet masks: Standard CIDR requires all network 1-bits on the left with zero gaps, so non-contiguous masks such as 255.0.255.0 are rejected rather than approximated.
  • Live DNS records or reverse PTR delegation: The reverse zone hint shows the expected .in-addr.arpa or .ip6.arpa zone name without querying live DNS delegation or checking Network Address Translation (NAT) mappings; see NAT explained for how private subnets translate to public IPs.

Frequently asked questions

How many usable IP addresses are in a /24, /28, /29, or /31 subnet?+

A standard IPv4 /24 holds 256 total addresses and 254 usable host addresses because the network ID and broadcast address are reserved. A /28 holds 16 total with 14 usable, a /29 holds 8 total with 6 usable, and a /31 holds 2 addresses where both are usable on a point-to-point router link. Cloud virtual networks reserve additional addresses: AWS VPC reserves 5 per subnet with a /28 minimum (251 usable in a /24, 11 in a /28, and /29 is not supported), Azure VNet reserves 5 per subnet down to /29 (251 in a /24, 11 in a /28, 3 in a /29), and Google Cloud primary IPv4 ranges reserve 4 down to /29 (252 in a /24, 12 in a /28, 4 in a /29).

How do I calculate CIDR notation from a subnet mask like 255.255.255.0?+

Count the leading 1-bits when the subnet mask is written in binary: 255.255.255.0 consists of twenty-four 1-bits followed by eight 0-bits, which equals /24. You can also enter an IP and dotted mask directly into this calculator, such as 10.0.5.12 255.255.255.0 or 10.0.5.12/255.255.255.0, and it converts the mask to canonical CIDR notation while rejecting non-contiguous masks.

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

A subnet mask marks network bits with 1s and host bits with 0s (such as 255.255.255.0 for a /24). A wildcard mask is the exact bitwise inverse, marking bits that must match with 0s and ignored host bits with 1s (0.0.0.255 for a /24). Network interfaces use subnet masks, while Cisco router Access Control Lists (ACLs) and OSPF network statements use wildcard masks.

How do you convert a start-to-end IP range into minimal CIDR blocks?+

Start at the first IP address, take the largest power-of-two-aligned block that begins on that address without passing the end IP, and repeat from the next address until the entire range is covered. An aligned range such as 192.0.2.0 to 192.0.2.255 collapses into one 192.0.2.0/24 block, whereas 192.0.2.10 through 192.0.2.25 decomposes into four exact blocks (192.0.2.10/31, 192.0.2.12/30, 192.0.2.16/29, and 192.0.2.24/31) covering only those 16 addresses with zero extra IPs.

Why is /64 the standard subnet size in IPv6 and does IPv6 have a broadcast address?+

Standard IPv6 addressing reserves the trailing 64 bits for the device interface identifier, which Stateless Address Autoconfiguration (SLAAC) requires on local networks, giving every /64 subnet 18,446,744,073,709,551,616 addresses. IPv6 has no broadcast address at all and uses multicast instead, while inter-router point-to-point links commonly use /127 and organizations receive larger /48 or /56 allocations to subdivide into /64 networks.

Does this CIDR calculator send my IP ranges or VPC layouts to any server?+

No. Every calculation mode on this page (subnet breakdown, host-count sizing, range-to-CIDR conversion, equal split, custom VLSM packing, summarization, overlap checking, and next-free-subnet lookup) runs as local arithmetic in your browser, so the IP addresses and subnet plans you enter are never transmitted to any PromptDNS server.

Next checks

  • Inspect geolocation, network owner, and live ASN data for an IP with the IP lookup.
  • Verify which public CIDR prefixes an Autonomous System announces in the ASN lookup.
  • Check reverse DNS (PTR) hostnames for addresses inside a block with the reverse IP lookup.
  • Validate an SPF record that references your public CIDR blocks using the SPF record checker.

Last verified: 2026-12-02