IP to binary converter

Type an IPv4 address such as 192.168.1.1 to get it in binary, one 8-bit group per part. Add a prefix like /24 to see the subnet mask, network and broadcast address in binary too. Switch the direction to turn binary back into an IP.

Show each part
Add /24 after an address to see the subnet mask.0 addresses
Reviewed bySam Siewert
Last updated · How we test

Runs in your browser. Nothing you type is uploaded.

How to convert an IP address to binary

  1. Type one or more IP addresses, one per line. A CIDR prefix such as /26 is optional.
  2. Pick an output style: dotted binary, spaced binary, 32 bits with no dots, hex or one single number.
  3. Open "Show each part" to see how each of the four numbers becomes 8 bits.

The tool also reads addresses written as 32 bits, as hex such as 0xC0A80101, or as one big number such as 3232235777.

The method

An IPv4 address is four bytes. Each part between the dots is a number from 0 to 255, and each one becomes exactly 8 bits, as the binary numbers chart lists for every value in that range. Use the place values 128, 64, 32, 16, 8, 4, 2 and 1, and write 1 under each value you need to add up to the number. The decimal to binary converter shows these steps for one number at a time.

IP to binary: 192 is 11000000, 168 is 10101000, 1 is 00000001 and 1 is 00000001, so 192.168.1.1 is 11000000.10101000.00000001.00000001.
PartDecimalSumBinary
1192128 + 6411000000
2168128 + 32 + 810101000
31100000001
41100000001

So 192.168.1.1 in binary is 11000000.10101000.00000001.00000001. Always keep all 8 bits in each part, leading zeros included, or the address will not line up with its subnet mask.

Subnet masks in binary

The number after the slash says how many bits from the left belong to the network, the CIDR notation defined in RFC 4632. Those bits are 1 in the mask and the rest are 0. To get the network address, keep the address bits where the mask is 1 and set the others to 0. That is a bitwise AND, which you can check in the binary calculator.

Example192.168.1.130/26
Address11000000.10101000.00000001.10000010
Mask (26 ones)11111111.11111111.11111111.11000000 = 255.255.255.192
Network11000000.10101000.00000001.10000000 = 192.168.1.128
Broadcast11000000.10101000.00000001.10111111 = 192.168.1.191
Usable hosts26 - 2 = 62
Subnet example for 192.168.1.130/26: the mask 255.255.255.192 ends in 11000000, so the network address is 192.168.1.128 and the broadcast address is 192.168.1.191, with 62 usable hosts.

Common masks

PrefixMaskLast part in binaryUsable hosts
/8255.0.0.00000000016,777,214
/16255.255.0.00000000065,534
/24255.255.255.000000000254
/25255.255.255.12810000000126
/26255.255.255.1921100000062
/27255.255.255.2241110000030
/30255.255.255.252111111002

How to convert binary to an IP address

Split the 32 bits into four groups of 8, turn each group into decimal, and put dots between them. 00001010 00000000 00000000 00000001 is 10, 0, 0 and 1, which is 10.0.0.1. The binary to decimal tool shows the math for any single group.

Frequently asked questions

Why is an IP address 32 bits?

IPv4 uses four bytes for each address, and 4 × 8 = 32. That allows about 4.3 billion addresses.

Does this work for IPv6?

No. IPv6 addresses are 128 bits written in hex. This tool converts IPv4 only.

Which addresses are private?

10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16, the three blocks reserved by RFC 1918 for private networks. The tool labels these when you convert one.

What is 255.255.255.0 in binary?

11111111.11111111.11111111.00000000, which is a /24 mask.

Scroll to Top