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. |
Enter either the dotted IPv4 address or the decimal integer to convert in
either direction. Hexadecimal integers are also supported with 0x, and binary
integers with 0b.
How input is detected
In automatic mode, four dotted octets are interpreted as IPv4, an input with
0x as hexadecimal, and an input with 0b as binary. An input without dots or
a prefix is interpreted as a decimal integer.
You can also select the format explicitly. A prefix that does not match the selected base produces a validation error.
How to convert an IPv4 to an integer
Dotted decimal notation separates the integer into four bytes, from most
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. Values within this interval also
display a dotted IPv4 representation.
Negative numbers and values greater than 4294967295 can still be converted
between decimal, hexadecimal and binary, but do not produce an IPv4 address.
The general number conversion uses BigInt, so an integer like
18446744073709551615 is transformed exactly into 0xFFFFFFFFFFFFFFFF and into
64 binary ones.
Presentation and copy
For IPv4 input, hexadecimal output is padded to eight digits and binary output is displayed as four eight-bit octets. For general number conversion, grouping spaces are only a visual aid. Copy buttons 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.
Edge cases
- Integer inputs
0,-0and+000are normalized to0. 0.0.0.0and255.255.255.255cover both ends of the IPv4 space.- Negative values retain their 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 a decimal octet the same as the complete IPv4 integer?
No. In 192.168.1.1, each octet is already written in decimal, but the complete
IPv4 integer 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
into four octets and displays the normalized address.
Why doesn’t a negative integer produce an IPv4?
IPv4 uses 32 unsigned bits. Negative integers are valid for general conversion between bases, but do not represent an IPv4 address.
Is the negative result in two’s complement?
No. Negative output uses a sign, for example -0x2A. A two’s complement
representation requires a specific word width, which this tool does not assume.
Is the entered address or number saved?
No. Input and results remain in the current tab and are not persisted by the tool.
Reviewed on by Tools in a Tab.