Free IPv4 and IPv6 subnet calculator

Calculate IPv4 and IPv6 network prefixes, address ranges, masks, host bits, and adjacent subnets privately in your browser.

Format
Free browser tool
Updated
Updated
ToolVPS

Calculated on this device

Calculate an IPv4 or IPv6 subnet

Planning a LAN, VPS network, or IPv6 allocation? Enter an address and CIDR prefix to see the complete network range and practical details.

No account · No API · No address stored

IPv4 and IPv6 are recognized automatically. Examples: 192.168.1.10/24 or 2001:db8::42/64.

A larger prefix creates a smaller network. IPv4 prefixes range from /0 to /32.

Examples
IPv4 prefixes

The calculation runs entirely in this page. The address is not sent to Bitfoo, added to the URL, or written to browser storage.

Ready to calculate.

How to use the IPv4 and IPv6 subnet calculator

  1. Enter an IPv4 or IPv6 address and CIDR prefix, such as 192.168.1.10/24 or 2001:db8::42/64.
  2. The calculator recognizes the address family automatically. IPv4 prefixes run from /0 through /32; IPv6 prefixes run from /0 through /128.
  3. Select “Calculate subnet” to see the network prefix, mask, address range, address type, and adjacent equally sized networks.
  4. Use “Copy results” when you need a plain-text summary for a ticket, configuration note, or change plan.

The calculator accepts unambiguous dotted-decimal IPv4 plus compressed, expanded, and IPv4-embedded IPv6 notation. IPv6 results are normalized to the concise lowercase form recommended by RFC 5952. Interface-specific zone IDs such as %eth0 are intentionally excluded because they do not change the numeric subnet.

Everything runs locally in the browser; no address, result, or network plan is sent to Bitfoo or added to the page URL.

What the subnet calculator results mean

CIDR notation combines an address with a prefix length. In 192.168.1.0/24, the first 24 of IPv4's 32 bits identify the network. In 2001:db8::/64, the first 64 of IPv6's 128 bits identify the network prefix. IPv4 classless prefix notation is defined in RFC 4632, while IPv6 address and prefix notation is defined in RFC 4291.

ResultMeaningCommon use
Network addressThe first address in the calculated blockRouting tables, firewall rules, and network documentation
Subnet maskThe dotted-decimal form of the CIDR prefixInterface and legacy network configuration
Wildcard maskThe bitwise inverse of the subnet maskAccess-control lists and address matching on some platforms
Broadcast addressThe final address in a conventional /0 through /30 subnetDirected broadcast within IPv4 networks that support it
Usable host rangeThe addresses between the conventional network and broadcast addressesPlanning interface, server, and device assignments
Adjacent subnetsThe equally sized networks immediately before and after this blockChecking boundaries while dividing or documenting address space
IPv6 prefix maskThe 128-bit prefix shown in hexadecimal rather than an IPv4 dotted-decimal maskConfirming which IPv6 bits identify the network
IPv6 address typeRecognition of common global, unique-local, link-local, multicast, documentation, transition, and special-purpose addressesUnderstanding an address's intended scope or use

The mathematical address range does not prove that every address is assignable in a particular cloud, hosting, or network platform. Providers may reserve addresses for gateways, DNS, platform services, subnet-router anycast, or other infrastructure.

Common IPv4 CIDR prefixes and subnet masks

A larger prefix leaves fewer host bits and therefore creates a smaller subnet. The conventional usable-host count below subtracts the network and broadcast addresses through /30; /31 and /32 use their modern special-case behavior.

PrefixSubnet maskTotal addressesUsable hosts
/8255.0.0.016,777,21616,777,214
/12255.240.0.01,048,5761,048,574
/16255.255.0.065,53665,534
/20255.255.240.04,0964,094
/22255.255.252.01,0241,022
/24255.255.255.0256254
/25255.255.255.128128126
/26255.255.255.1926462
/27255.255.255.2243230
/28255.255.255.2401614
/29255.255.255.24886
/30255.255.255.25242
/31255.255.255.25422 on a point-to-point link
/32255.255.255.25511 host route

Common IPv6 prefixes and what they mean

IPv6 addresses contain 128 bits and use CIDR prefix lengths directly. There is no IPv6 broadcast address; multicast replaces broadcast behavior. The calculator therefore reports the complete prefix range instead of subtracting a network and broadcast address. These fundamentals come from the IPv6 Addressing Architecture in RFC 4291.

PrefixHost bitsCommon context
/3296A common size for an ISP or larger network allocation; assignment policy varies
/4880A common site allocation that can contain 65,536 separate /64 networks
/5672A common smaller-site or residential delegation that can contain 256 /64 networks
/6464The standard subnet size for most IPv6 LANs and stateless address autoconfiguration
/9632Used by some IPv4/IPv6 translation and embedded-address mechanisms
/1271Two addresses for an inter-router point-to-point link under RFC 6164
/1280One exact IPv6 address, commonly represented as a host route

The “Address use” result recognizes common assignments in the current IANA IPv6 Special-Purpose Address Registry, including documentation, unique-local, link-local, loopback, multicast, translation, benchmarking, and transition ranges. A classification describes the address itself; it does not test live reachability or confirm a provider's routing policy.

Why IPv4 /31 and /32 subnets are different

A traditional host-count formula subtracts two addresses for the network and directed broadcast. Applying that rule to every prefix incorrectly reports that /31 and /32 have no usable addresses.

RFC 3021 defines /31 addressing for IPv4 point-to-point links. Both addresses are interpreted as host addresses on that link, with no separate network or broadcast reservation. A /32 identifies one exact IPv4 address and is commonly used for host routes, loopback interfaces, and precise firewall or routing entries.

This calculator reports two usable point-to-point endpoints for /31 and one address for /32. Whether a particular device or provider supports those uses is still determined by that platform.

Private and special-purpose IPv4 address ranges

The “Address use” result recognizes public unicast addresses plus common entries from the IANA IPv4 Special-Purpose Address Registry, including private, shared, loopback, link-local, documentation, benchmarking, multicast, and reserved ranges. The three private-use blocks are:

Private blockAddress rangeCommon context
10.0.0.0/810.0.0.0 – 10.255.255.255Large private networks and cloud virtual networks
172.16.0.0/12172.16.0.0 – 172.31.255.255Private organizational and container networks
192.168.0.0/16192.168.0.0 – 192.168.255.255Home and small-office networks

A classification describes the entered address, not whether it is routed or reachable in a particular network. Provider policy, firewalls, routes, address translation, and platform reservations still determine how an address can be used.

Common subnet calculator questions

What is a subnet?

A subnet is a contiguous block of IP addresses identified by shared network bits. Routers and firewalls use that prefix to match a group of addresses without listing every address individually.

Does a /24 always have 254 usable hosts?

A conventional IPv4 /24 contains 256 addresses and leaves 254 after excluding its network and directed broadcast addresses. A hosting or cloud provider may reserve additional addresses, so its assignable count can be lower.

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

A subnet mask uses ones for network bits and zeroes for host bits. A wildcard mask inverts those bits. For example, /24 is 255.255.255.0 with a wildcard mask of 0.0.0.255.

Why does the calculator reject leading zeroes?

Values such as 010 have historically been interpreted differently by different software. Requiring ordinary decimal notation keeps the address unambiguous.

Does this calculator support IPv6?

Yes. Enter compressed or expanded IPv6 with a prefix from /0 through /128. The calculator recognizes IPv6 automatically and reports its normalized and expanded address, network prefix, prefix mask, host bits, complete range, adjacent prefixes, and common address type. It also accepts IPv4-embedded forms such as ::ffff:192.0.2.1.

Why is there no usable-host count or broadcast address for IPv6?

IPv6 does not use broadcast addresses, and all-zero or all-one fields are generally legal. The calculator therefore reports the exact number of addresses in the prefix and its complete mathematical range rather than applying the IPv4 convention of subtracting two addresses. A platform may still reserve particular addresses for operational purposes.

Why is /64 so common in IPv6?

A /64 leaves a 64-bit interface identifier and is the standard subnet size for most IPv6 LANs and stateless address autoconfiguration. Longer prefixes are still useful for defined cases such as /127 inter-router links and /128 host routes.

Does Bitfoo receive or save the IP address?

No. The calculator performs fixed arithmetic in your browser. The entered address is not sent to an API, stored by the tool, added to the URL, or included in analytics.