IP Base Converter
Convert an IPv4 address between dotted-decimal, integer, hex and binary.
Results are provided as is, for general information. Check anything important before relying on it. See the Terms of Use.
About this tool
An IPv4 address is really a single 32-bit number; the familiar dotted-decimal form is just one way to write it. Paste an address in any of four shapes — dotted-decimal (192.168.1.1), a plain 32-bit integer (3232235777), hex (0xC0A80101 or a bare 8-digit C0A80101), or binary (32 bits, or four dotted binary octets) — and the tool detects the shape, validates that the value fits in 0–4294967295, and shows all of the representations at once, plus the reverse-DNS name (1.1.168.192.in-addr.arpa). Everything runs in your browser.
How it works
Integer = a × 256³ + b × 256² + c × 256 + d Hex = each octet as two hex digits Reverse DNS = octets in reverse order + .in-addr.arpa
A dotted IPv4 address is just four bytes, so it is really one 32-bit number written in base 256. Converting it to an integer, hex or binary shows the same value in a different base.
| Question | Working | Answer |
|---|---|---|
| Convert 192.168.1.1 to an integer, hex and binary | 192 × 256³ + 168 × 256² + 1 × 256 + 1 | 3232235777 = 0xC0A80101 = 11000000 10101000 00000001 00000001 |
| What is the reverse DNS name for 192.168.1.1? | reverse the four octets | 1.1.168.192.in-addr.arpa |
When to use it
Questions
How does it tell hex from decimal for a bare number?
By shape. A 0x prefix is always hex; 32 binary digits are binary; an 8-character string that contains a–f is hex; anything that is all decimal digits is read as a decimal integer. So 3232235777 is decimal and C0A80101 is hex, but an all-digit 8-character string is treated as decimal — prefix it with 0x if you meant hex.
What is the in-addr.arpa value for?
It is the name used for reverse DNS: a PTR lookup for 192.168.1.1 queries 1.1.168.192.in-addr.arpa. The octets are reversed because DNS names get more specific right to left.
Does it handle IPv6?
No. This tool is IPv4 only — the value must fit in 32 bits. IPv6 uses 128-bit addresses and a different text format (and ip6.arpa for reverse DNS).