An IP address is just a number, written four different ways
The dotted-decimal form you normally see — 192.168.1.1 — is one convenient representation of a plain 32-bit integer. The same address is also a specific binary pattern, a specific hexadecimal value, and a specific octal value, and several networking contexts expect one of those other forms rather than the familiar dotted notation. This converts an IPv4 address between all of them at once.
Example: 192.168.1.1
| Form | Value |
|---|---|
| Decimal (dotted) | 192.168.1.1 |
| Decimal (32-bit integer) | 3232235777 |
| Hexadecimal | 0xC0A80101 |
| Binary | 11000000.10101000.00000001.00000001 |
| Octal | 030052000401 |
Each octet — each of the four dot-separated numbers — is exactly one byte, 0 to 255. Converting the whole address to binary and lining it up in four 8-bit groups is exactly what makes subnetting and CIDR notation (like /24) make sense: a subnet mask is a run of binary 1s followed by 0s applied across those same 32 bits.
Where each form actually gets used
- The 32-bit integer form shows up in some firewall rules, older database schemas that store IPs as a single number for efficient range queries, and some programming APIs that work with IP addresses as integers rather than strings.
- Hexadecimal appears in low-level network packet captures, some router configuration interfaces, and IPv6 addresses, which are natively written in hex groups.
- Binary is what you actually need to see to understand subnetting, network/host boundaries, and why a
/24network holds 256 addresses while a/25holds 128 — the binary form makes the boundary visible in a way the decimal form hides. - IPv6 support here handles converting between the shortened form (with
::zero compression) and the fully expanded form, since some tools and log formats require one or the other explicitly.