IPv4 Calculator Help



This calculator will calculate the network address, the host address and the broadcast address for a given TCP/IP address and subnet mask.

These are actually fairly straightforward calculations. The easiest way to do it is to depict both the ip address and the subnet mask in binary. Take 10.11.12.13 with subnet mask 255.254.0.0 listed in binary:

          ip address: 00001010.00001011.00001100.00001101
subnet mask: 11111111.11111110.00000000.00000000
If you do a binary AND between these two numbers, you get the network address:

          ip address: 00001010.00001011.00001100.00001101
subnet mask: 11111111.11111110.00000000.00000000
-----------------------------------AND
network address: 00001010.00001010.00000000.00000000
which translated back to dotted decimal notation is 10.10.0.0

To get the host portion, invert the subnet mask and again perform a binary AND with the ip address:
          ip address: 00001010.00001011.00001100.00001101
inverted subnet mask: 00000000.00000001.11111111.11111111
-----------------------------------AND
host portion: 00000000.00000001.00001100.00001101
which translated back to dotted decimal notation is 0.1.12.13

To obtain the broadcast address, again it is simplest to look at it in binary. Take the inverted subnet mask and perform a binary XOR with the network address:
     network address: 00001010.00001010.00000000.00000000
inverted subnet mask: 00000000.00000001.11111111.11111111
-----------------------------------XOR
broadcast address: 00001010.00001011.11111111.11111111
which translated back to dotted decimal notation is 10.11.255.255