IP subnet calculator (IPv4 and IPv6)
Calculate the network, address range, and count from an IPv4 or IPv6 address and CIDR prefix.
Input
The example value has been entered. Check it immediately or change the value.
Input is processed in the browser. Refreshing returns a sample value.
Result
Check or change the value using the example value result.
For IPv4, /0–/30 excludes the network and broadcast addresses from the conventional host count; /31 and /32 use the RFC 3021 point-to-point and single-address assumptions. For IPv6, it returns the normalized network and full CIDR range and address count, without a usable-host count or broadcast address. For either family, it does not classify private, reserved, or special-purpose addresses, determine routability, or predict device behavior. IPv6 zone identifiers such as %eth0 are not accepted.
Share result
Share the tool link and result text together. No URL is included in the result. Check the below content and then share it.
Calculation·conversion criteria
Enter an IPv4 or IPv6 address and CIDR prefix to calculate its network and range.
Input example
192.168.1.37/24 → network 192.168.1.0 · 254 conventional hosts; 2001:db8:1234:5678::42/64 → network 2001:db8:1234:5678:: · 18,446,744,073,709,551,616 addresses in the range
IPv4 192.168.1.37/24 has network 192.168.1.0, range 192.168.1.0–192.168.1.255, and 254 conventional hosts. IPv6 2001:db8:1234:5678::42/64 spans 2001:db8:1234:5678::–2001:db8:1234:5678:ffff:ffff:ffff:ffff, or 2^64 = 18,446,744,073,709,551,616 addresses. The IPv6 result is a mathematical CIDR range, not a usable-host count.
How to use
- Use the example values or change IP address (IPv4 or IPv6) and CIDR prefix length (/0–/32 IPv4 · /0–/128 IPv6).
- Click Verify result and check the following result.
- Result can be copied if needed.
Frequently asked questions
/24 prefix means what?
The first 24 bits of IPv4 32-bit address represent the network prefix. The remaining 8 bits indicate 254 hosts after removing network and broadcast addresses.
/31 and /32 how are host counts calculated?
/31 assumes a point-to-point link per RFC 3021, treating both addresses as hosts. /32 uses a single IPv4 host path for one address. Check the device documentation for network device settings.
Do you want to know if it’s a private IP or a public IP?
This calculator only calculates the CIDR range of the entered value. It does not determine whether a address is private, reserved, or for special use, or whether it can be assigned to a real network.
Does IPv6 have a broadcast address or a usable-host count?
IPv6 has no broadcast address. The address count is the full CIDR range defined by the prefix; it does not determine whether each address can be assigned to an interface or routed.
Can I calculate an IPv6 address with a %eth0 zone identifier?
No. A zone identifier supplies network-interface context for a link-local address and is not part of the address-bit calculation. Enter the IPv6 address without a suffix such as %eth0.
Calculation criteria and reference materials
- RFC 4632 — Classless Inter-domain Routing (CIDR)
Explains the length of the IPv4 prefix and CIDR address range. The calculator calculates the 32-bit mask, network, and last address.
- RFC 3021 — 31-Bit Prefixes on IPv4 Point-to-Point Links
Describes the condition where two addresses at /31 are interpreted as host addresses on the point-to-point link, and directed broadcast is not used.
- RFC 4291 — IP Version 6 Addressing Architecture
IPv6 addresses are 128 bits; address prefixes can be 0–128 bits long; and there is no broadcast address. Range calculation does not judge address assignment or routing suitability.
- RFC 5952 — A Recommendation for IPv6 Address Text Representation
IPv6 text uses lowercase hexadecimal, removes optional leading 0s, compresses the longest 0 run, and prefers the earlier run when tied. The parser also accepts valid embedded IPv4 notation.
Verification of calculation criteria: · Calculation·verification principles · Report errors