One number, four notations
An IPv4 address is a single unsigned 32-bit integer. Dotted decimal just splits it into four 8-bit octets for human readability. Every representation below is the same value:
| Notation | 192.168.1.1 |
|---|---|
| Dotted decimal | 192.168.1.1 |
| Binary | 11000000.10101000.00000001.00000001 |
| Hexadecimal | 0xC0A80101 |
| 32-bit integer | 3232235777 |
The math
For 192.168.1.1: 192 × 16,777,216 = 3,221,225,472; 168 × 65,536 = 11,010,048; 1 × 256 = 256; plus 1. Total 3,232,235,777.
Decimal to binary per octet uses the place values 128, 64, 32, 16, 8, 4, 2, 1. For 168: 128 + 32 + 8 = 168, so the bits are 10101000. Hex is even easier: each octet is exactly two hex digits (168 = 0xA8).
Where you meet these formats
- Binary: subnetting by hand, understanding masks and wildcards, CCNA exams.
- Hex: packet captures (Wireshark hex pane),
/proc/net/routeand/proc/net/tcpon Linux (stored little-endian, so the bytes appear reversed), some vendor debug output, and IPv4-mapped IPv6 addresses. - Integer: databases (MySQL
INET_ATON()/INET_NTOA(), PostgreSQL arithmetic oninet), geo-IP lookup tables, log analytics where range queries become simpleBETWEENfilters.
Quick checks on Linux
# integer → dotted (Python one-liner) python3 -c "import ipaddress; print(ipaddress.IPv4Address(3232235777))" # dotted → hex printf '%02X' 192 168 1 1; echo # Linux routing table in hex (little-endian) cat /proc/net/route
Address type detection
The status line also classifies the address: private (RFC 1918: 10/8, 172.16/12, 192.168/16), shared CGNAT space (RFC 6598: 100.64/10), loopback (127/8), link-local (169.254/16, APIPA), multicast (224/4), reserved (240/4) or public. The legacy class (A–E) is shown for reference only.
Watch out for
- Leading zeros: some parsers (older
inet_aton, ping on certain systems) read010.001.001.001as octal, i.e. 8.1.1.1. Never pad octets with zeros in configs. - Byte order: network byte order is big-endian. If a tool shows 0x0101A8C0, it is the same address stored little-endian.
- Signed integers: some languages and older databases store addresses as signed 32-bit values, so anything from 128.0.0.0 upward appears negative. 192.168.1.1 becomes −1,062,731,519. Add 232 to recover the unsigned value.
The converter accepts binary with or without dots and hex with a 0x prefix. Integers up to 4,294,967,295 are valid; anything larger is rejected because it does not fit in 32 bits.