# Subnet Calculator

Canonical URL: https://offlineutils.com/subnet-calculator
Category: Developer
Published: 2026-08-05
Publisher: offlineutils.com
Runs entirely in the browser; nothing entered into the tool is uploaded.

> A Subnet Calculator works out the network address, broadcast address, usable host range, mask and address count for an IPv4 or IPv6 CIDR block, and divides or aggregates blocks — computed with exact bitwise arithmetic in your browser.

Type a block in whatever notation you have — 192.168.1.130/26, 10.0.0.0 255.0.0.0, a Cisco wildcard mask, a bare address, or any IPv6 form — and every derived value appears at once: network and broadcast address, first and last usable host, subnet and wildcard mask, the count in decimal and as a power of two, binary, hexadecimal, the reverse DNS zone, and which IANA special-purpose range the block sits in. Beyond the lookup there are three operations that turn a reference tool into a working one: split a prefix into equal subnets, plan a VLSM allocation from a list of host counts, and summarise a messy list of blocks and ranges into the fewest CIDRs that cover exactly the same addresses. All of it runs on BigInt, so an IPv6 /48 reports 2^80 addresses exactly rather than a rounded float, and the /31 and /32 cases are handled per RFC 3021 instead of being reported as having minus one usable host.

## Features

- IPv4 and IPv6 in one field, with the version detected from the input
- Accepts prefix length, dotted netmask, Cisco wildcard mask or a bare address
- Network, broadcast, first and last usable host, and exact address counts
- /31 and /32 handled per RFC 3021 instead of reporting negative host counts
- Split a block into equal subnets, listed with their ranges
- VLSM planner: allocates largest-first from host counts and reports the waste
- Summarise adjacent and overlapping blocks into the fewest CIDRs
- Identifies private, CGNAT, link-local, documentation and multicast ranges with their RFCs
- Binary, hexadecimal, integer, expanded IPv6 and the reverse DNS zone

## Use cases

- Working out how many hosts a /26 actually gives you before assigning it
- Carving a /16 into per-environment subnets that do not overlap
- Planning a VLSM allocation for departments of different sizes
- Collapsing a sprawling firewall or ACL list into a handful of aggregated routes
- Converting an IP range from a log or abuse report into CIDR notation
- Checking whether an address is private, CGNAT or genuinely public

## How to use it

1. **Enter the block** — Type an address with a prefix (192.168.1.130/26), a netmask (10.0.0.0 255.0.0.0), a wildcard mask, or a bare address. IPv6 works in the same field.
2. **Read the analysis** — Network, broadcast, usable range, masks, counts, scope and reverse DNS zone are listed together, each with a copy button.
3. **Split or plan** — Use 'Split evenly' to divide the block into equal subnets, or 'VLSM plan' to allocate from a list of host counts.
4. **Summarise a list** — Paste CIDRs, addresses or dashed ranges into 'Summarise' to collapse them into the fewest equivalent CIDR blocks.

## When to use it, and when to use something else

- **vs `ipcalc` or `sipcalc` on the command line** — use Subnet Calculator when you want the split, VLSM and summarise operations in one place, and IPv6 handled as a first-class case rather than a flag. Use `ipcalc` or `sipcalc` on the command line when you are scripting and want the output piped somewhere.
- **vs Online subnet calculators** — use Subnet Calculator when you are working with internal addressing you would rather not paste into an ad-funded page, or you need IPv6 counts that are exact rather than rounded to a float. Use Online subnet calculators when you only need a single IPv4 lookup and already have one bookmarked.
- **vs Asking an AI chatbot** — use Subnet Calculator when the answer has to be right — subnet boundaries are pure bit arithmetic, and a language model producing a confident off-by-one broadcast address is a live outage. Use Asking an AI chatbot when you want the concept of subnetting explained rather than a block calculated.

## Frequently asked questions

### Why does a /24 have 254 usable hosts instead of 256?

Two addresses in every ordinary IPv4 subnet are not assignable: the first is the network address that identifies the subnet itself, and the last is the broadcast address. A /24 spans 256 addresses, so 254 are left for hosts. The same subtraction applies at every size, which is why a /30 — four addresses — yields only two usable hosts and is the classic point-to-point allocation.

### Can I use a /31 or a /32?

Yes, and they are the two cases where the minus-two rule stops applying. RFC 3021 allows a /31 on a point-to-point link, where there is no broadcast address and both addresses are usable — which is why this tool reports 2 rather than 0. A /32 is a single host route, common for loopback interfaces and firewall rules. Calculators that apply the subtraction blindly report 0 or -1 usable hosts for these, which is simply wrong.

### What is the difference between /24 and 255.255.255.0?

Nothing — they are two notations for the same mask. The prefix length counts the leading one-bits; the dotted form spells those bits out as four octets. 255.255.255.0 is twenty-four one-bits followed by eight zeros, so it is a /24. A netmask's one-bits must be contiguous from the left, which is why 255.255.0.255 cannot exist and is rejected here.

### Why does the VLSM planner allocate the largest subnet first?

Because every subnet has to start on a boundary that is a multiple of its own size, so placing a small subnet first can strand the aligned boundaries a larger one needs. Descending order packs the block with no gaps and no wasted alignment — a naive in-order pass can report 'does not fit' on a block that comfortably does.

### Why is 0177.0.0.1 rejected as invalid?

Because it is ambiguous, and the ambiguity is a security problem rather than a formatting quibble. C's inet_aton reads a leading zero as octal, making 0177.0.0.1 equal to 127.0.0.1, while Go and modern browsers reject the notation outright. Code that validates an address with one parser and connects with another is the mechanism behind a family of SSRF filter bypasses, so this tool refuses the input and says why instead of picking an interpretation.

### How many hosts are in an IPv6 /64, and is there a broadcast address?

A /64 holds 2^64 addresses — about 18.4 quintillion — and IPv6 has no broadcast address, so nothing is subtracted for one. The all-zeros interface identifier is reserved as the subnet-router anycast address. A /64 is the standard size for a single link because SLAAC address autoconfiguration assumes 64 host bits.

### Is anything uploaded?

No. Every value is bitwise arithmetic on BigInts in your browser, with no request made. Internal addressing plans are exactly the kind of thing worth not pasting into someone else's server.

## Related tools

- https://offlineutils.com/number-base-converter
- https://offlineutils.com/url-parser
- https://offlineutils.com/timestamp-converter
