🔢 IP to Binary/Hex Converter

Enter an IPv4 address to see its binary (per-octet and full 32-bit), hexadecimal and decimal integer forms.

One number, four notations

Each octet is converted on its own to base 2 and base 16 and padded to a fixed width, then the whole address is rebuilt as a single 32-bit value by weighting the octets:

binary  = each octet in base 2,  padded to 8 digits
hex     = each octet in base 16, padded to 2 digits
decimal = o1x16777216 + o2x65536 + o3x256 + o4

The default 192.168.1.1 comes back as 11000000.10101000.00000001.00000001, C0.A8.01.01 and 3,232,235,777. Those weights are just 2^24, 2^16 and 2^8 - the same as shifting each octet into place, but done with multiplication so the top octet cannot tip a signed 32-bit value negative, which is the usual way this conversion goes wrong in code.

Where each form gets used

The hex row is dotted per octet for readability. Systems that want one hex literal expect the octets run together, so C0.A8.01.01 becomes 0xC0A80101.

Frequently asked questions

What is 192.168.1.1 in binary?

11000000.10101000.00000001.00000001. Each octet becomes eight digits, padded with leading zeros so the 32 bits always line up in columns.

What is 192.168.1.1 as a decimal number?

3,232,235,777. Multiply the octets by 16,777,216, 65,536, 256 and 1 and add them: 3,221,225,472 + 11,010,048 + 256 + 1.

How do I convert an IP address to hexadecimal?

Convert each octet separately and pad it to two digits. 192 is C0, 168 is A8, and 1 is 01, giving C0A80101 for the whole address.