Skip to content

IP to Hex Converter

Turn IP addresses into their hexadecimal form, one address per line, for IPv4 and IPv6.

Processed locally in your browser

Options
IPv4 gives 8 hex digits, IPv6 gives 32. Separators group IPv4 by octet and IPv6 by 16-bit group.0 chars · 0 lines
The result will appear here.

What is IP to Hex Converter?

An IPv4 address is a 32-bit number, so it is exactly 8 hexadecimal digits: each dotted octet becomes two digits, and 192.168.1.1 is C0 A8 01 01, or 0xC0A80101. An IPv6 address is a 128-bit number, so it is 32 hex digits, which is what you see in the expanded form 2001:0db8:0000:… without the colons.

This converter reads every line, strictly validates it as IPv4 or IPv6, and prints the hex value. You choose the 0x prefix, uppercase or lowercase, and a separator between octets (IPv4) or 16-bit groups (IPv6). For a single address it also shows the decimal value and the address type; for a list it fills a table.

How does it work?

  1. Paste one IPv4 or IPv6 address per line; IPv4 and IPv6 can be mixed.
  2. Choose whether to keep the 0x prefix and uppercase letters.
  3. Pick a separator if you want the octets or groups split, for example C0:A8:01:01.
  4. Copy the result, or turn on “input = result” to keep each address next to its hex value.

Common use cases

  • Reading an address in a packet capture or hex dump and matching it with its dotted form.
  • Writing IP constants such as 0x7F000001 in C, Go or assembly code.
  • Building firewall or BPF filter values that expect a hexadecimal address.
  • Checking how an IPv6 address expands to 32 digits.

Examples

Try this input in the tool above:

Input
192.168.1.1
10.0.0.255
2001:db8::1
Output
0xC0A80101
0x0A0000FF
0x20010DB8000000000000000000000001

Privacy

IP to Hex Converter runs entirely in your browser. The text or files you provide are processed on your device and are not uploaded, logged or stored on our servers.

Limitations

The hex value is the address in network byte order (big-endian). Some tools and CPUs display it byte-swapped, so C0A80101 may appear as 0101A8C0 elsewhere.

Frequently asked questions

How many hex digits does an IP address have?

IPv4 always gives 8 digits (32 bits) and IPv6 always gives 32 digits (128 bits). Leading zeros are kept, so 10.0.0.1 is 0A000001 and not A000001.

Why do my hex digits look reversed in a debugger?

On little-endian machines a 32-bit value is stored with the lowest byte first, so memory shows 01 01 A8 C0 for 192.168.1.1. This tool always writes the network order, most significant octet first.

Does it accept an IPv6 address with a zone or brackets?

Yes. A %zone suffix and [brackets] are accepted and ignored. A /prefix is rejected because a prefix length is not part of an address.

More tools in Network Tools →