Subnet Calculator

Enter a CIDR block and get the full breakdown — network, broadcast, usable range, masks and binary — plus split it into subnets, find the minimal CIDR for two addresses, and check overlap or membership. All computed locally, for IPv4 or IPv6.

4 dot-separated octets (0–255) followed by /0–/32
✕ {{ipv4.error}}
{{ipv4.note}}
full or :: compressed address followed by /0–/128
✕ {{ipv6.error}}
Result
Network {{ipv4.network}} ✓ copied
Broadcast {{ipv4.broadcast}} ✓ copied
First usable {{ipv4.first}} ✓ copied
Last usable {{ipv4.last}} ✓ copied
Netmask {{ipv4.netmask}} ✓ copied
Wildcard mask {{ipv4.wildcard}} ✓ copied
Total addresses {{ipv4.total}} ✓ copied
Usable hosts {{ipv4.usable}} ✓ copied
Class {{ipv4.cls}} ✓ copied

legacy classification, not an operational rule for CIDR

Binary
IP
Netmask

■ network bits   ■ host bits

Result
Prefix {{ipv6.prefixLabel}} ✓ copied
Network (compressed) {{ipv6.networkCompressed}} ✓ copied
Network (expanded) {{ipv6.networkExpanded}} ✓ copied
Last address (compressed) {{ipv6.lastCompressed}} ✓ copied
Last address (expanded) {{ipv6.lastExpanded}} ✓ copied
Total addresses 2^{{ipv6.hostBits}} ({{ipv6.totalDecimal}}) ✓ copied
Split into subnets
New prefix → {{splitV4.count.toLocaleString()}} subnet{{splitV4.count===1?'':'s'}}

✕ {{splitV4.error}}

Split into subnets
New prefix → {{splitV6.count.toLocaleString()}} subnet{{splitV6.count===1?'':'s'}}

✕ {{splitV6.error}}

Aggregate two addressesminimal CIDR containing both

✕ {{aggregateResultV4.error}}

Minimal CIDR {{aggregateResultV4.cidr}} ✓ copied
Aggregate two addressesminimal CIDR containing both

✕ {{aggregateResultV6.error}}

Minimal CIDR {{aggregateResultV6.cidr}} ✓ copied
Overlap & membershipagainst {{ipv4Input}}

A bare address checks membership; a CIDR block (with /prefix) checks overlap.

✕ {{overlapResultV4.error}}

{{overlapResultV4.overlaps ? '✓' : '✕'}} {{overlapResultV4.label}} {{overlapResultV4.single ? (overlapResultV4.overlaps ? 'is inside' : 'is not inside') : (overlapResultV4.overlaps ? 'overlaps' : 'does not overlap')}} {{ipv4Input}}

Overlap & membershipagainst {{ipv6Input}}

A bare address checks membership; a CIDR block (with /prefix) checks overlap.

✕ {{overlapResultV6.error}}

{{overlapResultV6.overlaps ? '✓' : '✕'}} {{overlapResultV6.label}} {{overlapResultV6.single ? (overlapResultV6.overlaps ? 'is inside' : 'is not inside') : (overlapResultV6.overlaps ? 'overlaps' : 'does not overlap')}} {{ipv6Input}}

About this tool

Given a CIDR block, this masks the address to find the network, flips the host bits to find the broadcast (IPv4 only), and derives the usable host range, netmask and wildcard mask from the prefix length.

IPv6 has no broadcast address and uses 128-bit arithmetic (via BigInt) instead of 32-bit, so results show the compressed and expanded forms of the network and last address in the block.

Splitting lays out equal-size subnets back to back starting at the block's own network address, for a new prefix you choose — capped at 65,536 subnets in the list so it stays something you can actually scroll and export, not a real protocol limit. Aggregating two addresses finds their longest common prefix and reports the smallest CIDR block that contains both — the same calculation a router does when summarizing routes. Overlap and membership are the same test at heart: two blocks overlap when they agree on the bits covered by whichever prefix is shorter, and a single address "belongs" to a block exactly when that's true treating the address as a /32 (or /128) — so a bare address checks membership and a full CIDR checks overlap, picked automatically by whether you typed a /prefix.

All parsing and math happen locally in your browser. Nothing you enter is sent anywhere.