Description of IP Address in Binary, Decimal and Hexadecimal

Description of IP Address in Binary, Decimal and Hexadecimal

Generally common IP addresses are in decimal, but in different occasions, other writing methods such as binary and hexadecimal may also be used, which will be explained below:

IPv4: 202.103.0.68 Network Class, Net ID, Host ID Description of IP Address in Binary, Decimal and Hexadecimal Description of IP Address Class A/B/C/D/E and Network ID, Host ID
  • • Decimal: The IP address we often refer to usually refers to the IPv4 network address, which consists of 4 numbers from 0 to 255, separated by dots, for example: 202.103.0.68, these 4 numbers are all decimal numbers that people are accustomed to use, which is easy to understand, remember and write;
  • • Binary: In terms of the underlying technology, an IPv4 network address is composed of 32-bit binary numbers, and each binary number has only two values, 0 and 1. In order to facilitate computer processing, 32 binary numbers is divided into 4 bytes, each byte is composed of 8 binary digits, and the 4 bytes are separated by dots to facilitate manual memory and writing. For example: the binary notation corresponding to the above decimal 202.103.0.68 is 11001010.01100111.00000000.01000100;
  • • Hexadecimal: But there are only two values ​​of 0 and 1 in binary system. It is too long to write 32 0s or 1s to express an IPv4 address, so hexadecimal is also used in some places. Each byte only needs 2 hexadecimal digits to represent, each hexadecimal digit is 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C , D, E, or F, a total of 16 numbers, so the IPv4 address written in this way is four 2-digit hexadecimal numbers separated by dots. For example: the hexadecimal notation corresponding to the above decimal 202.103.0.68 is CA.67.00.44.

To summarize their different uses:

  • • Decimal: used for general writing, memory, and communication of IP addresses;
  • • Binary: used to describe the principle of IP address and its implementation in the machine;
  • • Hexadecimal: used for appearance in technical documents, scientific computing, etc.

The decimal, binary and hexadecimal of the same IP address are actually equivalent and the same. There are formulas that can be converted to each other, and there are special network calculators that can be used for conversion. We won't go into details of the mathematical method of conversion, interested friends can search for it on the Internet.

In more individual cases, it is also useful to use other bases such as octal to represent IP addresses. Because it is very rare, it will not be explained here.

📚 Comment

Languages