The page is for IPv4 only. It does not ping the address, look up a name, or ask a router what the real mask is. You supply the prefix.
How to use
- Type the IPv4 address as four decimal octets.
- Type the prefix length, a whole number from 0 to 32.
- Press Calculate and read the network line before you use the host range.
Formula / how it works
What a prefix means. An IPv4 address is 32 bits. A prefix of N says the first N bits identify the subnet and the remaining 32−N bits identify the host. The subnet mask has those first N bits set to 1. A prefix of 24 is 11111111.11111111.11111111.00000000, which is 255.255.255.0 in dotted decimal. The wildcard is the inverse: 0.0.0.255 for a /24. The number base converter is useful when you want to practise the same bit patterns outside a network problem. This page already prints the mask in binary so you can see the ones and the zeros without converting by hand.
Network and broadcast. The network address is the address with every host bit cleared. The broadcast address is the address with every host bit set. For 192.168.1.10/24 the network is 192.168.1.0 and the broadcast is 192.168.1.255. Hosts that send to the broadcast address reach every host on that subnet, which is why the traditional usable range starts at network+1 and ends at broadcast−1: 192.168.1.1 through 192.168.1.254, 254 hosts. The total number of addresses, including network and broadcast, is 2^(32−prefix), here 256.
Small prefixes that break the old rule. A /32 is a single address. Network, broadcast and the only host are the same, and the usable count is 1. A /31 has two addresses. RFC 3021 uses both of them on a point-to-point link, so the page counts 2 usable hosts and does not reserve one as network and one as broadcast. A /30, often used for a tiny link with the older rule, has 4 addresses and 2 usable hosts. 10.0.5.9/30 sits in 10.0.5.8–10.0.5.11, with usable addresses 10.0.5.9 and 10.0.5.10 and mask 255.255.255.252.
Classful labels are history. The first octet still gets a class label because old notes say “class C” for 192–223. Classful routing has not been how addresses are allocated for a long time; the prefix is the thing that matters. 10.0.0.0/8 is class A by that old label and is also a private range. Private ranges you will see constantly are 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16. The calculator does not refuse them and does not mark them private; it only computes the subnet you asked for. 127.0.0.0/8 is loopback. 224.0.0.0/4 is multicast and should not be subnetted as if it were a LAN of hosts.
Checks you can do yourself. The mask’s binary should contain exactly “prefix” ones, then zeros. The network logical-AND the mask equals the network. The address logical-AND the mask equals the same network, which is how you know the address sits in the subnet you were shown. Usable hosts for a prefix of 30 or less, other than the /31 special case, equal total addresses minus 2.
What this will not tell you. It does not know your ISP’s assignment, whether an address is in use, or how a firewall is written. Overlapping summaries and VLSM plans are a series of these calculations, not one extra mode. IPv6 prefixes are a different width and are not accepted. Each octet must be a whole number from 0 to 255.
Worked examples
A home /24
Inputs: IPv4 address: 192.168.1.10 | Prefix length: 24
Enter the address 192.168.1.10 and the prefix 24. The mask is twenty-four one-bits.
Result: Address: 192.168.1.10
Prefix: /24
Subnet mask: 255.255.255.0
Mask in binary: 11111111.11111111.11111111.00000000
Wildcard: 0.0.0.255
Network: 192.168.1.0
Broadcast: 192.168.1.255
First host: 192.168.1.1
Last host: 192.168.1.254
Usable hosts: 254
Total addresses: 256
Classful label: C (historical)
Network and broadcast addresses are not counted as hosts.
Usable hosts run from 192.168.1.1 to 192.168.1.254.
A four-address /30
Inputs: IPv4 address: 10.0.5.9 | Prefix length: 30
Enter the address 10.0.5.9 and the prefix 30. Only two of the four addresses are usable under the older host rule.
Result: Address: 10.0.5.9
Prefix: /30
Subnet mask: 255.255.255.252
Mask in binary: 11111111.11111111.11111111.11111100
Wildcard: 0.0.0.3
Network: 10.0.5.8
Broadcast: 10.0.5.11
First host: 10.0.5.9
Last host: 10.0.5.10
Usable hosts: 2
Total addresses: 4
Classful label: A (historical)
Network and broadcast addresses are not counted as hosts.
The network is 10.0.5.8 and the broadcast is 10.0.5.11.
Use cases
- Checking the network and broadcast of a static address before you set a gateway.
- Reading a /30 or /31 the way a point-to-point link is numbered.
- Teaching the binary mask next to the dotted decimal.
- Counting hosts before you pick a prefix for a small LAN.
Tips & limitations
- The prefix is an input. The page cannot discover it from the address alone.
- Use /31 counts only on links that follow RFC 3021. Older gear may still reserve network and broadcast.
- Ignore the classful label when you are planning. Use the prefix.
- AND the address with the mask if you want to re-derive the network by hand.
FAQ
Why are there 254 hosts on a /24, not 256?
The all-zero host bits are the network address and the all-one host bits are the broadcast. Traditional hosts use the 254 addresses in between.
What is special about /31?
RFC 3021 treats both addresses as usable on a point-to-point link, so the page counts 2 hosts and does not reserve a broadcast.
Does this look up who owns the address?
No. It only splits the bits you typed. It does not query a registry or a DNS server.
Can I enter a mask such as 255.255.255.0 instead of 24?
Type the prefix length 24. The dotted mask is one of the outputs, not the input.
What does the class line mean?
It is the old classful label of the first octet. Allocation has been classless for years; the prefix decides the subnet.
Is the address sent to a server?
No. The bit operations run in the browser.
Runs entirely in your browser; nothing is uploaded. Check the output before you rely on it in production code, data or security decisions.