IP to Hex Converter
Convert a dotted IPv4 address into its 8-digit hexadecimal form — the compact representation used in low-level networking code and configs.

Built by
Swapnil SanghviFull-Stack Web Developer & WordPress Developer
Swapnil Sanghvi is a full-stack web and WordPress developer, UI designer, and full-time freelancer who builds and maintains Hex Calculator.
Further reading: IPv4 — Wikipedia
How to Convert an IP Address to Hex
Each of the four dot-separated numbers in an IPv4 address is one byte (0-255). Converting to hex means converting each byte to its 2-digit hex form and joining them, left to right, in the same order they appeared in the dotted address.
IP to Hex Example, Step by Step
192.168.1.1 = 0xC0A80101
192.168.1.1 -> 0xC0A80101
Decimal: 192 168 1 1 Hex: C0 A8 01 01
| Step | Description | Result |
|---|---|---|
| Take each octet | 192, 168, 1, 1 | 4 bytes |
| Convert each to 2-digit hex | 192->C0, 168->A8, 1->01, 1->01 | C0, A8, 01, 01 |
| Join in order | left to right, no separators | 0xC0A80101 |
192.168.1.1 is one of the most common private-network addresses, which is why it's a useful reference value to check any hex/IP converter against.
Where IP to Hex Actually Comes Up
Writing an Address Into a Config File in Hex Form
Some embedded network stacks and configuration formats expect an address as a single hex integer rather than dotted decimal — converting first avoids a manual, error-prone conversion.
192.168.1.1 -> 0xC0A80101
Matching an Address Against a Hex-Encoded Log
When a log or packet trace shows addresses in hex, converting a known IP you're looking for into hex first makes it easy to search for with a text search instead of eyeballing every entry.
search log for C0A80101
Computing a Subnet or Netmask Value in Hex
Networking calculations that involve bitwise AND/OR against an address (like applying a subnet mask) are often easier to reason about once both the address and the mask are in hex.
address AND netmask, both in hex
Why Use This Calculator Instead of Doing It by Hand
- Validates every octet is 0-255 before converting, catching typos immediately
- Always produces the full 8-digit hex form, with leading zeros preserved
- Runs entirely in your browser — nothing you type gets sent anywhere
- Accepts the standard dotted-decimal format you'd type anywhere else
Limitations
- Produces big-endian output (most significant byte first) — convert with the Endianness Tools afterward if you need little-endian.
- Supports IPv4 only — IPv6 addresses aren't handled by this converter.
Frequently Asked Questions
How do you convert an IP address to hex?
Convert each of the 4 decimal octets to a 2-digit hex byte, then join them in order — 192.168.1.1 becomes C0A80101.
Why would I need an IP address in hex form?
Some configuration file formats, low-level networking APIs, and routing table dumps represent addresses in hex for compactness — converting a familiar dotted address into that form is often needed to match against them.
What happens if an octet is out of range?
This converter rejects it — each octet must be 0-255, since that's the valid range for a single byte, and an out-of-range octet isn't a valid IPv4 address.
Is the resulting hex value always 8 digits?
Yes — 4 bytes always produce 8 hex digits, with leading zeros kept where a byte's value is small (e.g. 0.0.0.1 becomes 00000001, not just 1).
Does this account for byte order?
The result is big-endian (most significant byte first, the standard network byte order) — if you need little-endian instead, run the result through the Hex Little Endian Converter afterward.