IP address to binary converter

Type an IPv4 address to see it as 32 bits, a single integer and hex. Edit any field to convert the other way.

How to convert an IP to binary

Convert each of the four octets to an 8-bit binary number, padding with leading zeros. 192 = 11000000, 168 = 10101000, 1 = 00000001.

192.168.1.1 → 11000000.10101000.00000001.00000001

As one integer: 192 × 224 + 168 × 216 + 1 × 28 + 1 = 3,232,235,777.

Octet values

DecimalBinaryMask meaning
0000000000 leading 1-bits
128100000001 leading 1-bits
192110000002 leading 1-bits
224111000003 leading 1-bits
240111100004 leading 1-bits
248111110005 leading 1-bits
252111111006 leading 1-bits
254111111107 leading 1-bits
255111111118 leading 1-bits

Frequently asked questions

Why are subnet mask octets always 0, 128, 192…255?
A mask is a run of 1-bits followed by 0-bits, so each octet can only be one of the nine values in the table.
Does it support IPv6?
Not yet; IPv6 addresses are 128 bits and are written in hex already.