IP Address to Binary Converter

Convert IP addresses to binary and back, and line them up with a subnet mask.

The direction is detected from what you paste. One per line for many; results update as you type.

Result

192.168.1.77 →

11000000.10101000.00000001.01001101

Address11000000.10101000.00000001.01001101
Mask /2411111111.11111111.11111111.00000000
Network11000000.10101000.00000001.00000000

Network bits · host bits · network 192.168.1.0/24 · mask 255.255.255.0

Dotted binary11000000.10101000.00000001.01001101
32 bits11000000101010000000000101001101

How it's calculated

  1. 192 = 128 + 64 → 11000000
  2. 168 = 128 + 32 + 8 → 10101000
  3. 1 = 1 → 00000001
  4. 77 = 64 + 8 + 4 + 1 → 01001101

How to Convert an IP Address to Binary

To convert an IP address to binary, write each octet as 8 bits: 192.168.1.1 becomes 11000000.10101000.00000001.00000001. Add a prefix like /24 to see which bits are the network and which the host. IPv6 addresses work too: 128 bits in 8 groups of 16.

Use the place values 128, 64, 32, 16, 8, 4, 2, 1: 192 = 128 + 64 → 11000000. Go through the values from the left, write 1 when the value fits into what's left of the number and subtract it, otherwise write 0.

Octet1286432168421
19211000000
16810101000
7701001101

Network and Host Bits

With a /24 mask, the first 24 bits are the network and the last 8 the host.

A prefix length counts the 1 bits of the subnet mask from the left. Lining the mask up under the address shows the split: where the mask has 1, the address bit belongs to the network; where it has 0, to the host. Setting all host bits to 0 gives the network address. In the example above, 192.168.1.77/26 has the network 192.168.1.64/26 and the mask 255.255.255.192. For the full ranges, use the subnet calculator.

How to Convert Binary Back to an IP

Split 32 bits into four groups of 8 and add the place values of each 1.

11000000 = 128 + 64 = 192. The converter accepts dotted groups, spaces, or all 32 (or 128) bits in a row, and checks that the count is right instead of guessing.

IPv6 in Binary

Each of the 8 groups is 16 bits; the first 64 bits are usually the network prefix.

Each hex digit is 4 bits, so a group like 0db8 is 0000 1101 1011 1000. Most IPv6 networks are /64: the first 64 bits identify the network and the last 64 the device. Enter an IPv6 address with /64 to see it.

How This Tool Works

ItemDetail
Where it runsIn your browser; nothing is sent to our server.
Input checksStrict: each IPv4 number 0-255 in decimal, IPv6 in any standard form (including ::ffff:192.0.2.1 and zones). Invalid input gets the reason, never a silent guess.
Many at onceOne value per line, up to 1,000 lines; each line is converted on its own.
Shareable link?q= followed by a value opens the page with it converted.
StoredNothing.
Last verified10 November 2026

Frequently Asked Questions

How do you convert an IP address to binary?
Convert each octet to 8 bits using the place values 128 to 1: 192.168.1.1 → 11000000.10101000.00000001.00000001.
Why is 255 written as 11111111?
255 = 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1, so all 8 bits are 1. That's why a mask octet of 255 means "all network bits".
How do I find the network part in binary?
Enter a prefix such as /24: the first 24 bits are the network and are shown in a different colour; the rest are host bits.
How do I convert binary to an IP address?
Split the 32 bits into four groups of 8 and convert each group to decimal by adding the place values of its 1 bits. Paste them above.

Next steps

Related Tools

Subnet Calculator
Network, broadcast, mask and host range of any IPv4 subnet.
IP Class Checker
The class (A to E) of an IPv4 address.
IP to Hex Converter
An IP address in hexadecimal, and back.