How to Calculate Host ID

by Jedadiah Casey

Within an Internet Protocol or IP network, every connected host must have both an IP host address and a subnet mask to operate properly. Any device using the IP protocol can refer to itself with the IP address and subnet mask, but to communicate with other devices on the network, each device must have either a private or public IP address and subnet mask. The host ID is calculated by using the remainder of the subnet mask as it applies to the computer's IP address.

Step 1

Obtain the subnet mask of the device. For example, on a Windows computer, open a command prompt and type "ipconfig" and press the "Enter" key. The most common subnet mask is

Step 2

View the device's IP address. On a Windows computer, the "ipconfig" command also reveals the IP address.

Calculate the host ID based on the subnet mask. For example, with an IP address of and a subnet mask of, the network ID is and the host ID is 34. With an IP of and a subnet mask of, the network ID is 10 and the host ID is 23.65.21.


  • Subnetting is based on binary math with a range of 0 - 255. 0 = 00000000, 128 = 10000000, 192 = 11000000, 224 = 11100000, 240 = 11110000, 248 = 11111000, 252 = 11111100, 254 = 11111110 and 255 = 11111111.

About the Author

Jedadiah Casey started writing professionally in 2007, with articles published in "The Flagler Times" newspaper. He has more than 20 years of experience with computers and networking. Casey holds a Bachelor of Science in information systems from the University of Central Florida, as well as professional industry certifications.

More Articles