1. Home
  2. Developer tools
  3. IP to Binary

IP to Binary

Subnetting makes sense once you see the bits. Paste addresses or masks and read each as four bytes of eight bits.

Free, no sign-up. Runs in your browser: nothing is uploaded.

How to use IP to Binary

  1. Paste addresses or masks, one per line.
  2. Read the 32-bit binary form.
  3. Compare the bits of an address and its mask.

Features

  • Eight bits per byte, separated by dots
  • Works for masks as well as addresses
  • Handles lists
  • Shows hex, decimal and octal forms
  • Checks octets from 0 to 255
  • Copy or download

Supported formats

Input

  • IPv4 addresses
  • Typed or pasted text

You get

  • 32-bit binary
  • Octet table

Private by design

Everything you enter is processed by your browser on this device. Nothing is sent to openWorkstand or anyone else, so the IP to Binary is safe for private and work data. After you have used it once while online, it also works without an internet connection. How local processing works

Good to know

  • IPv4 only.
  • It converts addresses, not masks or prefixes, although a mask written as an address works too.

Guide

Seeing the bits of an IPv4 address

Subnetting is much easier when you can see the bits. The decimal numbers in 192.168.1.130 hide where the network ends and the hosts begin, but eight-bit groups make it visible. The page writes each IPv4 address as 32 bits, one per line of input, and shows the other usual notations too.

Octet by octet

Each of the four numbers is between 0 and 255, so it fits in eight bits. To write 192 in binary, note that 192 = 128 + 64, so the bits for 128 and 64 are 1 and the rest are 0, which gives 11000000. The same method turns 168 into 10101000 (128 + 32 + 8), 1 into 00000001. The page pads every group to eight digits so the columns line up, which is the form used in textbooks, exams and router documentation.

Masks and prefixes at bit level

A prefix length is a count of leading ones. A /26 mask is 26 ones followed by 6 zeros: 11111111.11111111.11111111.11000000, which is 255.255.255.192 in decimal. Enter that mask as if it were an address and you will see exactly this pattern. The wildcard mask used in access lists is its mirror image, with ones where the mask has zeros. Because the network part is a run of ones, a valid mask never has a zero followed by a one; the mask 255.0.255.0 would be a pattern, not a subnet.

Using bits to compare addresses

To decide whether two hosts are on the same network, convert both and compare the first N bits, where N is the prefix. For 192.168.1.130 and 192.168.1.190 with a /26, the first 26 bits are the same, so they share the network. With 192.168.1.100 they would not: its last octet is 01100100, which starts with 01, while 130 (10000010) and 190 (10111110) start with 10, so the addresses differ within the first 26 bits. Doing this once by hand teaches more than a dozen calculator results, and the page makes it quick enough to check your work.

A worked example

For 192.168.1.1 the page returns 11000000.10101000.00000001.00000001. The same address is the decimal integer 3232235777, hexadecimal 0xC0A80101, dotted hexadecimal C0.A8.01.01, dotted octal 0300.0250.01.01, and a private address under RFC 1918. Now enter 255.255.255.192: the output is 11111111.11111111.11111111.11000000, six host bits, so each subnet has 2⁶ = 64 addresses.

Limits

The page converts text; it does not decide which part of an address is the network. For that you need the prefix and the Subnet Calculator. IPv6 addresses are 128 bits long and are not accepted here. Leading zeros inside an octet are rejected, because some systems read them as octal, which would change the value.

Masks you will keep meeting

A handful of last-octet values cover almost every subnet mask. A /25 ends in 10000000 (128), a /26 in 11000000 (192), a /27 in 11100000 (224), a /28 in 11110000 (240), a /29 in 11111000 (248) and a /30 in 11111100 (252). Each extra network bit halves the host part, so a /26 leaves six host bits and 64 addresses, a /27 leaves five and 32, and so on. Typing these masks into the page and watching the run of ones lengthen is the fastest way to make the pattern stick.

Checked against the current version of the IP to Binary on .

Frequently asked questions

How can I tell from the bits whether two addresses are on the same subnet?

Compare the first N bits, where N is the prefix length. If those leading bits are identical in both addresses, they belong to the same network; the remaining bits are host bits and may differ.

Why are subnet masks always a run of ones followed by zeros?

Because routers match the longest prefix of leading bits. A mask with ones after a zero would describe a pattern, not a prefix, and CIDR does not allow it.

How do I read a subnet mask in binary?

A valid mask is a run of 1 bits followed by 0 bits. 255.255.255.0 is 24 ones and 8 zeros, which is /24.

Why does each octet have exactly eight bits?

An octet is one byte, and the output pads with leading zeros so each byte is shown in full. 1 becomes 00000001.

Keep working with the result

openWorkstand also includes a free workspace with documents, spreadsheets, tasks, projects and a calendar that save to a folder on your computer.