Hex to IP address
By Oakgen Team · Updated
Split the 8 hex digits into four pairs and convert each pair to decimal. C0A80001 becomes C0=192, A8=168, 00=0, 01=1, so 192.168.0.1.
Hexadecimal to IPv4 address
IPv4 address
| Address | Hex | What it is |
|---|---|---|
| 127.0.0.1 | 7F000001 | Loopback (127.0.0.0/8) |
| 10.0.0.1 | 0A000001 | Private use (10.0.0.0/8) |
| 172.16.0.1 | AC100001 | Private use (172.16.0.0/12) |
| 192.168.0.1 | C0A80001 | Private use (192.168.0.0/16) |
| 255.255.255.255 | FFFFFFFF | Limited broadcast |
Why it is four pairs
RFC 791 defines IPv4 addresses as four octets, 32 bits in all. One octet is one byte, which is two hex digits, so a whole address is eight hex digits. Dotted decimal, the form people read, writes each octet as a number from 0 to 255 (RFC 3986 gives that syntax).
Check the example: 192.168.0.1 is C0A80001, and 127.0.0.1 is 7F000001. Shorter inputs are padded on the left with zeros, so 1 becomes 0.0.0.1.
Hex inside addresses
The POSIX inet_addr function accepts a leading 0x as hexadecimal for any part of an address, a leading 0 as octal and otherwise decimal. With a single number the value is stored directly, which is why 0xC0A80001 can stand for 192.168.0.1 in tools that follow POSIX. Do not rely on it when you write configuration: leading zeros are read as octal, a common source of mistakes.
Special ranges to recognise
RFC 1918 reserves 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16 for private use. RFC 1122 reserves 127.0.0.0/8 for loopback, and the all-ones address is the limited broadcast. IPv6 is different: addresses are 128 bits written as up to eight groups of one to four hex digits, so this converter covers IPv4 only.
Do more with Oakgen Agent
The Agent can convert a long list in its code sandbox and label private, loopback and broadcast addresses.
Open in Oakgen AgentThe prompt is filled in for you. Nothing is sent until you press send in the Agent.
FAQ
What is 0xC0A80001 as an IP address?
192.168.0.1, a private address.
How do I convert an IP address to hex?
Convert each of the four numbers to two hex digits and join them. 10.0.0.1 becomes 0A000001. Use the Swap button above.
Can I convert IPv6 here?
No. IPv6 addresses are 128 bits and are already written in hex groups.
Why are 192.168.x.x addresses special?
RFC 1918 reserves that block for private networks, so those addresses are not routed on the public internet.
Sources
- IETF RFC 791: Internet Protocol (read 2026-11-19)
- IETF RFC 3986: URI generic syntax, section 3.2.2 (read 2026-11-19)
- The Open Group, POSIX.1-2017: inet_addr (read 2026-11-19)
- IETF RFC 1122: requirements for Internet hosts, section 3.2.1.3 (read 2026-11-19)
- IETF RFC 1918: address allocation for private internets (read 2026-11-19)
- IETF RFC 6890: special-purpose IP address registries (read 2026-11-19)