AnyTool
Your files never leave your device. All processing happens locally in your browser.

How do I use an online subnet calculator?

Pick IPv4 or IPv6, then type an address with its prefix — for example 192.168.1.10/24 for IPv4 (you can also use an IP plus a dotted mask like 192.168.1.10 255.255.255.0) or 2001:db8::1/64 for IPv6. AnyTool Subnet Calculator computes everything live: the network and broadcast addresses, the first and last usable host and the host range, the dotted subnet mask, the wildcard mask and CIDR, the total and usable host counts, the IP class (A–E) and the RFC type (private, loopback, CGNAT, documentation, multicast or public), plus a colour-coded binary view of the address and mask. A /31 is treated as a 2-address point-to-point link and a /32 as a single host, per RFC 3021. A subnetting planner splits the block into N equal subnets or sizes a subnet to fit N hosts each. Every value is one tap to copy, and the whole thing runs in your browser — it computes addressing only and never contacts any network.

  • IPv4 (CIDR or IP + mask) and IPv6 (with prefix), auto-detectable
  • Network, broadcast, usable host range, masks (dotted, wildcard, CIDR) and host counts
  • IP class plus RFC type (private, loopback, CGNAT, documentation, multicast, public)
  • /31 and /32 special-cased per RFC 3021; IPv6 totals via 128-bit BigInt
  • Subnetting planner + 100% in your browser, no network calls, works offline

What is

Subnet calculator

A subnet calculator derives the addressing details of an IP network from an address and a prefix length (or subnet mask). For IPv4 it returns the network address (host bits zeroed), the broadcast address (host bits set), the first and last usable host, the dotted subnet mask and its wildcard (inverse) mask, the CIDR notation, and the total and usable host counts — usable hosts being 2^(32−prefix) minus the network and broadcast addresses, with /31 and /32 special-cased. For IPv6 it computes the network prefix, the first and last address, the expanded and compressed forms and the exact 2^(128−prefix) address total. AnyTool implements one entirely in the browser, computing addressing math only — it never pings, scans or contacts any host.

Calculators

Related terms

CIDR notationSubnet maskBroadcast addressWildcard maskRFC 3021 (/31)

Frequently Asked Questions

It applies the mask: the network address is the IP with all host bits set to 0, and the broadcast address is the IP with all host bits set to 1.

The prefix length splits the 32 IPv4 bits into network bits and host bits. The subnet mask has a 1 in every network-bit position and a 0 in every host-bit position. ANDing the address with the mask zeroes the host bits to give the network (first) address; ORing it with the wildcard (the inverted mask) sets the host bits to give the broadcast (last) address. The usable host range sits between them — the first usable host is network + 1 and the last is broadcast − 1 — so usable hosts is 2^(32−prefix) − 2. AnyTool does exactly this and shows each field as a copyable value.

RFC 3021 lets a /31 use both of its addresses for a point-to-point link, and a /32 is a single host route, so the usual minus-two rule does not apply.

Normally a subnet reserves its first address as the network identifier and its last as the broadcast address, so usable hosts equals total addresses minus two. A /31 has only two addresses, which would leave zero usable hosts — so RFC 3021 defines the /31 as a point-to-point link where both addresses are assignable and there is no broadcast. A /32 describes a single host (one address), commonly used for host routes and loopbacks. AnyTool Subnet Calculator special-cases both so the host counts and ranges are correct.

Yes — enter an IPv6 address with a prefix like 2001:db8::1/64 and it returns the network, first and last address, compressed and expanded forms and the exact 2ⁿ address total using 128-bit BigInt.

IPv6 uses 128-bit addresses, far beyond a 64-bit number, so AnyTool computes them with BigInt for exactness. It parses :: expansion, shows both the RFC 5952 compressed form and the fully expanded eight-group form, derives the network prefix and the first and last address in the block, classifies the address (global unicast, link-local, unique local, multicast, documentation, loopback), and reports the total as a power of two (for example a /64 holds 2⁶⁴ addresses). IPv6 has no broadcast address.

It is fully private and computes addressing math only — it never pings, scans, resolves DNS or contacts any host, and nothing you type leaves your browser.

AnyTool Subnet Calculator runs entirely in JavaScript on a pure, unit-tested engine. The address and prefix you enter are turned into network and broadcast addresses, ranges, masks and counts using arithmetic alone; there is no server call, no account and no tracking, and the page works offline after first load. It does not probe, scan or reach any device — it only calculates what the addresses are.

Detailed Explanation

Methodology

How the Subnet Calculator Derives Each Field

For IPv4 the address and prefix are parsed to a 32-bit integer and a mask (a run of 1s for the network bits). ANDing the address with the mask zeroes the host bits to give the network address; ORing with the wildcard (inverted mask) sets them to give the broadcast address. The usable range is network + 1 to broadcast − 1, and usable hosts is 2^(32−prefix) − 2, with /31 and /32 special-cased per RFC 3021. The dotted mask, wildcard mask, CIDR, IP class and RFC type are derived from the same integers. IPv6 is computed with 128-bit BigInt, deriving the network prefix, first and last address, and the exact 2^(128−prefix) total.

  • IPv4 network = address AND mask; broadcast = address OR wildcard
  • Usable hosts = 2^(32−prefix) − 2, except /31 (2) and /32 (1)
  • Wildcard mask is the bitwise inverse of the subnet mask
  • IPv6 uses 128-bit BigInt for exact network, range and totals
  • RFC type covers private, loopback, CGNAT, documentation, multicast
How It Works

CIDR, /31 and /32, and IPv6 Compression

Classless routing (CIDR) replaced the old A/B/C classes, so the prefix length — not the leading octet — defines the network; the IP class here is shown for reference only. A /31 has just two addresses, so RFC 3021 makes both usable for point-to-point links with no broadcast, while a /32 is a single host route. IPv6 addresses are parsed with full :: expansion and re-emitted both expanded (eight padded groups) and compressed per RFC 5952 (longest zero-run collapsed to ::). The calculator also validates that an entered IPv4 mask is contiguous before accepting it.

  • CIDR prefix defines the network; A–E class is reference only
  • /31 is a 2-address point-to-point link (RFC 3021), no broadcast
  • /32 is a single host route (one address)
  • IPv6 :: is expanded exactly and recompressed per RFC 5952
  • Non-contiguous IPv4 masks are rejected with a clear message
Privacy & Security

Addressing Math Only — No Network Access

The calculator is pure arithmetic on the address and prefix you type. It never pings, scans, resolves DNS or contacts any host; there is no server call, account or tracking, and the page works offline after first load. The subnetting planner and every result are produced by a reusable, unit-testable engine running in the browser, so behaviour is consistent and verifiable, and nothing you enter is uploaded.

Subnet math: in-browser (AnyTool) vs typical online subnet calculators
CapabilityAnyToolTypical online calculators
Where it runs100% in your browserOften server-side
ProtocolsIPv4 and IPv6Frequently IPv4 only
IPv6 precisionExact 128-bit BigInt totalsOften approximate or omitted
/31 and /32Special-cased per RFC 3021Sometimes wrong (−2 anyway)
Input formsCIDR or IP + dotted maskOften CIDR only
Subnetting plannerSplit into N / fit N hostsRarely included
Binary viewNetwork/host bits colour-codedOften absent
Network accessNone — math only, never scansSome probe or log queries
Works offlineYes (PWA)No

AnyTool computes addressing locally with a unit-tested engine and contacts no network.