Convert IP address to hexadecimal
How to convert an IPv4 address to hexadecimal, when hex notation is useful, and the readability, copy/paste and compatibility limits to check first.
What an IP to hex conversion gives you
An IPv4 address can be written as one hexadecimal number instead of four decimal octets. Each octet is converted to a two-digit hex value, then the four pairs are combined. For example, the address 192.168.1.1 becomes C0.A8.01.01 in dotted hex notation and C0A80101 as a continuous eight-digit hex value.
This is a direct numeric conversion, not a visual styling effect. The underlying address does not change; only the notation changes from decimal octets to base-16. Hex notation is commonly used in logs, packet analysis, configuration formats and developer tools where a compact or uniform representation is easier to compare or store.
How the conversion works
Take each decimal octet from the dotted IPv4 address and convert it separately. Keep leading zeros so every octet becomes two hex characters. Then join the results with dots for dotted hex or without separators for a plain eight-character hex string.
192.168.1.1
192 -> C0
168 -> A8
1 -> 01
1 -> 01
Dotted hex: C0.A8.01.01
Continuous: C0A80101
Leading zeros are required in each two-digit pair. If a value is written with a single hex digit, the result loses octet alignment and may be interpreted incorrectly.
Readability and copy/paste limits
A continuous hex string is compact but harder for people to read than dotted decimal. Dotted hex notation keeps the octet boundaries visible, which helps when you need to check or compare one part of an address manually.
Whether hex notation survives copy and paste depends on the destination. A text field accepts the characters, but that does not mean the receiving system will parse it as an IP address. Many network tools, operating system settings and web forms expect standard dotted decimal and will reject or misinterpret hex notation even though it represents the same address.
Accessibility tools generally read hex notation as letters and numbers rather than as an address. A screen reader may announce C0A80101 as a string of characters instead of an IP address, which can make verbal confirmation or troubleshooting harder. Standard dotted decimal is usually the safer choice when another person must read or repeat the value.
When to avoid hex notation
Use ordinary dotted decimal for end-user configuration, support tickets, shared documentation and any interface that validates IPv4 input. Use hex notation only when the destination format explicitly requires or accepts it, such as a specific log parser, packet export or codebase convention.
If the conversion is performed by a third-party tool, avoid pasting addresses that identify internal infrastructure or production systems. The conversion output itself is not sensitive beyond the address, but an unknown service may store or log submitted input. For private or regulated network data, convert locally using a short script or manual octet table instead.
A practical manual method
For occasional conversions, use a printed or on-screen decimal-to-hex table for values 0 through 255. Convert each octet independently, pad each result to two digits, then join the values in the original order. This avoids dependence on an online converter and makes it easy to preserve leading zeros.
If documentation for a destination system does not clearly state that hex IPv4 input is supported, assume it is not. The absence of documented support means the behavior is uncertain, and testing is not a substitute for knowing the expected format.