IP Address to Binary

Convert IPv4 addresses to binary octets and binary back to IP

What is it and how does it work?

An IPv4 address is a 32-bit number, conventionally written as four decimal octets: 192.168.1.1. Each octet represents 8 bits, so the full address in binary is four 8-bit groups: 11000000.10101000.00000001.00000001. Understanding the binary representation is essential for subnet calculations — subnet masks in binary are contiguous 1s followed by contiguous 0s (e.g., /24 = 11111111.11111111.11111111.00000000), and the bitwise AND of an IP with its subnet mask gives the network address.

This tool converts IPv4 addresses to binary, hexadecimal, and integer representations, and vice versa. It also shows the bitwise operations for subnet masking (network address and broadcast address), performs bitwise AND/OR/XOR on two IP addresses, and visualises the network/host boundary for a given CIDR prefix length.

Common use cases

Frequently asked questions

How do you convert an IPv4 address to binary?

Split the IPv4 address into four decimal octets. Convert each octet to 8-bit binary (pad with leading zeros if needed): 192 = 11000000, 168 = 10101000, 1 = 00000001, 1 = 00000001. Join with dots: 11000000.10101000.00000001.00000001. As a 32-bit integer without dots: 11000000101010000000000100000001 = 3,232,235,777 decimal = C0A80101 hexadecimal.

What is a subnet mask in binary?

A subnet mask in binary is a sequence of contiguous 1 bits followed by contiguous 0 bits. The number of 1 bits is the CIDR prefix length. /24 mask = 11111111.11111111.11111111.00000000 = 255.255.255.0. The 1 bits identify the network portion; the 0 bits identify the host portion. Network address = IP AND mask; Broadcast address = IP OR (NOT mask).

What is the difference between IPv4 and IPv6 in binary?

IPv4 is 32 bits (4 bytes), written as four 8-bit decimal octets. IPv6 is 128 bits (16 bytes), written as eight 16-bit hexadecimal groups: 2001:0db8:85a3:0000:0000:8a2e:0370:7334. In binary, IPv6 is 128 binary digits — the same subnet masking logic applies but with a 128-bit mask and 128-bit bitwise operations. This gives 2¹²⁸ ≈ 3.4 × 10³⁸ possible addresses (vs 2³² ≈ 4.3 billion for IPv4).

What are the private IP address ranges in binary?

RFC 1918 private ranges: 10.0.0.0/8 (10.00000000.00000000.00000000 – 10.11111111.11111111.11111111), 172.16.0.0/12 (172.0001xxxx.xxxxxxxx.xxxxxxxx), 192.168.0.0/16 (192.168.xxxxxxxx.xxxxxxxx). Special: 127.0.0.0/8 (loopback), 169.254.0.0/16 (link-local/APIPA), 0.0.0.0/8 (current network), 255.255.255.255 (broadcast).

Network

Subnet Calculator · URL Builder · Query String Parser · MIME Type Finder · HTTP Header Builder · Common Ports Reference