Xerobit

Hex to IP and IP Address to Hex Converter

Enter any IPv4 or IPv6 address to see its hexadecimal and decimal representations, or paste a hex value to convert it back to an IP. This ip to hex converter runs entirely in your browser so nothing is uploaded to a server.

Result

  • Type
    IPv4
  • IP address
    192.168.0.1
  • Hex (0x)
    0xC0A80001
  • Dotted hex
    C0.A8.00.01
  • Decimal
    3232235521

How to use the ip to hex converter

  1. Enter an IP address (like 192.168.0.1) or a hex value (like 0xC0A80001) into the field.
  2. The tool automatically detects whether the input is IPv4, IPv6, hex or decimal.
  3. Read the converted results below: standard IP, hex with 0x prefix, dotted hex and decimal integer.
  4. For IPv6, view both the compressed form and the full eight-group hex expansion.

How IP address to hex conversion works

An IPv4 address consists of four octets, each ranging from 0 to 255. To perform an ip address to hex conversion, you translate each octet into its two-digit hexadecimal equivalent and concatenate them. Take 192.168.0.1 as an example:

  • 192 in base 16 is C0
  • 168 is A8
  • 0 is 00
  • 1 is 01

Joining those gives C0A80001, commonly written with a prefix as 0xC0A80001. The same logic applies in reverse when you use this tool as a hex to ip converter: split the eight hex digits into four pairs and convert each pair back to a decimal octet.

Converting an IP address to decimal

Beyond hex, network tools often need the ip address to decimal representation. An IPv4 address is simply a 32-bit unsigned integer. You calculate it by treating each octet as a byte in a big-endian number:

(octet1 × 256³) + (octet2 × 256²) + (octet3 × 256) + octet4

For 192.168.0.1: (192 × 16777216) + (168 × 65536) + (0 × 256) + 1 = 3232235521. This decimal format is used in some routing tables, firewall rules and programming APIs where a single integer is easier to compare than a dotted string.

IPv6 hex notation

IPv6 addresses are 128 bits long, divided into eight groups of 16 bits each. Every group is naturally expressed as four hexadecimal digits. For instance, 2001:0db8:0000:0000:0000:0000:0000:0001 is already in hex. Standard practice compresses leading zeros within each group and replaces consecutive all-zero groups with ::, yielding 2001:db8::1.

When converting hex to ip for IPv6, you can provide either the compressed or expanded form. This ip to hex converter will output both the standard compressed address and the fully expanded eight-group version so you can match whatever format your system expects.

Common formats reference

Different systems expect different notations. Here is a quick reference for the address 192.168.0.1:

FormatExampleUsed by
Dotted decimal192.168.0.1Most user interfaces, DNS records
Prefixed hex0xC0A80001C, Python, debugging tools
Dotted hexC0.A8.00.01Some log formats, packet analysis
Decimal integer3232235521Databases, low-level APIs

If you also need to work with binary representations, the ip to binary converter handles that translation. For subnet math, try the ip range calculator.

Edge cases and common mistakes

When converting between formats, keep these pitfalls in mind:

  • Byte order: Network byte order is big-endian. If you read a hex dump from a little-endian system, the bytes may appear reversed.
  • Leading zeros: In dotted decimal, some parsers treat leading zeros as octal (e.g., 010 becomes 8). Hex formats do not have this ambiguity.
  • IPv6 scope IDs: Link-local IPv6 addresses sometimes include a zone index like %eth0. Strip it before converting to pure hex.
  • Overflow: A 32-bit decimal integer for IPv4 cannot exceed 4294967295 (255.255.255.255). Values above that are invalid.

This tool validates inputs against these rules so you get accurate results without manual checks.

Worked examples

ExampleInputResult
IPv4 to hexIP address or hex value: 192.168.0.1Type: IPv4; IP address: 192.168.0.1; Hex (0x): 0xC0A80001; Dotted hex: C0.A8.00.01; Decimal: 3232235521
Hex to IPIP address or hex value: 0xC0A80001Type: IPv4; IP address: 192.168.0.1; Hex (0x): 0xC0A80001; Dotted hex: C0.A8.00.01; Decimal: 3232235521
Dotted hex inputIP address or hex value: C0.A8.00.01Type: IPv4; IP address: 192.168.0.1; Hex (0x): 0xC0A80001; Dotted hex: C0.A8.00.01; Decimal: 3232235521
Decimal integerIP address or hex value: 3232235521Type: IPv4; IP address: 192.168.0.1; Hex (0x): 0xC0A80001; Dotted hex: C0.A8.00.01; Decimal: 3232235521
IPv6 addressIP address or hex value: 2001:0db8:0000:0000:0000:0000:0000:0001Type: IPv6; IP address: 2001:db8::1; Full hex: 2001:0db8:0000:0000:0000:0000:0000:0001; Hex integer: 0x20010DB8000000000000000000000001

FAQ

How do I convert hex to IP?

Remove any 0x prefix, then split the remaining hex string into pairs of two characters. Convert each pair from base 16 to base 10 to get the four IPv4 octets. For example, 0xC0A80001 becomes C0, A8, 00, 01 which is 192.168.0.1.

What is the hex value of 10.0.0.1?

Each octet converts to two hex digits: 10 is 0A, 0 is 00, 0 is 00, and 1 is 01. Combined, the hex representation is 0x0A000001.

Can I convert an IPv6 address to hex?

Yes. IPv6 addresses are already written in hexadecimal. Expanding 2001:db8::1 gives 2001:0db8:0000:0000:0000:0000:0000:0001, which is the full 128-bit hex value.

How do I convert an IP address to decimal?

Treat the four octets as a 32-bit big-endian integer. Multiply the first octet by 16777216, the second by 65536, the third by 256, and add the fourth. For 192.168.0.1 the result is 3232235521.

Is dotted hex the same as prefixed hex?

They represent the same value but differ in formatting. Prefixed hex writes all eight digits together with a 0x prefix (0xC0A80001), while dotted hex separates each byte with periods (C0.A8.00.01).

Does this tool upload my IP address to a server?

No. All conversions happen locally in your browser using JavaScript. Your input never leaves your device.