IPv4 to Hex Converter
Convert a dotted IPv4 address into its 8-digit hexadecimal form — explicitly IPv4, as distinct from the much larger IPv6 address space.

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 IPv4 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.
Where IPv4 to Hex Actually Comes Up
Writing an Address Into a Hex-Based Config Field
Some embedded network stacks and configuration formats expect an IPv4 address as a single hex integer rather than dotted decimal.
192.168.1.1 -> 0xC0A80101
Searching a Hex-Encoded Log for a Known IPv4 Address
When a log or packet trace shows addresses in hex, converting a known IPv4 address you're looking for into hex first makes it searchable as plain text.
search log for C0A80101
Computing a Subnet Mask Application in Hex
Networking calculations that AND an address against a netmask are often easier to reason about once both are in hex form.
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) — see the Hex Little Endian IP Converter if you need little-endian instead.
- Supports IPv4 only — see IPv6 to Hex for the 128-bit address space.
Frequently Asked Questions
Why does this page specify "IPv4" instead of just "IP"?
To be explicit that this handles the 32-bit IPv4 address space (producing 8 hex digits), as distinct from IPv6's 128-bit space — see IPv6 to Hex for that instead.
How do you convert an IPv4 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.
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.
Is the output always 8 digits?
Yes — 4 bytes always produce exactly 8 hex digits, with leading zeros kept where a byte's value is small.