IP Address to Hex Converter
IP Address to Hex Converter. Type your address into IPv4 Address Input and the IP Address to Hex Converter instantly returns its Hex Output. Engineers working with legacy digital displays or clock chips can rely on the bcd to decimal converter to verify nibble-by-nibble decoding.
Need to see a dot-separated address the way a packet header stores it? The IP address to hex converter turns an IPv4 address such as 203.0.113.77 into CB.00.71.4D (0xCB00714D) by writing each octet as two hexadecimal digits, so you can paste the result straight into a firewall configuration, a test case or a protocol dissector. It is a free online utility with no ads in the way: enter the address, click Convert and read the result.
How the IP Address to Hex Converter Works
An address on the Internet Protocol is a 32-bit number written as four decimal groups, and every group is an 8-bit value from 0 to 255. Hexadecimal, also called base-16 or the hexadecimal base, uses the digits 0-9 and the letters A-F. Because one hex digit holds exactly four bits, a single number between 0 and 255 always fits into exactly two hex digits. That is why an ip to hex conversion is clean and lossless: nothing is rounded, and nothing carries over between neighbouring parts. When you need uppercase A-F letters in your hex output, the binary to hex converter has a toggle built in for that.
The tool splits your input at the dots, converts each part separately, pads a single digit with a leading zero, and joins the four pairs. The output is the hex IP address in dot-separated form, and the same digits without dots carry the 0x prefix when you need one single number. A web developer, a network engineer or any programmer can then compare that hexadecimal IP value with raw packet bytes without converting in their head.
The IP to hexadecimal formula
For an address with parts \(o_1.o_2.o_3.o_4\), the hexadecimal notation is the concatenation of the four converted values:
$$\text{hex IP} = \text{hex}(o_1)\;\text{hex}(o_2)\;\text{hex}(o_3)\;\text{hex}(o_4)$$Every number is split into a high and a low hex digit by dividing by 16:
$$\text{hex}(o) = d_{high}\,d_{low}, \quad d_{high} = \lfloor o \div 16 \rfloor, \quad d_{low} = o \bmod 16$$If you also want the single decimal integer behind the same address, weight the four numbers by powers of 256:
$$N = o_1 \times 256^{3} + o_2 \times 256^{2} + o_3 \times 256 + o_4$$Why the numeric precision is exact
Each conversion works on whole numbers, so the numeric precision is exact: there are no decimals to round. The representation changes, but the 32 bits stay identical, which is what makes the result trustworthy as an example in documentation and as a test value.
IP Address to Hex Conversion Step by Step
Here is a step-by-step walk through the ip address to hexadecimal conversion for 203.0.113.77, an address from a range reserved by IANA for documentation, so it is safe to publish.
- Split the address into four numbers: 203, 0, 113, 77.
- Divide each by 16: 203 = 12 × 16 + 11 (C and B), 0 = 0 × 16 + 0 (0 and 0), 113 = 7 × 16 + 1 (7 and 1), 77 = 4 × 16 + 13 (4 and D).
- Write each pair as two hex digits: CB, 00, 71, 4D.
- Join them: CB.00.71.4D with separators, or 0xCB00714D as one number.
The same address in binary is 11001011 00000000 01110001 01001101, and as one decimal integer it is 203 × 16,777,216 + 0 × 65,536 + 113 × 256 + 77 = 3,405,803,853. Hex, binary and decimal describe the identical bits; only the way they are written differs.
Hex IP Address Formats You Will See
There is more than one valid hex format, so check which style the system you are feeding expects. A converter with options lets you convert the same input into any of the styles below, each of which is a different hexadecimal form of one address. Developers converting a legacy stylesheet to Tailwind can look up each color's nearest class with the hex to tailwind converter.
| Style | Output for 203.0.113.77 | Typical use |
|---|---|---|
| Dotted hex, padded | CB.00.71.4D | Readable, one pair per part |
| Dotted hex, unpadded | CB.0.71.4D | Some parsers accept it, many reject it |
| Single number with prefix | 0xCB00714D | Code, ping tests, URL parsers |
| Plain hex string | CB00714D | Protocol dumps, config files |
| Custom separator | CB:00:71:4D | Log formats that avoid dots |
The padding choice matters: with it, the string always has eight characters and you can slice it back into its four ip-part values without guessing. Pick the separator your target system expects, or leave it out to get one continuous value.
Convert IP to Hexadecimal: Reference Values
These results come straight from the formula above, so you can use them to check the converter or a script of your own. The binary column shows why the pairs line up so neatly: each group of eight bits becomes one pair.
| Address | Hexadecimal | Binary |
|---|---|---|
| 10.20.30.40 | 0x0A141E28 | 00001010 00010100 00011110 00101000 |
| 172.31.255.9 | 0xAC1FFF09 | 10101100 00011111 11111111 00001001 |
| 100.64.8.250 | 0x644008FA | 01100100 01000000 00001000 11111010 |
| 169.254.17.3 | 0xA9FE1103 | 10101001 11111110 00010001 00000011 |
Notice how 10 becomes 0A, not A. A wrongly unpadded string such as 0xA141E28 is seven digits long and reads as a completely different number. The first two rows sit inside a private network range, and you can convert any of them the same way.
Checking a Webhook Filter with Hex IP Addresses
A QA engineer is reviewing a webhook settings form that rejects any destination whose host is on a blocklist. The staging blocklist contains 198.51.100.214, an address from the 198.51.100.0/24 documentation block that RFC 5737 sets aside for examples, so nothing real is at risk. The test question is simple: does the filter block that host only when it is typed in the familiar dotted form, or does it recognise every spelling of the same address?
The engineer opens the converter, enters 198.51.100.214 and clicks Convert. The tool splits the address into 198, 51, 100 and 214, converts them to C6, 33, 64 and D6, and returns C6.33.64.D6 with the single-number form 0xC63364D6. Switching the output to an integer gives 3,325,256,918, which comes from 198 × 16,777,216 + 51 × 65,536 + 100 × 256 + 214.
Three test submissions follow. The dotted string is blocked, as expected. The value 0xC63364D6 is accepted, and so is 3325256918, because the validator compares raw text against the blocklist without turning the entry into a number first. Both accepted forms resolve to the same host as 198.51.100.214 in a ping test, so this is a genuine filter bypass, not a quirk of the staging server.
The ticket the engineer files names the exact fix: parse every host into one 32-bit integer before comparing it with the blocklist, then rerun the same three submissions plus the unpadded form C6.33.64.D6. All four must return the same rejection. That small hexadecimal IP conversion turned a vague worry about the filter into a reproducible test case with exact inputs and an exact expected result.
Where an IP to Hex Converter Helps Developers
People convert an address to hex for a handful of recurring reasons, all of which come back to networking and programming work:
- Network packets and IP headers: a capture shows the source and destination fields as raw hex, so convert the address first and then search for it.
- Firewall configuration and routing tables: some appliances and embedded systems store addresses as hexadecimal values, and a router or other device may print them that way in logs.
- Cross-browser testing and ip checkers: a form may validate only the decimal form, yet
ping 0xCB00714Dreaches the same host, so testers compare both notations. A proxy or filter that blocks only the decimal string can miss the hex spelling. - Bitwise work: a bitwise AND of a hex value with a subnet mask is easier to read at the byte-level than in decimal.
Doing it in code
Web developers and programmers can reproduce the converter in JavaScript with Number(part).toString(16).padStart(2, "0") for each part, then join the results. The converter is a quick way to verify that such code is correct before you ship it, and the hex string is the same shape that low-level machine code and protocol parsers read.
Common Mistakes When You Convert an IP to Hex
Most wrong answers come from a few repeatable slips, and each is easy to catch once you know it. Before you convert a batch of addresses, run through this short list:
- Dropping the leading zero: converting 8 to 8 instead of 08 shortens the string, and every pair after it shifts out of place.
- Reading letters as decimal: A to F stand for 10 to 15, so 0x1F is 31 and not 1 followed by F.
- Converting the whole address at once: convert each part on its own, never the digits of the dotted string as a single number.
- Mixing up the order: keep the leftmost part first, the same order a packet uses on the wire.
When you convert a value and the result looks odd, convert it back and confirm you land on the starting address. A round trip that returns the original numbers proves the pairs, the padding and the order are all correct.
IPv4 vs IPv6 in Hexadecimal
This page covers IPv4. An IPv6 address already is hexadecimal: it uses 128-bit values written as eight groups of four hex digits, such as 2001:db8::1, so there is nothing to convert. If you see a hex value with exactly eight digits, it is almost certainly a valid IPv4 address in disguise. A mapped form such as ::ffff:cb00:714d simply carries the same four bytes inside an IPv6 wrapper.
Using the Converter on a Batch of Addresses
Real work rarely involves one address. Say you export a short list of hosts from a log and need to convert every entry before searching a hex dump. Paste the first address, click Convert, copy the result, and repeat; an ip to hex converter that keeps your padding and separator settings between runs makes the list quick to finish. Convert the addresses in the order they appear, so the output lines match the input lines one for one and you can diff the two columns later.
It also helps to convert a known value first. Run 100.64.8.250, confirm you get 0x644008FA, and only then trust the output for the rest of the list. If you plan to convert hundreds of rows, the same formula fits in a spreadsheet or a script, and the converter becomes your reference for checking a handful of rows by hand. Whichever route you take, convert a few values both ways and compare the numbers before you rely on the output.
Reverse Direction: Hex to IP Converter and Octal Conversions
To go back, split the eight digits into four pairs and convert each pair to decimal. That is the hex to ip direction, and 0xCB00714D returns 203.0.113.77. A hex to ip converter does this in one click. Each of these starts from the same 32 bits the converter above reads, so they are useful checks on its output. Network engineers also chain related number base conversions: hex to decimal for the integer form, decimal to hex when writing constants, hex to binary when reading masks bit by bit, binary to hex for compact notes, and hex to octal for legacy systems that still print octal values. Octal groups bits in threes, so an octal value of the same address looks nothing like the hex one, and a Base64 string of the four bytes is yet another encoding of it.
Fixing an invalid IP error
If the converter shows an error, check that you entered exactly four numbers separated by dots, that every number is between 0 and 255, and that there are no spaces or stray characters. An entry like 256.10.4.2 fails because 256 does not fit in 8 bits, and 10.4.2 fails because it has only three numbers.
Choosing between conversion tools
A simple ip to hexadecimal converter is enough for one address. If you routinely convert lists of addresses, look for a tool that accepts several lines at once, lets you convert ip to hex with and without separators, and keeps the work in your browser. The ip address to hexadecimal conversion itself never changes; only the output options do, and a good converter shows its steps so you can check the arithmetic.