FreeToGenerate.com

100% free · no sign-up · everything in your browser

Examples
IP version
IPv4
CIDR notation
192.168.1.0/24
Network address
192.168.1.0
Usable host range
192.168.1.1 – 192.168.1.254
Broadcast address
192.168.1.255
Subnet mask
255.255.255.0
Wildcard mask
0.0.0.255
Total addresses
256
Usable hosts
254
Host bits
8
As an integer
3232235786
As hexadecimal
0xC0A8010A
Mask in binary
11111111.11111111.11111111.00000000
Reserved block
Private use (RFC 1918) · 192.168.0.0/16
Historical class
C

The first address in the block names the network and the last is the broadcast address, so neither can be assigned to a machine — which is where the familiar “subtract two” comes from.

Shown because it is still taught and still searched for, not because it decides anything. Classful addressing was deprecated in favour of CIDR in 1993; the prefix length above is what actually determines the network.

Split into smaller subnets

Everything is calculated in your browser. Nothing is uploaded.

Also available in: Español · Português · Français · العربية

IP Subnet Calculator

Enter an IP address and prefix to get the full picture of its network — network and broadcast addresses, usable host range, subnet mask, and a breakdown of smaller subnets — for both IPv4 and IPv6.

What is a subnet calculator?

A subnet calculator takes an IP address together with a prefix length and works out everything that prefix implies about the network the address sits in: where the network starts, where it ends, which addresses in between are actually assignable to a host, and what the subnet mask looks like. The prefix is usually written in CIDR notation — the slash and a number, as in 192.168.1.10/24 — which states how many of the address's leading bits identify the network rather than the host. A larger number after the slash means a smaller network: /24 sets aside 8 bits for hosts, /30 sets aside only 2.

This calculator accepts CIDR notation directly, or an address paired with a dotted subnet mask (172.16.5.1 255.255.254.0), or a bare address with no prefix at all, and it works the same way for IPv4 and IPv6 — the version is detected automatically from what you type. There is nothing to upload and nothing to submit: every field in the results panel recomputes as you type, because the whole thing is arithmetic on the bits of the address, not a lookup against anything external.

How to use the subnet calculator

  1. Type an address into the text field. It reads a CIDR prefix like 192.168.1.10/24, an address and a dotted subnet mask separated by a space like 172.16.5.1 255.255.254.0, or a bare address with no prefix at all — every format is parsed as you type, with no upload and no calculate button to press. The row of example buttons loads a sample in one click if you would rather start from a known case.
  2. Adjust the prefix length dropdown for a different network size. It lists every valid prefix for the version you entered — 0 through 32 for IPv4, 0 through 128 for IPv6 — and stays in sync with the text field in both directions, so changing one updates the other without retyping the mask by hand.
  3. Read the results, then split the network if you need smaller blocks. The panel lists the network address, the usable host range, the broadcast address, the subnet mask and wildcard mask, the total and usable address counts, and a note on why that usable count applies to this particular prefix. Picking a longer prefix in the split section breaks the network into subnets of that size and states how many of them are being shown out of the true total, rather than truncating the list silently.

The exceptions to “usable hosts equals total minus two”

The rule most people learn — subtract two from the total address count, one for the network address and one for the broadcast address — is right for ordinary IPv4 subnets but wrong for several prefixes that come up constantly in real networks, and this is where a lot of subnet calculators quietly get the number wrong. A /24 has 256 total addresses and 254 usable by that rule, and that part holds. It stops holding at the edges.

An IPv4 /31 is the clearest case. RFC 3021 states that the two addresses in a /31 must be interpreted as host addresses, specifically to eliminate the use of a directed broadcast on a point-to-point link — the kind of link that joins two routers with nothing else attached. So a /31 has two usable hosts and no broadcast address at all, not zero usable hosts as the naive rule would say. The point of the rule is to stop a /30 wasting half its four addresses on a link that only ever has two endpoints.

IPv6 subtracts one, not two, and for an unrelated reason. RFC 4291 says plainly that there are no broadcast addresses in IPv6, their function having been superseded by multicast — so there is nothing to exclude at the top of the range. What is excluded is at the bottom: RFC 4291 section 2.6.1 defines the address with an all-zeros interface identifier as the Subnet-Router anycast address, which every router serving that subnet is required to support. That is why an IPv6 /64 has 18,446,744,073,709,551,616 total addresses but one fewer usable than that, not two fewer. The IPv6 equivalent of the /31 case is the /127: RFC 6164 requires routers to support /127 prefixes on point-to-point inter-router links and to disable the Subnet-Router anycast address specifically when a /127 is used, so both addresses in a /127 are usable, matching IPv4's /31 rather than the general IPv6 rule.

At the far end, a /32 in IPv4 or a /128 in IPv6 is not a network at all — it identifies exactly one address, with one usable host, the shape used for host routes rather than subnets. The calculator reports the correct usable count for every one of these cases rather than applying the total-minus-two rule uniformly.

What else the calculator reports, and its honest limits

Alongside the numbers above, the results panel shows the address as a plain integer and in hexadecimal, the subnet mask spelled out in binary for IPv4, the fully expanded form of an IPv6 address, and — where it applies — the historical class letter (A, B or C) the address would once have belonged to. That last one is shown because people are still taught it and still search for it, not because it still means anything: RFC 4632 records that the Class A/B/C system was deprecated in 1993 in favour of classless prefixes, and it is the prefix length you set, not the leading bits of the address, that decides where the network boundary actually falls today.

Parsing is deliberately strict rather than forgiving. An octet written with a leading zero, like 192.168.001.1, is rejected instead of guessed at, because some systems read a leading zero as an instruction to parse the rest as octal — so the same text can silently mean two different addresses depending on what reads it. A subnet mask has to be a contiguous run of one-bits followed by zero-bits; something like 255.255.0.255 is refused rather than converted into whatever prefix length looks closest.

When an address falls inside a reserved block, the calculator names it, drawing on the IANA special-purpose address registries: private-use ranges under RFC 1918, carrier-grade NAT space at 100.64.0.0/10 under RFC 6598, loopback, link-local addresses under RFC 3927, the documentation ranges set aside by RFC 5737 for IPv4 and RFC 3849 for IPv6, multicast, and IPv6 unique local addresses under RFC 4193.

The engine behind all of this was checked against Python's ipaddress module, the standard library's own implementation, used as an independent oracle: 23,758 assertions pass, covering 1,689 network cases across all 33 IPv4 prefix lengths and all 129 IPv6 prefix lengths — 325 of them with their entire host range enumerated and compared address by address — plus 4,000 IPv6 text-formatting cases and 1,800 parsing cases. The splitting feature is checked separately with a tiling assertion, confirming the resulting subnets are contiguous, do not overlap, and start and end exactly where the parent network does. Three deliberate sabotages of the engine were confirmed to break the test suite, so the passing result reflects real coverage rather than tests that could not fail.

Why is it free?

Every calculation here runs in your browser as you type — the address, the prefix, the split results, all of it. Nothing is uploaded, there is no account to create, no watermark on anything you copy out, and no usage cap, because there is no server-side cost to running this tool at any volume.