Binary to IP Converter
Convert 32-bit binary numbers to IPv4 addresses instantly. Supports dotted binary, continuous binary, and CIDR notation with real-time validation.
About
Every IPv4 address is a 32-bit unsigned integer split into four 8-bit octets. Misreading a single bit in a subnet mask or ACL rule can route traffic to the wrong network segment or expose hosts to unauthorized access. This tool converts raw binary notation - dotted (11000000.10101000.00000001.00000001), continuous (11000000101010000000000100000001), or space-separated - into standard dotted-decimal IPv4 format. It validates that each octet falls within the range 00000000 to 11111111 (decimal 0 - 255) and flags malformed input before you paste it into a firewall rule.
The converter also operates in reverse: enter a decimal IP and retrieve its binary representation. CIDR prefix lengths (/24, /16) are preserved through conversion. Note: this tool handles IPv4 only. IPv6 uses 128-bit addresses with hexadecimal notation, which requires a different parsing strategy.
Formulas
An IPv4 address is a 32-bit value partitioned into 4 octets. Each octet is an 8-bit binary number converted to its decimal equivalent independently.
Where D is the decimal value of one octet, bi is the bit at position i (counting from the right, starting at 0), and the sum runs over all 8 bit positions.
The full IPv4 address is reconstructed by joining four such decimal values with dots:
For the reverse (decimal to binary), each octet D is converted via successive division by 2, collecting remainders right-to-left, then zero-padded to 8 digits:
Where D ∈ [0, 255] and the result is a string of exactly 8 characters from the set {0, 1}.
Reference Data
| CIDR Prefix | Subnet Mask (Decimal) | Subnet Mask (Binary) | Usable Hosts | Network Class |
|---|---|---|---|---|
| /32 | 255.255.255.255 | 11111111.11111111.11111111.11111111 | 1 | Host |
| /31 | 255.255.255.254 | 11111111.11111111.11111111.11111110 | 2 | Point-to-point |
| /30 | 255.255.255.252 | 11111111.11111111.11111111.11111100 | 2 | Point-to-point |
| /28 | 255.255.255.240 | 11111111.11111111.11111111.11110000 | 14 | Small LAN |
| /24 | 255.255.255.0 | 11111111.11111111.11111111.00000000 | 254 | Class C |
| /22 | 255.255.252.0 | 11111111.11111111.11111100.00000000 | 1022 | Supernet |
| /20 | 255.255.240.0 | 11111111.11111111.11110000.00000000 | 4094 | Supernet |
| /16 | 255.255.0.0 | 11111111.11111111.00000000.00000000 | 65,534 | Class B |
| /12 | 255.240.0.0 | 11111111.11110000.00000000.00000000 | 1,048,574 | Large ISP |
| /8 | 255.0.0.0 | 11111111.00000000.00000000.00000000 | 16,777,214 | Class A |
| /4 | 240.0.0.0 | 11110000.00000000.00000000.00000000 | 268,435,454 | Reserved |
| /0 | 0.0.0.0 | 00000000.00000000.00000000.00000000 | 4,294,967,294 | Default route |
| Common Private Ranges | ||||
| /8 | 10.0.0.0 | 00001010.00000000.00000000.00000000 | 16,777,214 | Class A Private |
| /12 | 172.16.0.0 | 10101100.00010000.00000000.00000000 | 1,048,574 | Class B Private |
| /16 | 192.168.0.0 | 11000000.10101000.00000000.00000000 | 65,534 | Class C Private |
| /4 | 224.0.0.0 | 11100000.00000000.00000000.00000000 | - | Multicast (Class D) |
| /32 | 127.0.0.1 | 01111111.00000000.00000000.00000001 | 1 | Loopback |
| /16 | 169.254.0.0 | 10101001.11111110.00000000.00000000 | 65,534 | Link-local (APIPA) |