Subnet calculator (CIDR)
Type an address with its prefix, like 192.168.1.0/24, and out come network, broadcast, first and last host, host count, mask and wildcard. It also works for IPv6, and there is the reverse («I need 300 hosts: which prefix?») and splitting into subnets. Nothing leaves your browser.
How many hosts do I need?
Split this network into subnets
What it is for, and who looks for it
Anyone setting up a router, a firewall, a NAS or a virtual machine needs to know how many addresses fit in a network, what the broadcast is and where the hosts run from and to. It is also on the exam in technical schools, where subnets are worked out by hand on paper: here the sum is already done, and it serves to check your own.
The two edges where everyone slips: /31 and /32
The rule «usable hosts = total minus 2» (network and broadcast removed) is right almost always, but not on the longest prefixes. A /31 has only two addresses and no room for network and broadcast: RFC 3021 says both are hosts, and that is how point-to-point links between routers are made. A /32 is a single host. Copying the «minus 2» formula everywhere is wrong here, and in an exam it is a costly mistake.
IPv4 and IPv6 are not the same thing
IPv6 has no broadcast and no notion of «usable hosts» like IPv4: a /64 has billions of billions of addresses and you do not remove the two edges. Here IPv6 is computed with full 128-bit integers (never floating point, which loses digits at that size), and the network address is shown in the official compact form (RFC 5952), the one with the double colon in place of the zeros.
The reverse direction and splitting
The real question of anyone designing a network is not «what does this /24 hold», it is «I need 300 hosts, which prefix do I put?». Here it is: give the host count and get the smallest prefix that fits them (accounting for the two addresses that in IPv4 are not hosts). And the opposite too: take a network and split it into equal subnets of a longer prefix, with the list of networks that come out.
What it does not do
It does not check whether an address is reachable and does not ping: it is a calculation, not a test on the network. It says whether an address is private or public by the reserved ranges (10.x, 172.16-31.x, 192.168.x for IPv4), but «private» does not mean «not routable». If instead you need to read or make a QR with network settings there is WiFi QR code, and to convert numbers between bases Base converter.