32 bits · 4 octets
Tool
IPv4 and number base converter
Convert IPv4 and integers between decimal, hexadecimal and binary with exact precision right in your browser.
Your data is processed locally in your browser and is not sent to our servers.
Enter an integer or IPv4 address to get its representations.
Decimal input
Results
Spaces only improve readability. Copying returns the canonical value without spaces.
Base 10
Decimal
Base 16
Hexadecimal
Base 2
Binary
Verifiable example
An IPv4 address is a 32-bit unsigned integer divided into four octets. These four expressions represent exactly the same value:
| Format | Result |
|---|---|
| IPv4 | 192.168.1.1 |
| Decimal | 3232235777 |
| Hexadecimal | 0xC0A80101 |
| IPv4 Binary | 11000000. |
You can enter any of the first two ways to convert into
both directions. Hexadecimal integers are also supported with 0x and binary
with 0b.
How input is detected
In automatic mode, an entry with four octets is interpreted as IPv4,
one entry with 0x as hexadecimal and one entry with 0b as binary. Without
points or prefix is interpreted as a decimal integer.
You can also select the format explicitly. A prefix that does not matches the selected base generates an error instead of producing a unexpected result.
How to convert an IPv4 to an integer
Dotted decimal notation separates the integer into four bytes, from the
significant to least significant. For 192.168.1.1, the calculation is:
192 × 256³ + 168 × 256² + 1 × 256 + 1 = 3232235777
RFC 1208 describes this notation as four 8-bit numbers representing a 32-bit integer. The tool exclusively supports four decimal octets between 0 and 255, according to the standard form defined by the RFC 3986.
IPv4 range and large integers
The IPv4 space ranges from 0.0.0.0, equivalent to 0, to
255.255.255.255, equivalent to 4294967295. Within that interval appears
the fourth IPv4 representation.
Numbers negative or greater than 4294967295 continue to convert between
decimal, hexadecimal and binary, but they do not generate a made-up address. The
General conversion uses BigInt, so an integer like
18446744073709551615 is transformed exactly into 0xFFFFFFFFFFFFFFFF and into
64 binary ones.
Presentation and copy
When the entry is an IPv4, the hexadecimal is padded to eight digits and binary is presented as four octets of eight bits. in a conversion general numeric, spaces only facilitate reading. The copy buttons they return canonical values without those decorative spaces.
Common errors
- An IPv4 must contain exactly four octets between
0and255. - Abbreviations such as
127.1and empty octets are not supported. - Leading zeros such as
192.168.001.1are rejected to avoid ambiguous interpretations. - In automatic mode, write
0xFFinstead ofFFto indicate hexadecimal. - A binary input can only contain
0and1. - Fractions, exponents or separators within an integer are not allowed.
- A
+or-sign must appear only once and at the beginning of an integer.
Borderline cases
0,-0and+000are normalized as integer to0.0.0.0.0and255.255.255.255cover both ends of the IPv4 space.- Negative values retain the sign in all three number bases and do not display IPv4.
- Leading zeros are valid in integers, but not within an IPv4 octet.
- Numeric entry is limited to 4,096 digits to protect the responsiveness of the tab.
- The tool converts representations; it does not determine whether an address is public, private, or routable.
Frequently asked questions
Is the decimal of each octet the same as the IPv4 integer?
No. In 192.168.1.1, each octet is already written in decimal, but the integer
IPv4 combines all 32 bits and produces 3232235777.
Can I convert a decimal integer back to an IP?
Yes, as long as it is between 0 and 4294967295. The tool divides the value
in four octets and displays the normalized address.
Why doesn’t a negative integer produce an IPv4?
IPv4 space uses 32 unsigned bits. The negatives are valid for the general conversion between bases, but do not identify an IPv4 address.
Is the negative result in two’s complement?
No. It is shown with a sign, for example -0x2A. Two’s complement depends on
Choose a specific word width.
Is the entered address or number saved?
No. Entry and results remain in the current tab and disappear when reloading or closing the page.
Reviewed on by Tools in a Tab.