Skip to content
NMSnabbit.

IP to Hex Converter

Convert an IPv4 address to its 0x hexadecimal value.

Converters Runs in your browser

How do you convert an IP address to hex?

Every IPv4 address is a 32-bit number, and this converter shows it in hex: each octet becomes two hex digits, joined behind a 0x prefix. 192.168.0.1 converts to 0xC0A80001, since 192 is C0, 168 is A8, 0 is 00 and 1 is 01. Octets outside 0–255 fail validation, so a malformed address produces no output instead of a wrong one.

How to use the IP to Hex

  1. 1 Enter the dotted address, for example 10.0.0.5.
  2. 2 Each octet is validated, then rendered as two hex digits.
  3. 3 Read the joined 0x value in the result field.
  4. 4 Copy it into your config or script.

What you can use it for

  • Storing IPv4 addresses as compact integers.
  • Writing firewall or ACL rules that expect hex.
  • Cross-checking addresses seen in packet captures.
  • Showing how IPv4 maps onto 32 bits.

Frequently asked questions

How is the hex value built from an IP?
The four octets are converted independently and concatenated in order: 10.0.0.5 gives 0a 00 00 05, so the result is 0x0A000005. Leading zeros are kept so the value is always eight digits.
What if an octet is over 255 or missing?
Then it is not a valid IPv4 address. The converter requires four dot-separated values in 0–255 and leaves the output blank until it gets them.
Can I convert the hex back to an IP?
Yes, the companion Hex to IP tool reverses the operation. Paste the 0x value there and the dotted quad comes back.

Related tools

More Converters

More tools like this:

All Converters