Lelifi·tools

IP Address Converter

Every IPv4 address is one 32-bit number. 192.168.1.1 is the integer 3,232,235,777, which is 0xC0A80101 in hex and 11000000 10101000 00000001 00000001 in binary, and the whole space runs from 0 to 4,294,967,295. Private blocks, loopback and broadcast all sit inside that range.

Paste an address in any of the four common spellings, or an IPv4-mapped IPv6 address, and every other form is printed at once.

Paste an address in dotted form, as an integer, in hex, in binary or as an IPv4-mapped IPv6 address, and read every other form with the octet arithmetic shown.

By the Lelifi editors ·

Key takeaways

192.168.1.1 as four weighted products1st octet: 192 x 16,777,216 = 3,221,225,4722nd octet: 168 x 65,536 = 11,010,0483rd octet: 1 x 256 = 2564th octet: 1 x 1 = 1= total 3,232,235,777 for 192.168.1.1Each octet is one digit in base 256, most significant octet first.
The four products are 3,221,225,472, 11,010,048, 256 and 1. Added in order they give 3,232,235,777, which is the integer form of 192.168.1.1.
Addresses in the three RFC 1918 private blocks16,777,21610/8 (16,777,216)172.16/12 (1,048,576)192.168/16 (65,536)
10/8 holds 16,777,216 addresses, 172.16/12 holds 1,048,576 and 192.168/16 holds 65,536, so each block is one sixteenth the size of the one before it.
On this page
  1. Four spellings of one 32-bit number
  2. The 32-bit place value table
  3. From integer back to dots
  4. Hex and binary group the same bits
  5. Private blocks and the integers they cover
  6. IPv4-mapped IPv6 addresses
  7. Four checks that catch a wrong conversion

Four spellings of one 32-bit number

An IPv4 address is 32 bits, and every notation is a way of grouping those bits. Dotted decimal cuts them into four 8-bit octets and writes each octet in base 10. Integer form reads all 32 bits as one base 10 number. Hex writes the same 32 bits as eight base 16 digits. Binary writes them one character per bit.

Take 8.8.8.8. Each octet is 8, so the integer is 8 x 16,777,216 + 8 x 65,536 + 8 x 256 + 8 = 134,744,072. In hex that is 0x08080808, and in binary it is 00001000 repeated four times.

The forms are not different addresses. They are one number in four costumes, and a converter is bookkeeping between them. Nothing about the address changes when the notation does, which is why a round trip through any two forms has to land back on the same value.

Two boundaries frame the whole space. The smallest address is 0, written 0.0.0.0. The largest is 4,294,967,295, written 255.255.255.255. That top value is one less than the count of addresses, 4,294,967,296, for the same reason a meter stick marked 0 to 100 has 101 marks.

The 32-bit place value table

Each octet owns eight bits, and each bit position has a fixed weight. The table reads from the most significant octet on the left to the least significant on the right, using 192.168.1.1 as the example.

OctetBitsWeightDigitProduct
1st31 to 2416,777,2161923,221,225,472
2nd23 to 1665,53616811,010,048
3rd15 to 82561256
4th7 to 0111
Total31 to 03,232,235,777

The four weights are powers of two: 16,777,216 is 2 to the 24th, 65,536 is 2 to the 16th, 256 is 2 to the 8th. Moving one octet to the left multiplies the weight by 256, for the same reason moving one digit left in base 10 multiplies by ten.

Inside a single octet the weights are the familiar 128, 64, 32, 16, 8, 4, 2 and 1. That is why no octet can pass 255: with all eight bits set the sum is 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1 = 255, and there is no ninth bit inside the octet to carry the next value.

Adding the four products for 192.168.1.1 gives 3,221,225,472 + 11,010,048 + 256 + 1 = 3,232,235,777. That sum is the whole conversion. Every other notation is a shortcut around it.

From integer back to dots

Going the other way takes three divisions, one per octet boundary. Divide the integer by 16,777,216: the quotient is the first octet and the remainder goes on to the next step. Divide that remainder by 65,536, then by 256, and whatever is left is the last octet.

For 3,232,235,777, dividing by 16,777,216 gives 192 with a remainder of 11,010,305. Dividing 11,010,305 by 65,536 gives 168 with a remainder of 257. Dividing 257 by 256 gives 1 with a remainder of 1. The quotients in order, plus that last remainder, spell 192.168.1.1.

StepDivide byQuotientRemainder
116,777,21619211,010,305
265,536168257
325611

Multiplying back checks the work: 192 x 16,777,216 = 3,221,225,472; 168 x 65,536 = 11,010,048; 1 x 256 = 256; 1 x 1 = 1. The four pieces add up to 3,232,235,777, the number you started with.

This is ordinary base conversion with 256 as the base, written most significant digit first. A number below 16,777,216 has a leading octet of 0, which is why small integers read as 0.x.x.x and why 0.0.0.0 comes out as 0.

Hex and binary group the same bits

Four bits make one hex digit, so 32 bits make exactly eight hex digits. Split a hex string into pairs and each pair is one octet, which turns hex to dotted into a lookup instead of arithmetic.

0xC0A80101 splits into C0, A8, 01 and 01. C0 is 12 x 16 + 0 = 192. A8 is 10 x 16 + 8 = 168, and 01 is 1. So the address is 192.168.1.1, with no division anywhere.

Binary is the same split one level down. The digit C is 1100 and 0 is 0000, so C0 is 11000000, which is 128 + 64, or 192. The digit A is 1010 and 8 is 1000, so A8 is 10101000, which is 128 + 32 + 8, or 168.

The ends of the range are worth memorizing. 0x00000000 is 0, and 0xFFFFFFFF is 4,294,967,295, since eight F digits are 32 set bits and 2 to the 32nd minus 1 is that number. A single F is 255, which is why 255.255.255.255 is 0xFFFFFFFF.

Case carries no meaning in hex: 0xc0a80101 and 0xC0A80101 are the same address. The 0x prefix is a marker that says the digits are base 16, and it is not part of the value. Some tools print the bare eight digits and expect you to know.

Private blocks and the integers they cover

RFC 1918, published in February 1996, reserves three blocks of the IPv4 space for private internets. Addresses inside them are not routed on the public internet, which is why a home router can hand out 192.168.1.50 to every household in the country without a conflict.

BlockDotted rangeInteger range
10/810.0.0.0 to 10.255.255.255167,772,160 to 184,549,375
172.16/12172.16.0.0 to 172.31.255.2552,886,729,728 to 2,887,778,303
192.168/16192.168.0.0 to 192.168.255.2553,232,235,520 to 3,232,301,055

The middle block catches people out because it starts at 16, not at 0. 172.15.255.255 is public, 172.16.0.0 is private, 172.31.255.255 is private, and 172.32.0.0 is public again. The reserved stretch is 172.16 through 172.31 in the second octet, sixteen values wide, and the integer range shows the same fact as one continuous band from 2,886,729,728 to 2,887,778,303.

Other reserved ranges matter when you read a routing table. The IANA IPv4 special-purpose registry (last updated October 2025) lists loopback 127.0.0.0/8 as 2,130,706,432 to 2,147,483,647, link-local 169.254.0.0/16 as 2,851,995,648 to 2,852,061,183, and documentation block 192.0.2.0/24 as 3,221,225,984 to 3,221,226,239. The limited broadcast address 255.255.255.255 is the top of the space, 4,294,967,295.

127.0.0.1, the address a laptop uses to reach itself, is 2,130,706,433. The slash notation comes from CIDR, defined in RFC 4632 in August 2006, where the number after the slash is a decimal from 0 to 32 giving the length of the prefix. Here it only names a block.

IPv4-mapped IPv6 addresses

An IPv6 address is 128 bits, written as eight groups of four hex digits. The IPv4-mapped form carries an IPv4 address in the low 32 bits and fills the other 96 with a fixed pattern: 80 zero bits, then 16 one bits, then the address. RFC 4291, section 2.5.5.2, from February 2006, defines that layout.

So 192.168.1.1 becomes ::ffff:c0a8:101. The groups c0a8 and 0101 are the hex of the four octets, written with leading zeros dropped, and the double colon stands for the run of zero groups. The full form, with nothing compressed, is 0000:0000:0000:0000:0000:ffff:c0a8:0101.

A second example shows the compression rule. 8.8.8.8 becomes ::ffff:808:808, because the group 0808 loses its leading zero when written in short form. Both spellings mean the same 128 bits, and a parser has to accept either.

An older layout, the IPv4-compatible address, used 96 zero bits with no ffff. RFC 4291 section 2.5.5.1 marks it deprecated, and new software is not required to support it. A mapped address is a convenience for APIs and sockets that speak only IPv6; it is not a routable IPv6 destination and is not sent across an IPv6 network as a way to reach an IPv4 host.

Four checks that catch a wrong conversion

Count the octets. A dotted address has exactly four numbers and three dots. A string with three numbers is not an address, and neither is one with five, no matter how plausible it looks in a log line.

Check the range. Every octet sits between 0 and 255, so 192.168.1.256 is not an address. That typo is common because 256 is a power of two that feels address-like, and a converter that accepts it is guessing at what you meant.

Watch leading zeros. 192.168.010.001 is read as octal by some parsers, which makes the third octet 8 instead of 10, and as plain decimal by others. Write 192.168.10.1 and the ambiguity disappears. The same trap sits in file modes and in any language that treats a leading zero as a base marker.

Add the place values. For 192.168.1.1 the total is 3,221,225,472 + 11,010,048 + 256 + 1 = 3,232,235,777. If that total disagrees with the integer you started from, one of the digits is wrong, and the disagreement usually points at a slip in one octet rather than at the base.

Pad hex instead of trimming it. 0x0A000001 is 10.0.0.1, and 0xA000001 is the same value with one padding zero dropped. Trim one more and 0xA00001 becomes a different address, 0.160.0.1, because the digits shift left into a heavier place value.

Frequently asked questions

What is 192.168.1.1 as an integer?

3,232,235,777. The four products are 192 x 16,777,216 = 3,221,225,472; 168 x 65,536 = 11,010,048; 1 x 256 = 256; 1 x 1 = 1. Those four add up to the integer.

What is the largest IPv4 address?

4,294,967,295, written 255.255.255.255, or 0xFFFFFFFF in hex, or 32 ones in binary. The space holds 4,294,967,296 addresses in total, because the count includes 0.

How do I turn 3,232,235,777 back into dots?

Divide by 16,777,216 to get 192 with 11,010,305 left over. Divide that by 65,536 to get 168 with 257 left. Divide 257 by 256 to get 1 with 1 left, and read 192.168.1.1.

What is 0xC0A80101 in dotted form?

192.168.1.1. Split the eight hex digits into pairs: C0, A8, 01 and 01. C0 is 12 x 16 + 0 = 192 and A8 is 10 x 16 + 8 = 168, so no division is needed.

Why can no octet be larger than 255?

An octet is eight bits, and eight set bits add up: 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1 = 255. Two to the 8th is 256, which counts the values 0 through 255, so 256 itself needs a ninth bit and does not fit.

Which ranges are private under RFC 1918?

Three: 10.0.0.0 to 10.255.255.255, 172.16.0.0 to 172.31.255.255 and 192.168.0.0 to 192.168.255.255. In integers those run 167,772,160 to 184,549,375, 2,886,729,728 to 2,887,778,303 and 3,232,235,520 to 3,232,301,055.

Is 172.20.5.4 a private address?

Yes. The RFC 1918 block runs from 172.16 through 172.31 in the second octet, and 20 sits inside that span. The integer 2,886,993,156 also falls inside the band from 2,886,729,728 to 2,887,778,303.

What does ::ffff:192.168.1.1 mean?

It is the IPv4-mapped IPv6 form of 192.168.1.1. The first 96 bits are 80 zeros then 16 ones, and the last 32 bits hold the IPv4 address, so the short form is ::ffff:c0a8:101 and the full form is 0000:0000:0000:0000:0000:ffff:c0a8:0101.

Can I route traffic to an IPv4-mapped IPv6 address?

No. The mapped form exists so that a program holding an IPv6 socket can keep an IPv4 peer in the same structure. It is not a destination on an IPv6 network, and RFC 4291 section 2.5.5.2 treats it as a representation, not a route.

How many hex digits does an IPv4 address need?

Eight, because 32 bits divided by four bits per hex digit is 8. Shorter strings are missing their padding zeros, and padding only changes the look: 0x0A000001 and 0xA000001 are both 10.0.0.1.

Why does 192.168.010.001 behave oddly?

Because some parsers read a leading zero as an octal marker, so 010 becomes 8 rather than 10. Others read it as plain decimal and get 10. The address 192.168.10.1 has no leading zero and no ambiguity.

Is 127.0.0.1 a public address?

No, it is the loopback address, and the whole 127.0.0.0/8 block is reserved for a machine talking to itself. As an integer, 127.0.0.1 is 2,130,706,433, and the block runs from 2,130,706,432 to 2,147,483,647.

What is 0.0.0.0 as a number?

Zero. All 32 bits are clear, so the integer is 0, the hex is 0x00000000, and the binary is 32 zeros. Routers use it to mean an unspecified address or a default route, depending on where it appears.

Spotted a wrong number or a broken result?

More Converters tools

See all Converters tools

Fee schedules, rates and rules change without notice. Always confirm important figures with the official source before you rely on them.