Subnet Host Calculator

Subnet Host Calculator

Every IP network is really two numbers in disguise: a network address and a size. The size is written as a CIDR prefix, such as /24,and it decides how many devices can live on that network. Get the number wrong and you either waste hundreds of addresses or run out of room for new servers. The subnet host calculator above turns any prefix between /0 and /32 into the exact figures you need ? total addresses, usable hosts, the subnet mask,and the wildcard mask ? so you can size a network with confidence in seconds.

How to Use the Subnet Host Calculator

1. Enter the subnet prefix.Type the CIDR number into the input box. For a home or small-office network this is usually 24; for a single point-to-point link it may be 30 or 31.

2. Press Calculate. The tool instantly works out how many addresses the prefix holds and how many of them can be assigned to hosts.

3. Read the total addresses. This is every IP in the block,including the network and broadcast addresses.

4. Read the usable hosts. This is the number that actually matters for planning ? the addresses you can hand to computers, printers, and phones.

5. Copy the subnet mask and wildcard mask.Use the dotted-decimal mask (for example 255.255.255.0)in router and server configuration, and the wildcard mask in access-control lists.

6. Press Reset to clear the form and run another prefix.

Worked Example

Suppose you are carving a new office subnet out of a larger block and you pick a /24.

– Total addresses: 2^(32-24) = 2^8 = 256

– Usable hosts: 256 ? 2 = 254(the network and broadcast addresses are reserved)

– Subnet mask: 255.255.255.0

– Wildcard mask: 0.0.0.255

That is more than enough for a 60-person office,and you now know it leaves 194 spare host addresses for growth.

Try a tighter /26 for a small branch office:

– Total addresses: 2^(32-26) = 2^6 = 64

– Usable hosts: 64 ? 2 = 62

– Subnet mask: 255.255.255.192

– Wildcard mask: 0.0.0.63

Enter 26 into the calculator and you will see exactly these values.

More Helpful Information

The formula. The number of addresses in a prefix of length n is 2^(32?n). Two addresses are reserved in almost every subnet: the first (the network address, all host bits zero) and the last (the broadcast address,all host bits one). That is why usable hosts are usually total minus two.

The /31 and /32 exceptions.A /31 holds exactly 2 addresses and both are usable as a point-to-point link between two routers (per RFC 3021), so the calculator reports 2 usable hosts. A /32 is a single host address ? a host route ? so it reports 1 usable host.

Common prefixes at a glance. /8 gives 16,777,214 usable hosts;/16 gives 65,534; /20 gives 4,094; /22 gives 1,022; /24 gives 254; /25 gives 126;/26 gives 62; /27 gives 30; /28 gives 14; /29 gives 6; /30 gives 2.

Wildcard vs. subnet mask. The wildcard mask is the bitwise inverse of the subnet mask. Cisco access lists and OSPF network statements use the wildcard form (0.0.0.255 for a /24), while interface configuration uses the subnet-mask form (255.255.255.0). Confusing the two is the single most common subnetting mistake.

Planning tip. Always leave headroom. Pick the prefix that gives you roughly double the hosts you need today. Renumbering a subnet later is far more painful than “wasting” a few dozen addresses now.

Frequently Asked Questions

1. How many usable hosts does a /24 have?

A /24 contains 256 total addresses and 254 usable hosts,because the network and broadcast addresses are reserved.

2. What is the formula for usable hosts?

Usable hosts = 2^(32 ? prefix length) ? 2, except for /31 (2 usable)and /32 (1 usable).

3. What is the difference between total addresses and usable hosts?

Total addresses count every IP in the block. Usable hosts exclude the network address and broadcast address, which cannot be assigned to devices.

4. What subnet mask goes with a /26?

A /26 uses the mask 255.255.255.192 and provides 64 total addresses,62 of them usable.

5. What is a wildcard mask?

The wildcard mask is the inverse of the subnet mask. For /24 it is 0.0.0.255. It is used in access-control lists and some routing-protocol statements.

6. Can a /31 really have 2 usable hosts?

Yes. On a /31 point-to-point link both addresses are usable because there is no network or broadcast address, per RFC 3021.

7. What does a /32 represent?

A /32 is a single host address, commonly used for host routes and loopback interfaces. It has 1 usable address.

8. How many hosts can a /16 support?

A /16 provides 65,536 total addresses and 65,534 usable hosts.

9. Why are the network and broadcast addresses reserved?

The network address identifies the subnet itself,and the broadcast address sends traffic to every host on it. Assigning either to a device would break routing.

10. What prefix should I use for 500 devices?

You need at least 502 addresses, so choose /23,which gives 512 total and 510 usable hosts.

11. Is CIDR notation the same as a subnet mask?

They describe the same thing in different forms. /24 and 255.255.255.0 are equivalent; CIDR is shorter and less error-prone.

12. Can I subnet a subnet?

Yes. This is called variable-length subnet masking (VLSM). A /24 can be split into two /25s, four /26s, and so on.

13. Does IPv6 use the same host math?

No. IPv6 subnets are typically /64, and the usable-host concept is different because address space is effectively unlimited.

14. What is the smallest useful subnet?

For a normal LAN segment, /30 with 2 usable hosts is the smallest;for a point-to-point link, /31 works on modern routers.

15. Why does my calculator show fewer hosts than I expected?

You probably forgot to subtract the network and broadcast addresses. Always use the usable-host figure, not the total, for capacity planning.

CONCLUSION

Sizing a subnet comes down to one idea: the prefix length decides everything,and the calculator turns that single number into total addresses, usable hosts,subnet mask, and wildcard mask instantly. Use it whenever you plan a new VLAN,size a branch office, or write an access list,and you will stop guessing and start engineering. Keep the common prefixes memorized,remember the /31 and /32 exceptions, and always plan with the usable-host count ? not the total.