How to use
- Type an address such as 192.168.1.10/24, or an address and a subnet mask such as 192.168.1.10 255.255.255.0. Press an example to start.
- Read the network address, broadcast address, first and last usable host, and the number of usable hosts.
- Copy any value with its Copy button. The address type tells you if the range is private, loopback, link-local or public.
Examples
192.168.1.10/24
→ network 192.168.1.0, broadcast 192.168.1.255, hosts 192.168.1.1 to 192.168.1.254 (254 usable)The mask is 255.255.255.0 and the wildcard mask is 0.0.0.255.
172.16.5.9/20
→ network 172.16.0.0, broadcast 172.16.15.255, 4094 usable hostsThe mask is 255.255.240.0.
10.0.0.4/31
→ two usable addresses, 10.0.0.4 and 10.0.0.5A /31 is a point-to-point link where both addresses are used (RFC 3021).
How it works
The address is turned into a 32-bit number. The subnet mask is the first prefix bits set to one, the network address is the address with the host bits cleared, and the broadcast address is the network address with all host bits set. The first and last host are one above the network address and one below the broadcast address, with the /31 and /32 exceptions described above.
The usable host count is 2 to the power of the host bits, minus 2. A dotted subnet mask is accepted too, but only if it is a run of ones followed by zeros, such as 255.255.240.0; a mask like 255.0.255.0 is rejected.
The address type is found by checking which reserved range the address falls into. The tool is tested against /8, /20, /24, /31 and /32 examples.
Sources
- RFC 4632: Classless Inter-domain Routing (CIDR)
- RFC 1918: Address Allocation for Private Internets
- RFC 3021: Using 31-Bit Prefixes on IPv4 Point-to-Point Links
- RFC 6598: IANA-Reserved IPv4 Prefix for Shared Address Space
Frequently asked questions
- What does the number after the slash mean?
- It is the prefix length: how many of the 32 bits of the address identify the network. The rest identify hosts in it. /24 leaves 8 bits for hosts, which is 256 addresses, and a /16 has 65,536 addresses.
- Why are two addresses not usable?
- In an ordinary subnet, the first address is the network address and the last is the broadcast address, so a /24 has 256 addresses and 254 usable hosts. The exceptions are /31, which has two usable addresses, and /32, which is a single host.
- What is a wildcard mask?
- It is the subnet mask with every bit flipped, so 255.255.255.0 becomes 0.0.0.255. Some router and firewall configurations, such as access lists, use wildcard masks.
- What are the private address ranges?
- 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16 are reserved for private networks (RFC 1918). 100.64.0.0/10 is shared address space used by some providers (RFC 6598), and 169.254.0.0/16 is link-local.
- Does it support IPv6?
- Not yet. The tool handles IPv4 only.
- Is the address sent anywhere?
- No. The calculation is plain arithmetic in your browser.