How the calculation works
An IPv4 address is 32 bits. The prefix length says how many of those bits, counted from the left, identify the network; the remaining bits number the hosts inside it. Set every host bit to 0 and you get the network address. Set them all to 1 and you get the broadcast address. Everything in between can be assigned to devices.
Why /31 and /32 are different
A /31 has no separate network or broadcast address: RFC 3021 allows both addresses to be used on point-to-point links. A /32 is a single address, used for loopback interfaces and host routes.
Mask, wildcard and prefix
A subnet mask is the prefix written as an address: /24 is 255.255.255.0. The wildcard mask is its inverse (0.0.0.255) and appears in Cisco ACLs and OSPF network statements. Every value from /0 to /32 is listed in the CIDR table.
Common questions
How many hosts are in a /24?
256 addresses, 254 of which can be assigned to devices: the first is the network address and the last is broadcast.
Which ranges are private?
RFC 1918 reserves 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16. Providers use 100.64.0.0/10 for carrier-grade NAT; it is not RFC 1918 space, but it is not routed on the internet either.
Is anything I type sent to a server?
No. All calculations run in your browser, and the page keeps working offline once loaded.