Subnet Mask Calculator
Convert between prefix lengths and subnet masks, find the right prefix for a given host count, and view the full subnet cheat sheet.
Prefix โ Subnet Mask
Subnet Mask โ Prefix
How many hosts do I need? โ Find prefix
Subnet Mask Cheat Sheet
Frequently Asked Questions
You need at least 102 addresses (100 hosts + network + broadcast). 2โท = 128 โฅ 102, so a /25 (255.255.255.128) works, providing 126 usable hosts. Use the "Find prefix" tool above to calculate this automatically.
A /32 is a host route โ it represents a single IP address (subnet mask 255.255.255.255). It's used to route to a specific host, commonly in loopback interfaces, BGP, and firewall rules.
A /30 has 4 addresses: 1 network, 2 hosts, 1 broadcast โ the minimum traditional point-to-point link. A /31 (RFC 3021) uses only 2 addresses with no broadcast, also used for point-to-point links on modern routers to save address space.