Network Addressing

IPv4 to binary

Direction
IPv4 address
Binary, by octet 00001010 00010100 00011110 00101000
Eight bits per octet, 32 in total
Address 10.20.30.40
Integer 169090600
Hexadecimal 0x0A141E28
Octets 10 · 20 · 30 · 40
Note
32 bits · prefixes count leading ones

A prefix length is simply a count of leading bits. A /26 fixes the first 26 bits and leaves 6 free, giving 64 addresses. In dotted-quad that boundary looks arbitrary — 255.255.255.192 — but in binary it is obvious: 26 ones followed by 6 zeros. Every subnetting rule becomes clear once the address is written as bits, which is why it is always taught this way.

Advertisement
320 × 100

Each octet becomes eight bits, giving 32 in total. 10.20.30.40 is 00001010 00010100 00011110 00101000. Subnet prefixes count leading bits, which is why binary is the form subnetting is taught in.

How to convert an IP to binary

1 Enter the address.
2 Read the binary, grouped by octet.
3 Count leading bits to see where a prefix boundary falls.
4 The integer and hex forms are shown alongside.

Reading the binary makes the private ranges recognisable. Anything starting 00001010 is 10.x — a full class-A private block. Anything starting 110000001010 1000 is 192.168.x. And 10101100 0001 followed by four variable bits is the 172.16–172.31 range, which is the one people misremember, because its boundary sits inside an octet rather than on it.

Questions

Thirty-two — four octets of eight bits each.

Advertisement
300 × 250
Was this tool any good?
INTERNAL SIGNAL ONLY · WE USE IT TO FIND TOOLS WORTH REBUILDING