Enter IP address either in a dot-decimal notation or in CIDR notation. In the latter case, the provided prefix length overrides the Subnet mask value.
IP Address, Mask, and Subnet Details:
IP address: 10.1.1.5
IP class: A
Subnet mask: 255.255.255.0
Subnet address: 10.1.1.0
Bits in mask: 24
Number of hosts: 254 |
01 | 02 | 03 | 04 | 05 | 06 | 07 | 08 | 09 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 |
128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
IP: | 10.1.1.5 | ||||||||||||||||||||||||||||||
10 | 1 | 1 | 5 | ||||||||||||||||||||||||||||
0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 |
Mask: | 255.255.255.0 | ||||||||||||||||||||||||||||||
255 | 255 | 255 | 0 | ||||||||||||||||||||||||||||
1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Net Prefix: | 10.1.1.0 | ||||||||||||||||||||||||||||||
10 | 1 | 1 | 0 | ||||||||||||||||||||||||||||
0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Broadcast: | 10.1.1.255 | ||||||||||||||||||||||||||||||
10 | 1 | 1 | 255 | ||||||||||||||||||||||||||||
0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 |
First Host: | 10.1.1.1 | ||||||||||||||||||||||||||||||
10 | 1 | 1 | 1 | ||||||||||||||||||||||||||||
0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 |
Last Host: | 10.1.1.254 | ||||||||||||||||||||||||||||||
10 | 1 | 1 | 254 | ||||||||||||||||||||||||||||
0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0 |
128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
01 | 02 | 03 | 04 | 05 | 06 | 07 | 08 | 09 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 |
Color code: Network Address BitsHost Address Bits
This subnet calculator can perform the following tasks:
Start by entering IP address either in a dot-decimal notation (e.g., 10.1.1.5) or in CIDR notation (e.g., 10.1.1.5/24). In the latter case, the provided prefix length will define the Subnet mask value. This calculator supports prefix length in the range /2 .. /31.
Click Submit to show the results.
Click Copy link to copy to the clipboard the link to this page with the entered IP and subnet values.
Use Copy table to send the content of the subnet table to the clipboard.
CIDR stands for Classless Inter-Domain Routing. CIDR refers to a method for routing Internet Protocol (IP) packets and for allocating of IP addresses.
Number of hosts on a /31 subnet:
Generally, within a subnet, two host addresses - all-zeros and all-ones are reserved as network address and
broadcast, respectively. The same approach applied to a /31 subnet with only two possible addresses in the host identifier
would leave no usable addresses for host assignment.
RFC3021: Using 31-Bit Prefixes on IPv4 Point-to-Point Links
allows assignment of the all-zeros and all-ones IP addresses to hosts on point-to-point links.
This page is best viewed in a browser window at least 860 px wide.
IP addresses are typically represented in decimal format (e.g., 192.168.10.1). Converting these addresses into binary allows us to see the individual bits that make up the address. This binary representation helps visualize how the address is structured and how each octet contributes to the network and host portions of the address.
Suppose we have the IP address 192.168.10.1 and mask 255.255.255.0. In binary, they would be represented as:
11000000.10101000.00001010.00000001 (IP address)
11111111.11111111.11111111.00000000 (Subnet mask)
Using binary operations, we can determine various subnet parameters:
Mask Length: The number of consecutive 1s in the subnet mask represents the mask length. In this case, 24 bits are set to 1, indicating a mask length of 24.
Network Prefix/Network Address: To find the network prefix or network address, we apply a bitwise AND operation between the IP address and the subnet mask. This operation preserves the network portion of the IP address while setting all host bits to 0. For our example:
11000000.10101000.00001010.00000000 (IP address)
11111111.11111111.11111111.00000000 (Subnet mask)
bitwise AND -----------------------
11000000.10101000.00001010.00000000 (Network prefix)
So, the network address is 192.168.10.0. In CIDR notation it is expressed as 192.168.10.0/24, where "24" represents the prefix length.
Prefix Length: The prefix length is the number of bits used for the network portion of the address. Similarly to the mask length, it is determined by the number of 1s in the subnet mask.
Broadcast Address: The broadcast address is the highest address in the subnet and is obtained by setting all host bits to 1. To calculate the broadcast address, we perform a bitwise OR operation between the network address and the inverted subnet mask:
11000000.10101000.00001010.00000000 (Network address)
00000000.00000000.00000000.11111111 (Inverted subnet mask)
bitwise OR ------------------------
11000000.10101000.00001010.11111111 (Broadcast address)
So, the broadcast address is 192.168.10.255.
Host Address Range: The host address range includes all addresses within the subnet except for the network and broadcast addresses. For our example, the host address range is from 192.168.10.1 to 192.168.10.254.
By utilizing our visual calculator to present IP addresses and subnet parameters in binary format, network engineers can better understand how variable length subnet masking works and manage IP address allocations within a network more effectively.