~/ ipcalc
Subnet & Netmask Calculator
Enter any IPv4 address with a CIDR prefix or a dotted-decimal netmask, or compute an IPv6 prefix below. All math runs in your browser — no data is sent to a server.
// results
Network address
—
The base address of the subnet, used to identify the network itself. Cannot be assigned to a host.
Broadcast address
—
Sends to every host on the subnet. Reserved — cannot be assigned. Not used in /31 (RFC 3021) or /32.
First usable host
—
Lowest address you can assign to a device on the subnet.
Last usable host
—
Highest assignable address.
Usable hosts
—
Total addresses minus network + broadcast. /31 has 2 usable, /32 has 1.
Total addresses
—
2^(32−prefix). Counts every address in the block, usable or not.
Netmask
—
Dotted-decimal form. Marks which bits identify the network vs the host.
Wildcard mask
—
Inverted netmask (~mask). Used in Cisco ACLs and OSPF.
IP class
—
Historic classful range (A/B/C/D/E). Classless routing (CIDR) supersedes it, but the label is still common in docs.
IP type
—
Private (RFC 1918), public, loopback, link-local, CGNAT (RFC 6598), multicast or reserved.
Binary
— Each octet rendered in base 2. Useful to visualize which bits are masked by the prefix.
Programmatic access
Same calculation via JSON API:
/api/subnet?ip=192.168.1.0&cidr=24
~/ ipv6
IPv6 Prefix Calculator
Enter an IPv6 address and a prefix length (0–128). Handles :: compression
and embedded IPv4. 128-bit math, all in your browser.
Network / prefix address
—
First address of the block (all host bits zero).
Last address
—
Highest address in the prefix. IPv6 has no broadcast.
Total addresses
—
2^(128−prefix). IPv6 blocks are vast — counts are shown as powers of two.
/64 subnets
—
How many /64 networks fit in this prefix. A /64 is the standard single LAN.
Address type
—
Global unicast, unique local (fc00::/7), link-local (fe80::/10), multicast, loopback, etc.
Compressed form
—
Canonical RFC 5952 notation of the address you entered.
Expanded address
— Full, uncompressed 8-group form — useful when a tool rejects ::.
Programmatic access
Same calculation via JSON API:
/api/subnet6?ip=2001:db8::1&prefix=64
What this subnet calculator does
A subnet calculator takes an IPv4 address and either a CIDR prefix length
(like /24) or a dotted-decimal netmask (like 255.255.255.0) and
returns every derived property of that block: the network address, the broadcast address,
the first and last assignable host, the total number of addresses and the wildcard mask.
It is the daily-driver tool for anyone working on IP planning, ACLs, firewall rules,
BGP advertisements or static routing.
CIDR notation (Classless Inter-Domain Routing, RFC 4632) replaced the
old classful A/B/C system in 1993. Instead of fixed octet boundaries, CIDR allows any
prefix length from /0 to /32, so subnets can be sized to fit
the number of hosts you actually need. The prefix counts the leading 1 bits in
the netmask: a /24 means the first 24 bits are the network identifier and
the remaining 8 bits address individual hosts, giving 256 total addresses and 254 usable.
Two prefixes break the usual "subtract 2 for network and broadcast" rule. A /31
(RFC 3021) is meant for point-to-point links and has two usable addresses with no broadcast.
A /32 represents a single host route, common in loopback interfaces and BGP
next-hops. This netmask calculator handles both correctly.
All computations are performed locally in your browser using bitwise operations on 32-bit integers — no inputs ever leave your device. If you need machine-readable output for scripts or LLM agents, the same logic is exposed at /api/subnet (JSON) and /api/subnet.md (Markdown).