IPv4 and IPv6 Subnet Calculator: CIDR, Masks and Ranges
Find the exact network block, address count, endpoints and IPv4 subnet mask from an address and prefix. No network lookup.
Result
How is this calculated?
A prefix fixes the leading address bits. Clearing the remaining bits gives the block start; setting them gives the end.
Worked example: Find the block containing a documentation address
192.0.2.140/26 uses 26 prefix bits and leaves six bits for addresses. The block is 192.0.2.128/26, ending at 192.0.2.191. It contains 64 addresses; conventional IPv4 host arithmetic leaves 62 after the two boundary addresses.
Method and limits
IPv4 /31 has two endpoints only in point-to-point mode. An IPv4 /32 denotes one address, not a multi-host subnet. IPv6 has no broadcast address; this tool reports its inclusive mathematical range, not an assignable-host count. IPv6 display compresses the longest zero run per RFC 5952. RFC 3021 describes /31 usage. The address is processed locally; no traffic is sent to it.
How to use this calculator
- Enter an IPv4 or IPv6 address followed by /prefix. Alternatively, enter the address alone and use the separate input for the prefix length or a contiguous IPv4 dotted mask.
- Read the normalized network block, inclusive endpoints and exact count. Change the IPv4 /31 convention only when interpreting that kind of block.
Find the block containing a documentation address
192.0.2.140/26 uses 26 prefix bits and leaves six bits for addresses. The block is 192.0.2.128/26, ending at 192.0.2.191. It contains 64 addresses; conventional IPv4 host arithmetic leaves 62 after the two boundary addresses.
A prefix determines both the size and the alignment
Each extra prefix bit halves the block size. For /26 the IPv4 block contains 2^6 = 64 addresses. The last octet can start at 0, 64, 128 or 192. A last octet of 140 falls into the block starting at 128.
Check the boundary convention separately from the size
198.51.100.10/31 has two mathematical addresses, .10 and .11. The point-to-point selection interprets both as endpoints; it never changes the underlying range. A /32 is one mathematical address and not a shared host range.
Read IPv6 as a range, not a host forecast
The documentation address 2001:db8::23/126 belongs to 2001:db8::20/126 and the last address is 2001:db8::23. IPv6 has no broadcast address. An exact range count does not indicate which addresses are assignable or active.
Frequently asked questions
- Why does the displayed block differ from my input?
- The block begins with the host bits cleared. The normalized address row retains the address you entered.
- Can I enter an IPv4 mask?
- Yes; for example, use address 192.0.2.140 and mask 255.255.255.192 in separate inputs. Do not also append /26. Noncontiguous masks are rejected.
- Is the last IPv6 address a broadcast address?
- No. The last address is the upper bound of the mathematical range, not a broadcast address.
- Does this test availability or send traffic?
- No. It applies local address arithmetic and does not look up, contact or test any network.
Common mistakes and limits
- Results do not determine reachability, ownership, routability, allocations or which machines are present.
- IPv4 host rows follow the selected convention, not a complete treatment of special-purpose ranges. IPv6 output reports the inclusive block, not usable-host policy.
Sources & methodology
Related calculators
- Binary Calculator & Converter
Calculate in base 2 or convert between binary and decimal without rounding the internal value.
- Hexadecimal Calculator & Converter
Calculate in base 16 or convert between hexadecimal and decimal, including exact fractional values.
- Bandwidth, File Transfer Time and Data Calculator
Find ideal download or upload time, convert data units, or estimate average data usage and website traffic.