Toolsky

Free Online Tools & Utilities for Every Task.

IP Subnet Calculator

IPv4 and IPv6 Subnet Calculator

Subnetting is one of those networking tasks that is simple in principle and fiddly in practice. Splitting a network into smaller ranges means working in binary, borrowing bits, and keeping track of which addresses are reserved — and one arithmetic slip produces a network address or broadcast address that quietly breaks a configuration. This IP subnet calculator does the binary work for you: give it an IPv4 or IPv6 address and a prefix length (or subnet mask), and it returns the full breakdown of the subnet — network address, broadcast, usable host range, and how many hosts the subnet can hold.

The Ideas Behind the Calculation

An IP address is split into two parts: the network portion, which identifies the subnet, and the host portion, which identifies a device inside it. CIDR notation writes this split as a slash followed by a number — 192.168.1.0/24 means the first 24 bits name the network and the remaining 8 bits are available for hosts. The subnet mask expresses the same split in dotted form: /24 is 255.255.255.0, /26 is 255.255.255.192.

Two addresses in every IPv4 subnet are reserved: the first (all host bits zero) names the network itself, and the last (all host bits one) is the broadcast address. That is why a subnet with 2n total addresses supports 2n − 2 usable hosts. IPv6 follows the same prefix logic at a much larger scale, though it drops the broadcast concept.

What the Calculator Reports

  • Network and broadcast addresses: the first and last addresses of the subnet, calculated from the prefix so you never have to align binary by hand.
  • Usable host range: the first and last addresses you can actually assign to devices in IPv4 subnets.
  • Host counts: total addresses in the subnet and the usable host count, so you can check a design has room for every device plus growth.
  • Mask conversions: move between CIDR prefix, dotted subnet mask and wildcard mask (the inverted form used in router access lists) without manual bit-flipping.
  • IPv4 and IPv6 support: the same workflow covers a small office LAN and a vast IPv6 allocation.

How to Use the IP Subnet Calculator

  1. Enter any IP address within the subnet you are planning or documenting — the network address itself is the cleanest choice.
  2. Provide the prefix length (for example /26) or select the equivalent subnet mask.
  3. Run the calculation to generate the subnet breakdown.
  4. Read off the network address, broadcast address, first and last usable hosts, and the host counts.
  5. Check the usable range against your plan: routers, servers and DHCP pools must all fit inside it, and the gateway conventionally takes the first usable address.
  6. To split the network further, repeat the process inside one of the resulting ranges with a longer prefix.

Worked Example: Slicing a /26

Take the address block 192.168.10.0/26. A /26 prefix leaves 6 host bits, so the subnet contains 26 = 64 addresses in total. The subnet mask is 255.255.255.192. The network address is 192.168.10.0, the broadcast address is 192.168.10.63, and the usable host range runs from 192.168.10.1 to 192.168.10.62 — 62 assignable addresses. If this block was carved from a /24, its three sibling /26 subnets begin at .64, .128 and .192, which is the pattern you would verify if you were dividing an office network into departments. Once your ranges are planned, testing that a device actually answers inside its subnet is a job for a quick online ping test, and checking the names that resolve within the range can be done with a DNS lookup.

Tips, Limitations and Common Mistakes

  • Hosts = total − 2 (IPv4 only). Forgetting to subtract the network and broadcast addresses is the most common planning error. Note that /31 links and /32 host routes are deliberate exceptions used by network engineers.
  • The address you enter must sit inside the subnet. Entering 192.168.10.77/26 describes the .64 subnet, not the .0 subnet — the calculator snaps to the network the address actually belongs to, which surprises people who expected it to keep their starting number.
  • Bigger is not always better. A /24 for a 10-device office wastes little in private space but creates a large broadcast domain; right-sizing subnets keeps traffic and troubleshooting contained.
  • Document the gateway convention. Teams usually place the gateway at the first or last usable address. Either works — inconsistency between documents is what causes outages.
  • IPv6 changes the scale, not the logic. A /64 is the standard IPv6 subnet size and holds an astronomical number of addresses; host-count subtraction games from IPv4 do not apply there. To identify who operates a range you have calculated, an IP information lookup shows the allocation behind it.

Frequently Asked Questions

What is CIDR notation?

CIDR notation writes an address with a slash and a number, such as 192.168.1.0/24. The number counts the bits used for the network portion; the remaining bits are for hosts within that network.

How many hosts fit in a /24 subnet?

A /24 has 256 total addresses. After reserving the network and broadcast addresses, 254 are usable for devices in a conventional IPv4 setup.

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

A subnet mask marks network bits with 1s (255.255.255.192 for /26). A wildcard mask is its inverse (0.0.0.63) and is used in contexts such as router access-control lists and OSPF statements.

Why can I not use the first and last addresses?

In IPv4, the all-zeros host portion identifies the network itself and the all-ones host portion is the broadcast address that targets every host on the subnet. Assigning either to a device causes conflicts.

Can this calculator handle IPv6 subnets?

Yes. Enter an IPv6 address and prefix to see the network range it defines. IPv6 has no broadcast address, and subnets are normally /64, so the output focuses on the range rather than usable-host subtraction.

How do I split one network into several smaller subnets?

Lengthen the prefix. Moving from /24 to /26 creates four equal subnets; each extra bit doubles the number of subnets while halving the hosts in each. Run the calculator once per resulting block to document them.

What prefix should I choose for a small office?

Count the devices, add expected growth, then pick the smallest standard block that fits: /26 (62 hosts) or /25 (126 hosts) suits many small offices, while /24 (254 hosts) remains the common default.

Plan the Range Before You Configure It

Most subnetting pain comes from configuring first and calculating later. A ten-second check here — network, broadcast, usable range, host count — confirms the block you are about to type into a router or DHCP server is the block you actually meant, and gives you the documented ranges your future troubleshooting self will thank you for.