About SubnetLens
A subnet calculator with one input, one picture, and no ambition to become a network toolkit.
The idea
Most people meet CIDR as arithmetic: subtract, borrow bits, memorise that a /26 is 62 hosts. It is learnable, but it is not visible. SubnetLens draws the address space as a physical block. Lengthen the prefix by one bit and the block splits in half in front of you, with the half containing your address staying lit and the other dimming. After a few drags, “what does /24 to /26 actually do” stops being a question.
How the maths is done
Every address is a BigInt, IPv4 and IPv6 alike. JavaScript’s bitwise operators work on signed 32-bit integers, which is a well-known way to produce a subnet calculator that is wrong at the edges; and IPv6 needs 128 bits, far beyond what a double can hold exactly. Using BigInt throughout means a /0 is as accurate as a /30, and 2¹²⁸ is an exact number rather than a rounded one.
The awkward cases are handled deliberately rather than by formula. A /31 reports two usable addresses, per RFC 3021 point-to-point usage, instead of the nonsense the network-plus-broadcast rule would produce. A /32 reports a single address and no range. A /0 is drawn as a concept, not as four billion little boxes — no visual ever renders one element per address.
What it deliberately is not
There is no DNS lookup, no ping, no traceroute, no port scan, no WHOIS, no ASN data, no IP reputation and no public-IP detection. Those are different tools with different privacy consequences. SubnetLens visualises a subnet, and the moment it needs a network request to do that, it has stopped being what it is.
Accessibility
The block has a text equivalent read by screen readers, the prefix is adjustable from the keyboard, and every colour role is also carried by a label and a position. With reduce motion enabled, splits become instant and the tilt is switched off — no feature is lost with the animation.
Where to start
Subnet calculator for the four IPv4 answers, CIDR calculator to watch prefixes split, or IPv6 subnets for 128-bit prefixes. All three are the same engine.
SubnetLens is a techvora tool. Read the privacy note.