01What is subnetting for?
Subnetting means splitting an IP address range into smaller networks. The netmask (or CIDR prefix) divides every address into two parts: the network bits, shared by all machines in the subnet, and the host bits, unique to each. Two machines in the same subnet talk directly; beyond it, traffic goes through a gateway.
In practice, you use it to size a corporate network, segment a LAN (users, servers, IoT…), configure a firewall or a cloud VPC, or simply understand why two machines can't reach each other. This tool computes everything instantly and sends nothing anywhere: it all happens on the fly. To find out which public address you are using, see My IP.
02The most common prefixes
- /8
- 16,777,214 hosts — the huge historical blocks (e.g. 10.0.0.0/8 in private space).
- /16
- 65,534 hosts — typical for a whole site (e.g. 192.168.0.0/16 in private space).
- /24
- 254 hosts — the “standard” LAN subnet: 192.168.1.0/24 with netmask 255.255.255.0.
- /25 to /28
- 126, 62, 30, 14 hosts — finer segmentation: DMZ, technical VLANs, small offices.
- /30
- 2 hosts — traditional point-to-point links between routers.
- /31
- 2 hosts with no broadcast (RFC 3021) — modern point-to-point links, saves half the addresses.
- /32
- 1 host — designates a single machine, common notation in firewalls and routes.
- /64 (IPv6)
- The standard IPv6 LAN subnet: 2^64 addresses, required for SLAAC autoconfiguration.
03From the command line
The calculation is also available as plain text and JSON (open CORS) — handy in infrastructure scripts:
$ curl "its-my-ip.com/subnet?cidr=192.168.1.0/26" network: 192.168.1.0 broadcast: 192.168.1.63 usable_hosts: 62 $ curl "its-my-ip.com/api/subnet?cidr=192.168.1.0/26" { "network": "192.168.1.0", "usableHosts": 62, … }
04Frequently asked questions
Why do we lose 2 addresses in every subnet?
The first address (all host bits at 0) identifies the network itself, and the last one (all at 1) is the broadcast address that targets every machine. Neither can be assigned to a host. Exceptions: /31 (RFC 3021) used point-to-point, and /32 which designates a single machine.
What does the CIDR /24 notation mean?
The number after the slash says how many bits, from the left, form the network part of the address. /24 means 24 network bits and 8 host bits, i.e. netmask 255.255.255.0 and 254 usable hosts. The larger the prefix, the smaller the subnet.
How do I choose a subnet size?
Count the planned machines, add growth headroom, then take the next power of two (+2 for network and broadcast). For 50 machines: 64 addresses, i.e. a /26. Too small and you will have to renumber; too large and you waste addresses and widen the broadcast domain.
Do classes A, B and C still exist?
No: classful addressing was replaced by CIDR in 1993, which allows any prefix length. People still say “class C” out of habit to mean a /24. The class is shown here for historical reference, as it appears in many courses and docs.
Why are IPv6 subnets always /64?
In IPv6, the last 64 bits identify the interface, and SLAAC autoconfiguration needs all of them. So a LAN is never subnetted more finely than /64. Segmentation happens above it: a provider typically delegates a /48 or /56, which you split into /64s.