FREE · NO ACCOUNT REQUIRED

Free subnet & CIDR calculator — compute network address, broadcast, range, mask, and usable hosts for any IPv4 or IPv6 block.

Subnet Calculator parses any subnet notation (`192.168.1.0/24`, `10.0.0.0 255.255.0.0`, `2001:db8::/64`) and returns every derived value — network address, broadcast address, subnet mask in dotted-decimal and binary, total addresses, usable host addresses, wildcard mask, and the host-IP range. Supports IPv4 with CIDR /0 to /32, IPv6 from /0 to /128, classless subnetting, VLSM planning, and reverse calculations (find the smallest block containing two IPs).

01 · OVERVIEW

What gets calculated

Six independent classes of output per subnet input. The network and broadcast addresses are the obvious headlines; the binary mask visualization, the host-range enumeration, and the VLSM tooling are what make this useful beyond a one-shot calculator.

Network and broadcast addresses (First and last)

The network address (first IP, all-host-bits-zero) and the broadcast address (last IP, all-host-bits-one). Together they bound the subnet. Network address is what routers advertise; broadcast is how a host reaches every other host on the subnet.

Subnet mask formats (CIDR · dotted · binary)

Same mask shown three ways. CIDR (`/24`), dotted-decimal (`255.255.255.0`), and binary (`11111111.11111111.11111111.00000000`). The binary form makes subnet structure visible at a glance — where the network portion ends and the host portion begins.

Host count and usable range (Total · usable)

Total addresses (2^host-bits) and usable host addresses (total minus 2, for network + broadcast — except /31 and /32 in special-case configs). For `/24` that's 256 total, 254 usable. The first and last usable host IPs are shown explicitly.

Wildcard mask (ACL syntax)

Inverted subnet mask used in Cisco ACLs and similar configs. `/24` mask `255.255.255.0` → wildcard `0.0.0.255`. Wildcard syntax wraps the same information differently for ACL matching expressions.

IPv6 prefix breakdown (/0 to /128)

Full IPv6 support. Network prefix, host portion, total address count (often astronomically large), and the EUI-64 / link-local derivations where applicable. `/64` is the typical end-host prefix; `/48` is the typical site allocation.

VLSM and supernetting (Split or merge blocks)

Split a block into smaller subnets (VLSM — Variable Length Subnet Masking) or find the smallest enclosing block for two IPs (supernetting). Useful for IP-address-plan design.

02 · WHY THIS MATTERS

Why subnetting still trips up senior engineers

Subnetting is mechanical arithmetic, but the binary requires concentration and the off-by-one errors bite hard. Five reasons a calculator beats doing it by hand:

  • Off-by-one is the default failure mode A /24 is 256 addresses, 254 usable. A /25 is 128 addresses, 126 usable. Manual subnetting routinely mis-counts the network and broadcast addresses — leaving production hosts with overlapping ranges or undersized DHCP pools. A calculator removes the arithmetic from the design step.
  • VLSM is harder than it looks Splitting a /23 into one /24 + two /25 requires careful boundary alignment. The first /25 must start at offset 0 of the second /24; the second /25 starts at offset 128. Off-by-one here causes overlapping subnets in the routing table — a real outage.
  • Cloud subnets reserve more than two addresses AWS reserves 5 IPs per subnet (network + 3 internal + broadcast). Azure reserves 5. GCP reserves 4. Your /24 in AWS has 251 usable IPs, not 254. A calculator that knows the cloud's reservation rules saves a surprise during instance provisioning.
  • IPv6 subnetting is different from IPv4 by convention IPv6 standard practice is /64 per end-network — much sparser than IPv4. The host portion is 64 bits, allowing SLAAC. Subnetting smaller than /64 breaks SLAAC. Knowing IPv6 conventions when designing is different from IPv4 'pack tightly' thinking.
  • Subnet-overlap detection is the wrong thing to discover at deploy time Two teams independently choose `10.5.0.0/16` for their VPCs. Both work in isolation; merge them and routing breaks. Calculator + IP-address-plan documentation prevents the conflict; runtime discovery is painful.
03 · HOW IT WORKS

Parse input, derive every field, validate

A subnet calculation is mechanical bitwise arithmetic. We accept multiple input formats, normalize to canonical CIDR, then compute every field via the standard masking operations.

  • Stage 1 — Parse input formats Accept CIDR (`192.168.1.0/24`), dotted-decimal IP plus mask (`192.168.1.0 255.255.255.0`), IP plus prefix length implied (`192.168.1.0/24`), or two IPs (find smallest enclosing block). Normalize to canonical IP/prefix.
  • Stage 2 — Compute network address Bitwise AND of the IP with the mask. Yields the first address in the subnet — all host bits zero. This is what gets advertised in routing tables.
  • Stage 3 — Compute broadcast address Bitwise OR of the network address with the inverted mask (wildcard). Yields the last address — all host bits one. Reserved for IPv4 broadcast; doesn't exist as a concept in IPv6.
  • Stage 4 — Enumerate usable range First usable = network + 1. Last usable = broadcast - 1. Total addresses = 2^(32 - prefix). Usable hosts = total - 2 (except /31 and /32, which have special-case rules per RFC 3021).
  • Stage 5 — Derive mask formats Convert CIDR prefix to dotted-decimal (`/24` → `255.255.255.0`) and to binary representation. Compute wildcard mask as inverted dotted-decimal. Surface all three formats — different tools and configs use different forms.
  • Stage 6 — Optional VLSM split If user requested splitting (e.g. 'split /23 into 8 /26s'), compute the boundary addresses for each child subnet. Verify alignment, return the table of child subnets.
04 · IPv4 PRIVATE RANGES

RFC 1918 and other special-purpose blocks

Knowing which ranges are private, link-local, or reserved is half the battle in network design. The reserved blocks per RFC 1918 and related RFCs:

  • 10.0.0.0/8 — RFC 1918 Class A private 16,777,216 addresses. The most generous private block. Common choice for large enterprise networks, cloud VPCs that need to scale, and any environment where you want subnetting room to grow. Cloud convention: `10.0.0.0/16` per VPC, `/24` per subnet.
  • 172.16.0.0/12 — RFC 1918 Class B private 1,048,576 addresses spanning `172.16.0.0` to `172.31.255.255`. The least-used of the three private ranges — many engineers don't realize how large it is. Useful when avoiding 10.x conflicts with other organizations during VPN setups.
  • 192.168.0.0/16 — RFC 1918 Class C private 65,536 addresses. The classic home-router default range. Used pervasively for small LANs. The narrowest of the three private ranges — runs out of space if you scale beyond a few thousand devices.
  • 169.254.0.0/16 — Link-local Used for automatic IP allocation when no DHCP is available. APIPA on Windows, similar on Mac/Linux. Also used by AWS for the instance metadata service (`169.254.169.254`). Don't manually assign from this range.
  • 100.64.0.0/10 — Shared CGNAT Carrier-grade NAT space (RFC 6598). Used by ISPs for the customer side of CGNAT and by cloud providers (notably AWS) for managed-service overlays. Don't use in your own private network — it'll conflict with what your ISP uses.
  • 127.0.0.0/8 — Loopback 16,777,216 addresses, but in practice only `127.0.0.1` is used. The whole /8 is loopback per RFC 1122. Technically you can bind any IP in this range and it'll loop back.
  • 224.0.0.0/4 — Multicast Reserved for multicast (RFC 5771). Used by mDNS (`224.0.0.251`), OSPF, IGMP, and other group communication protocols. Never assign as a host address.
  • 0.0.0.0/8 and 255.255.255.255 — Special `0.0.0.0` means 'any local address' when binding, 'default route' in routing tables. `255.255.255.255` is the limited broadcast — packets sent here don't leave the local subnet. Both are protocol-special and shouldn't be assigned as host addresses.
05 · CIDR REFERENCE TABLE

Common prefixes and their address counts

Quick reference for IPv4 prefix sizes. Memorize the common ones (/24, /22, /20, /16) and a calculator handles the rest:

  • /32 — 1 address (single host) Used for static host routes and host-specific firewall rules. `1.1.1.1/32` is exactly the one address.
  • /31 — 2 addresses (point-to-point) Per RFC 3021, /31 is used for point-to-point links with no network or broadcast — both addresses are usable. Saves IPs on router-to-router links.
  • /30 — 4 addresses, 2 usable (point-to-point, legacy) The pre-RFC-3021 standard for point-to-point links. Two usable IPs; the network and broadcast addresses are not used. Still common.
  • /29 — 8 addresses, 6 usable Small subnets for redundant gateways, small DMZs, or tiny embedded networks.
  • /28 — 16 addresses, 14 usable Smallest subnet you typically see in production cloud environments. AWS reserves 5, leaving 11 usable in a /28.
  • /27 — 32 addresses, 30 usable Small VLAN. Useful for management networks or small DMZs.
  • /24 — 256 addresses, 254 usable The classic 'class C'. Standard LAN size, default for home routers, common cloud-VPC subnet.
  • /22 — 1024 addresses, 1022 usable Medium-sized network. Common for offices or campus WLAN deployments.
  • /20 — 4096 addresses, 4094 usable Large network. Cloud VPCs sometimes use /20 for the whole VPC and /24 per subnet.
  • /16 — 65,536 addresses, 65,534 usable Very large network. Maximum size for a single cloud VPC at AWS. The classic 'class B'. Plenty of room to subnet down.
  • /8 — 16,777,216 addresses Massive network. Only the RFC 1918 `10.0.0.0/8` is allocated as private. Used for enterprise-scale designs that need millions of addresses.
06 · API

Use this programmatically

Every derived field is available as JSON. Useful for IP-address-management (IPAM) tooling, network-design automation, and verifying subnet plans in CI before deploy.

cURL
curl 'https://api.domainscan.in/v1/ip/subnet?cidr=192.168.1.0/24'
JavaScript (fetch)
const res = await fetch(
  'https://api.domainscan.in/v1/ip/subnet?cidr=10.0.0.0/22'
);
const sn = await res.json();

console.log(sn.network);            // '10.0.0.0'
console.log(sn.broadcast);          // '10.0.3.255'
console.log(sn.mask);               // '255.255.252.0'
console.log(sn.maskBinary);         // '11111111.11111111.11111100.00000000'
console.log(sn.totalAddresses);     // 1024
console.log(sn.usableHosts);        // 1022
console.log(sn.firstUsable);        // '10.0.0.1'
console.log(sn.lastUsable);         // '10.0.3.254'
console.log(sn.wildcardMask);       // '0.0.3.255'

// Overlap check
function overlap(a, b) {
  return a.networkInt <= b.broadcastInt && b.networkInt <= a.broadcastInt;
}
Response schema (abridged)
{
  "input":         "192.168.1.0/24",
  "network":       "192.168.1.0",
  "broadcast":     "192.168.1.255",
  "firstUsable":   "192.168.1.1",
  "lastUsable":    "192.168.1.254",
  "prefix":        24,
  "mask":          "255.255.255.0",
  "maskBinary":    "11111111.11111111.11111111.00000000",
  "wildcardMask":  "0.0.0.255",
  "totalAddresses": 256,
  "usableHosts":   254,
  "ipVersion":     4,
  "isPrivate":     true,
  "category":      "RFC 1918",

  "networkInt":    3232235776,
  "broadcastInt":  3232236031
}
07 · QUESTIONS

Common questions

  • What is CIDR notation? Classless Inter-Domain Routing notation expresses an IP block as an IP address plus a prefix length: `192.168.1.0/24` means 'the network starting at 192.168.1.0 with 24 bits of network prefix'. The remaining bits (32 - 24 = 8) are the host portion, giving 256 addresses. CIDR replaced the older 'class A/B/C' fixed-boundary scheme.
  • What is a subnet mask? A 32-bit value (for IPv4) that indicates which bits of an IP address represent the network portion and which represent the host portion. `255.255.255.0` (or `/24` in CIDR) marks the first 24 bits as network. Bitwise AND of an IP with the mask yields the network address.
  • How many hosts does a /24 subnet support? A /24 has 256 total addresses, 254 usable. The first (network address) and last (broadcast address) aren't assignable to hosts. So a /24 = 254 usable host IPs. AWS, Azure, and GCP reserve additional IPs per subnet for their internal services, leaving fewer usable in cloud subnets — typically 251 or 252.
  • What's the difference between /24 and /25? /24 = 256 addresses (254 usable). /25 = 128 addresses (126 usable). Going from /24 to /25 splits one /24 into two /25s — useful when you need two separate subnets but only have one /24 worth of address space. The two /25s are: first half (`.0/25`, addresses 0–127) and second half (`.128/25`, addresses 128–255).
  • What is the difference between IPv4 and IPv6 subnetting? Mechanically the same — bitwise AND with a longer mask. Conventionally very different. IPv4 packs subnets tightly (often /24 per LAN, /30 per point-to-point). IPv6 standard practice is /64 per LAN regardless of host count, because SLAAC and many security mechanisms expect 64-bit host portion. Subnetting smaller than /64 in IPv6 breaks SLAAC.
  • What are RFC 1918 addresses? Three private IPv4 ranges defined by RFC 1918: `10.0.0.0/8`, `172.16.0.0/12`, and `192.168.0.0/16`. Designed for use inside an organization, not routable on the public internet. NAT translates these to public IPs at the edge. Most home and enterprise networks use RFC 1918 internally.
  • What is VLSM? Variable Length Subnet Masking. The technique of carving a larger block into multiple smaller subnets of different sizes. Example: a /22 can be split into one /24 (256 addresses) plus four /26s (64 each) plus two /27s (32 each), totaling exactly the /22's 1024 addresses. VLSM lets you size subnets to actual host counts instead of wasting addresses on uniform sizing.
  • What is a /31 used for? Per RFC 3021, /31 is used for point-to-point links between two routers. Both addresses are usable as hosts — no network or broadcast reservation. Saves IP space compared to /30 (which has 4 addresses, 2 usable). Common on internet-backbone links where every IP matters.
  • How do I tell if two subnets overlap? Subnets overlap if and only if one's network address is within the other's range, or vice versa. Equivalently, two CIDR blocks `A/m` and `B/n` overlap if the smaller one's prefix bits match within the larger one's mask. The API returns network and broadcast as integers; comparing those ranges makes overlap detection a simple two-comparison check.