IP to Binary and Hexadecimal Converter

Enter an IPv4 address and see each octet (and the full address) in decimal, binary and hexadecimal.

Why convert an IP

An IPv4 address is actually a 32-bit number — the dotted decimal notation (e.g. 192.168.1.1) is just a more human-readable way to represent that number, split into 4 groups of 8 bits (octets). Understanding the binary representation helps visualize how subnet masks and CIDR work.

How it's calculated

Each octet (0-255) is individually converted to binary (8 digits) and hexadecimal (2 digits), and the four binary/hexadecimal octets are also concatenated to show the full 32-bit address in each format.

Full example: 192.168.1.10

Octets 192, 168, 1 and 10 become 11000000, 10101000, 00000001 and 00001010. In hexadecimal they are C0, A8, 01 and 0A, giving C0A8010A, which as a plain integer equals 3,232,235,786. That integer is the form many databases and languages use to store an IPv4 in 4 bytes.

Where hexadecimal shows up

You will meet it in packet captures, firewall logs and low-level configuration, where 0xC0A8010A is more compact than 32 ones and zeros. When checking a value, remember each octet needs 2 hex digits: 1 is written 01, not 1.

A quick way to verify

To check a conversion in your head, remember that 128, 64, 32, 16, 8, 4, 2 and 1 are the weights of each bit in an octet. The number 10 is 8 plus 2, hence 00001010. Reading the binary string in groups of four, as 1100 0000, also gives hexadecimal C0 directly.

Leading zeros matter in binary: the octet 5 is 00000101, not 101, or the 32-bit string will be misaligned.

Frequently asked questions

Why does each octet only go up to 255?

Because each octet has 8 bits, and the largest value possible with 8 bits is 2⁸ - 1 = 255 (11111111 in binary).

Does this work for IPv6 too?

No — this tool is specific to IPv4 (32 bits, 4 octets). IPv6 addresses have 128 bits and are already normally represented in hexadecimal.