Binary to IP: decode 32 bits into a dotted address
Subnetting exercises, textbook diagrams and bit-level debugging often leave you with an address written as 0s and 1s. The binary to IP converter reads those bits and prints the familiar dotted-decimal form as you type.
Reading an octet
Add the place values (128, 64, 32, 16, 8, 4, 2, 1) wherever a bit is 1. For 10101100:
1 0 1 0 1 1 0 0
128 32 8 4 = 172
Repeat for the remaining octets and join the results with dots. 10101100.00010000.11111110.00000001 decodes to 172.16.254.1.
Accepted input
11000000.10101000.00000001.00000001 → 192.168.1.1
10101100 00010000 11111110 00000001 → 172.16.254.1
11000000101010000000000100000001 → 192.168.1.1
11111111.11111111.11110000.00000000 → 255.255.240.0
- Grouped octets: four groups of eight bits separated by dots or spaces. Groups of 1 to 7 bits are accepted when Input format is set to Binary.
- One continuous string: exactly 32 bits with the Auto setting. With Input format set to Binary, a shorter string is treated as a number and filled with zeros on the left, so
101becomes 0.0.0.5. - With Binary selected, any character other than 0, 1 and the separators is rejected.
Decoding a subnet mask
The last example above is a mask. Count the 1s — here 8 + 8 + 4 = 20 — and you have the prefix length, so 255.255.240.0 is a /20. A valid mask is always a solid run of 1s followed by 0s; if you see a 0 between two 1s, the value is not a usable netmask. The CIDR calculator accepts either form and shows the resulting host range.
Worked example: network and broadcast address in binary
Subnet questions are easiest to check bit by bit. Take the host 192.168.1.130 with a /25 mask:
host 11000000.10101000.00000001.10000010 192.168.1.130
mask /25 11111111.11111111.11111111.10000000 255.255.255.128
network 11000000.10101000.00000001.10000000 192.168.1.128
broadcast 11000000.10101000.00000001.11111111 192.168.1.255
The network address keeps the bits where the mask has 1s (a bitwise AND, which the AND calculator can do for you) and the broadcast address sets every host bit to 1. Paste any of these rows into the converter to confirm the decimal form.
The leading bits also reveal the old address class: 0 is class A (0–127), 10 is class B (128–191), 110 is class C (192–223) and 1110 is multicast (224–239).
Common mistakes
- A dropped bit. On Auto, a group of seven bits is not recognized as binary at all. With Input format set to Binary, shorter groups are allowed, so
1100000.10101000.00000001.00000001(seven bits in the first group) quietly decodes to 96.168.1.1 instead of 192.168.1.1. Count the digits when a result surprises you. - Reading right to left. The leftmost bit of an octet is worth 128, not 1.
- More than 32 bits. Extra digits cannot fit in an IPv4 address and are rejected.
For the opposite direction, use IP to Binary; for plain binary numbers that are not addresses, try Binary to Decimal. All decoding happens in your browser.