Subnet Mask to Binary Calculator
Convert dotted masks, CIDR prefixes, and host ranges into a clean binary breakdown for home labs, VLANs, and small network plans.
📋 Presets
🔧 Calculator Inputs
📊 Full Breakdown
📑 Reference Tables
| Prefix | Mask | Binary | Usable Hosts |
|---|---|---|---|
| /24 | 255.255.255.0 | 11111111.11111111.11111111.00000000 | 254 |
| /25 | 255.255.255.128 | 11111111.11111111.11111111.10000000 | 126 |
| /26 | 255.255.255.192 | 11111111.11111111.11111111.11000000 | 62 |
| /27 | 255.255.255.224 | 11111111.11111111.11111111.11100000 | 30 |
| /28 | 255.255.255.240 | 11111111.11111111.11111111.11110000 | 14 |
| /29 | 255.255.255.248 | 11111111.11111111.11111111.11111000 | 6 |
| /30 | 255.255.255.252 | 11111111.11111111.11111111.11111100 | 2 |
| /31 | 255.255.255.254 | 11111111.11111111.11111111.11111110 | 2 |
| Bit | Decimal | Binary | Role |
|---|---|---|---|
| 1 | 128 | 10000000 | Octet start |
| 2 | 64 | 01000000 | Half split |
| 3 | 32 | 00100000 | Smaller block |
| 4 | 16 | 00010000 | Mid block |
| 5 | 8 | 00001000 | Small block |
| 6 | 4 | 00000100 | Tiny block |
| 7 | 2 | 00000010 | P2P block |
| 8 | 1 | 00000001 | Last bit |
| Class | Range | Default Mask | Typical Use |
|---|---|---|---|
| A | 1-126 | 255.0.0.0 | Large LANs |
| B | 128-191 | 255.255.0.0 | Mid networks |
| C | 192-223 | 255.255.255.0 | Small LANs |
| Other | 224-255 | Varies | Special use |
| Hosts Need | Prefix | Mask | Block |
|---|---|---|---|
| 2 | /30 | 255.255.255.252 | 4 |
| 6 | /29 | 255.255.255.248 | 8 |
| 14 | /28 | 255.255.255.240 | 16 |
| 30 | /27 | 255.255.255.224 | 32 |
| 62 | /26 | 255.255.255.192 | 64 |
| 126 | /25 | 255.255.255.128 | 128 |
| 254 | /24 | 255.255.255.0 | 256 |
| 510 | /23 | 255.255.254.0 | 512 |
🛠 Equipment / Spec Grid
💡 Tip Boxes
Tip: Match the mask and prefix before you trust any host count.
Tip: Treat /31 and /32 as special cases when checking usable addresses.
A subnet mask are used to determine where the network portion of an IP address end and the host portion begins. Additionally, a subnet mask is used to define how many address can be used for devices on the network. A subnet mask can be wrote in dotted decimal notation, such as 255.255.255.0, or in CIDR notation, such as /24.
A subnet mask use binary digits to separate the network portion of an IP address from the host portion of an IP address. The subnet mask informs the router which portion of an IP address is for the network and which portion of the IP address is for the host on the network. A subnet mask consist of several octet.
What is a subnet mask
Each octet contains eight bit. A bit value of one in a subnet mask indicate that the bit is part of the network portion of an IP address. A bit value of zero in a subnet mask indicate that the bit is part of the host portion of an IP address.
For example, a /24 mask has twenty-four bits that contain a value of one and eight bit that contain a value of zero. Therefore, a /24 subnet mask create a twenty-four bit network portion for IP addresses. A /24 mask has eight zero in its host portion, which allow for 256 IP addresses on the network.
However, one address is used for the network address, and another address is used for the broadcast address. Therefore, a /24 mask allows for 254 IP addresses for host on a network. Altering the number of zero in the subnet mask can change the number of host that can be on a network.
For instence, using a /25 mask instead of a /24 mask will increase the number of one in the mask and decrease the number of zero in the mask. A /25 mask will only allow for 128 total address for a network. Therefore, a /25 mask will only allow for 126 address for hosts on the network.
If the network administrator decrease the number of zero in the subnet mask, the number of available host on the network will decrease. However, the number of subnet created by the network will increase. Subnets allow network to be segmented into smaller network.
Additionally, different type of traffic can be organized into a network into separate subnet for management. People often make mistake when using subnet masks. Subnet mask math can be difficult to calculate in ones head.
Many people will make a mistake with the number of host that can be on a network if they dont subtract the one address for the network and the one address for the broadcast address. They may also choose a mask that provides too many address for the number of device that will be on the network. Using a /23 mask for a network with only 200 device will waste many of the IP addresses that can be used on the network.
Using a subnet mask calculator can avoid these mistake. A subnet mask calculator can calculate the binary representation of the mask. Additionally, a subnet mask calculator can calculate the total number of usable host address on the network.
Before applying a subnet mask to a network, it is important to ensure that the network has the appropriately requirements for the number of device on the network. Additionally, it is important to ensure that there is enough address in the subnet mask to accommodate those device and to accommodate future growth in the number of device on the network. When a administrator apply subnet mask correctly to networks, the network can be properly organize, and the IP addresses can be efficient utilized.



