IP Address to Decimal Converter – IPv4 to 32-Bit Integer

IP Address to Decimal Converter

Turn a dotted IPv4 address into a single 32-bit decimal integer using o1 times 16777216 plus o2 times 65536 plus o3 times 256 plus o4, or reverse an integer back to dotted quad. Every result also shows the padded hexadecimal and octal forms that databases, GeoIP lookups, and some URLs store.

🔄Choose a Direction

🎯Real IP Address Presets

📝Conversion Inputs

Four octets o1.o2.o3.o4, most significant on the left.

Single unsigned integer packing all four octets.

Accepts an optional 0x prefix, for example 0xC0A80101.

Toggles the padded 8-digit hex card and rows.

Base-8 form of the same 32-bit integer.

Display case for output hex only.

Thousands separators on the decimal card.

32-Bit Decimal Integer 0 single unsigned number
Dotted Quad IPv4 0.0.0.0 o1.o2.o3.o4 notation
Hexadecimal 00000000 padded to 8 digits
Octal 0 base-8 of the integer

🔢Place-Value Snapshot

2^24Octet 1 x 16777216
2^16Octet 2 x 65536
2^8Octet 3 x 256
2^0Octet 4 x 1

📏Octet Place-Value Multipliers

Octet PositionPower of TwoMultiplierRange of Contribution
Octet 1 (leftmost)2^24167772160 to 4278190080
Octet 22^16655360 to 16711680
Octet 32^82560 to 65280
Octet 4 (rightmost)2^010 to 255

📊Sample IP to Integer Conversions

IP AddressDecimal IntegerHexadecimalMeaning
0.0.0.0000000000Unspecified / any
10.0.0.11677721610A000001Private class A
127.0.0.121307064337F000001Loopback
172.16.0.12886729729AC100001Private class B
192.168.1.13232235777C0A80101Home router
8.8.8.813474407208080808Google DNS
255.255.255.04294967040FFFFFF00/24 subnet mask
255.255.255.2554294967295FFFFFFFFBroadcast / max

🛠Why the Integer Form Is Used

Use CaseStores AsBenefit
GeoIP range lookupsInteger start and endSimple BETWEEN comparison
Database indexingUnsigned 32-bit column4 bytes, fast sorting
Access control listsInteger plus maskBitwise subnet checks
Legacy URLsSingle decimal numberhttp://2130706433 resolves
Sorting and dedupNumeric keyNatural ascending order
Compact loggingOne number per rowLess storage than text

🗃Representation Comparison Grid

Dotted IPDecimal IntegerHex (8 digit)Octet BytesOctalTypical Use
0.0.0.00000000000.0.0.00Any address
10.0.0.11677721610A00000110.0.0.11200000001Private A
127.0.0.121307064337F000001127.0.0.117700000001Loopback
192.168.0.13232235521C0A80001192.168.0.130052000001Gateway
192.168.1.13232235777C0A80101192.168.1.130052000401Home router
8.8.8.8134744072080808088.8.8.81002004010Public DNS
172.16.0.12886729729AC100001172.16.0.125404000001Private B
255.255.255.2554294967295FFFFFFFF255.255.255.25537777777777Broadcast

Formula Breakdown

Integer = o1*16777216 + o2*65536 + o3*256 + o4Each octet is weighted by its byte position. For 192.168.1.1 that is 192*16777216 + 168*65536 + 1*256 + 1 = 3232235777.
Octet 1 = floor(int / 16777216) mod 256To reverse, peel off the top byte. floor(3232235777 / 16777216) mod 256 = 192.
Octet 2 = floor(int / 65536) mod 256Next byte down. floor(3232235777 / 65536) mod 256 = 168.
Octet 3 = floor(int / 256) mod 256Third byte. floor(3232235777 / 256) mod 256 = 1.
Octet 4 = int mod 256Lowest byte is simply the remainder. 3232235777 mod 256 = 1.
Hexadecimal = int in base 16, padded to 83232235777 becomes C0A80101, where each pair of hex digits equals one octet.
Range = 0 to 4294967295A 32-bit unsigned value spans 2^32 total addresses, from 0.0.0.0 up to 255.255.255.255.

💡Conversion Accuracy Tips

Keep octets in 0 to 255: Each octet is one byte, so it can only hold 256 distinct values from 0 through 255. Entering 256 or higher is invalid IPv4 and would overflow into the next byte. This calculator clamps out-of-range octets so the packed integer never exceeds the true 32-bit maximum of 4294967295.
Mind the 32-bit ceiling: The full address space is 2^32, or 4294967296 total combinations numbered 0 to 4294967295. If you convert an integer, values above 4294967295 cannot map to a valid IPv4 address. Hex always pads to 8 digits because 8 hex digits times 4 bits each equal exactly 32 bits.

When you type 192.168.1.1 into your browser, it works. But if you were to try to pass that exact same address into a database query it would feel clunky. While dotted notation makes it easy for humans to read an IP address underneath the hood, all the servers and routers is working with raw numbers. Those dots are actualy just a way to represent a single 32-bit integer. Routers and server know exactly what that number is immediately without having to parse punctuation.

To talk to lower-level layers of the network requires being able to translate back and forth between these two forms. Rather than have to do coefficient calculations yourself, the calculator will do it for you once you input individual octets. It’ll demonstrate how the individual part come together to form one long string of digits. An IPv4 address are made up of four bytes (also known as octets), each ranging from 0-255, separated by periods. Those four byte form 32 bits of information. That means there’s approximately 4.3 billion different possible values in total.

How IP Addresses Work Inside Computers

Represented as text, that becomes an issue for index and sort operations. It’s not clear at first glance whether 192.168.0.1 > 9.9.9.9, for instance, but the numerical difference are apparent. Representing the number as a single integer reestablishes the intuitive order. As explained based off the tool, this is because of how numbers are weighted, the left-most octet is most significant.

If you’re working with geolocation tables or log files, this kind of nuance can be important. Base-256 arithmetic is used in the conversion. Imagine this as how we count coins; each type of coin has a specific value. In this case, first octet holds the highest-value position, so it’s 16.7 million times what that octet is. The second is roughly 65 thousand times its value and the third is multiplied by 256. Finally, the fourth just gets added straight on.

Summing up those weighted values produces resulting integer. So if your router were set to 192.168.1.1, then the total would of be 3,232,235,777. These multipliers aren’t things you should memorize, but they explains why adjusting the first number will affect the total more than adjusting the last. To reverse this process we divide and use modulo to pull out the bytes, starting at the last byte on the right.

The reason this works is because binary data have a rigid format: each group of 8 bits (octets) forms a byte and there are exactly two hex digits per octet. In the converter, you can see hexadecimal representation, which is helpful when reversing the process because every two hex digits represent one octet. For example, C0A80101 allows an engineer to spot the network and host portions immediately, whereas the decimal integer might appear to be gibberish. Although systems tend to keep data in form of integers, hexadecimal is still commonly used for debugging due to its visual readability.

For example, it’s why this integer format are used practically in moddern systems. Country blocks are represented by both an integer start and end value in GeoIP databases which makes finding your location trivial without having to parse out strings. Bitwise math on these integers allow for efficient checks of whether subnets is inside access control lists. And some old web protocols just took raw numbers directly from URL bar (though not many people know about that anymore).

The page has a nice table of reference with various representations of commonly known addresses in decimal, hexadecimal, octal, and dotted formats. It illustrates how different systems represents the exact same data. An IP address is an example of converting between human understanding and machine efficiency. The dotted format let humans memorize DNS servers, gateway addresses, etc., while integer format lets computers do quick calculations on ranges to sort traffic.

Being familiar with both forms provide insight into what’s happening when traffic flows across networks. It transforms what would be an ordinary string of numbers into a plain picture of binary logic. You type in 192.168.1.1 at the keyboard and there’s your website, only now you know what all those numbers mean after they leaves your fingers.

IP Address to Decimal Converter – IPv4 to 32-Bit Integer