Subnet Calculator: The Niche One I Built for Myself Too
Bit manipulation behind a friendly interface, and why usable hosts is never the same number as total addresses.
This is the most niche tool I've built for the site so far, and I built it anyway because subnetting math is exactly the kind of thing that's genuinely useful, genuinely tedious to do by hand, and genuinely well-suited to a small dedicated tool instead of a spreadsheet formula someone re-derives from scratch every time they need it. Take an IPv4 address and a CIDR prefix, and work out the network address, broadcast address, netmask, and host counts that follow from it.
Everything here is bit manipulation wearing a friendly interface
Under the readable dotted-decimal numbers, every calculation here is actually binary arithmetic — converting an IP address into its 32-bit representation, applying a mask built from the CIDR prefix, and converting the results back into the dotted-decimal form people actually read. The netmask itself is just a run of 1 bits equal to the prefix length followed by 0 bits, and the network address is the IP address with the host portion zeroed out by that mask. None of the individual operations are complicated in isolation. What takes care is making sure the conversions between binary and dotted-decimal representation never introduce an off-by-one, since a subtly wrong result here isn't a cosmetic bug — it's a wrong answer to a question someone's about to configure real network hardware based on.
Validating an IP address means rejecting more than you'd expect
An IPv4 address field looks like it just needs to check for four numbers separated by dots, and a proper validator has to catch more than that: each octet capped at 255, no leading zeros that could be ambiguously read as octal in some contexts, no extra or missing dots, and no stray whitespace copied in from wherever the address came from. Getting validation wrong in the lenient direction means accepting garbage input and producing a confidently wrong answer from it, which is worse than rejecting it outright. Getting it wrong in the strict direction means annoying someone with a legitimate address the validator incorrectly flagged. I erred toward strict, since a calculator that occasionally refuses a slightly malformed input is more trustworthy than one that occasionally computes a subnet from nonsense.
Usable hosts is not the same number as total addresses
A subnet's total address count and its usable host count are two different numbers people frequently conflate, and getting this distinction right was one of the more important details in the whole tool. The network address and the broadcast address both sit inside the subnet's address range but neither can be assigned to an actual host — they're reserved for identifying the subnet itself and for broadcasting to every host on it. So usable hosts is always the total address count minus two, for any subnet large enough to have that distinction apply. Showing both numbers side by side, rather than just one, was important specifically because someone sizing a network for a known number of devices needs the usable number, not the raw total, to avoid running short by exactly two addresses.
The live slider makes an abstract trade-off tangible
Dragging the CIDR prefix slider and watching every downstream value recalculate instantly does something a static reference table or a one-shot calculation can't: it makes the actual trade-off between subnet size and host capacity feel immediate and explorable rather than abstract. Moving the prefix by one step and watching the usable host count jump or collapse teaches that relationship faster than reading a table of prefix-to-host-count values ever would, especially for someone who's still building an intuition for how CIDR notation actually maps to real address space rather than having already memorized the standard prefix values.
Showing the binary alongside the dotted-decimal was non-negotiable
The netmask displays in both dotted-decimal and raw binary form, side by side, and cutting the binary view to keep the results panel cleaner was something I considered and rejected. Dotted-decimal is what you'd type into a router's configuration screen, but binary is what actually explains why a given CIDR prefix produces that specific mask — seeing 11111111.11111111.11111000.00000000 makes it visually obvious where the network bits end and the host bits begin in a way that 255.255.248.0 alone doesn't communicate at all. For a tool partly aimed at people still building an intuition for subnetting, hiding the representation that actually explains the "why" in favor of only the one you'd copy into a config file would have made the tool less useful as a learning aid, even though it's marginally less useful as a pure lookup.
Where this tool stops on purpose
This only handles IPv4. IPv6 subnetting follows fundamentally different conventions and typically involves far larger, less human-scale numbers — the whole mental model shifts enough that bolting it onto an IPv4 tool as an afterthought would do a disservice to both. If IPv6 support is worth building, it deserves to be its own dedicated tool designed around how people actually think about IPv6 addressing, not a checkbox added to this one that quietly changes what every field on the page means. For now, this does one address family correctly and completely, which felt like a better use of the time than doing two families each slightly worse.
This is also probably the tool with the smallest realistic audience on the entire site, and I want to be honest that I built it partly because I personally wanted it to exist, not purely from projected traffic. Not everything needs the widest possible audience to be worth building well. A small, genuinely useful tool for a specific, technical crowd is still a legitimate thing to spend real care on, even if it never becomes one of the more-visited pages on the site. Usefulness to the right person at the right moment counts for something too, even when that person is a small slice of everyone who visits the site in a given month, and even when most visitors to the rest of the site will never open this particular page at all.