~/ ipcalc
Subnet & Netmask Calculator
Enter any IPv4 address with a CIDR prefix or a dotted-decimal netmask. 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
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).