IP Addresses in Binary and Hex (Subnetting Basics)

An IP address like 192.168.1.1 looks like four small numbers, and every piece of networking jargon attached to it, the /24, the subnet mask, the “network portion”, stops being jargon the moment you see the address the way routers do: as 32 bits. Subnetting is not a separate discipline; it is binary reading with a network vocabulary. This guide does the translation, with our free IP to binary converter turning any address into the bits underneath.

An IP address is 32 bits in a costume

The dotted format is purely for humans: each of the four numbers is one byte, 0 to 255, and the address is the four bytes run together. 192.168.1.1 is really 11000000 10101000 00000001 00000001, and every operation networks perform happens on that bit string, not on the friendly decimals. The costume explains its own rules: numbers above 255 are impossible because a byte holds eight bits, and the familiar landmarks decode instantly once the bits show, 255 being all ones, 0 all zeros, 128 a lone one in front. Drop any address into the converter and the rest of this guide becomes visible rather than theoretical.

The subnet mask: a boundary written in ones

Every address has two halves: the front identifies the network, the back identifies the host on it. The subnet mask records where one ends and the other begins, as a run of ones followed by a run of zeros: 255.255.255.0 is twenty-four ones then eight zeros, declaring “first three bytes network, last byte host”. The mask is not decoration; it feeds the AND operation from the bitwise guide: address AND mask = network address, so 192.168.1.1 AND 255.255.255.0 yields 192.168.1.0, and a router decides “is this destination local?” by ANDing both addresses with the mask and comparing. Billions of such ANDs per second, on every router on earth, are the entire mechanism behind “same network or not”.

Slash notation: /24 and friends

Since a valid mask is always ones-then-zeros, the only information it carries is how many ones, and slash notation says exactly that: /24 means twenty-four ones, the mask 255.255.255.0. The common sizes:

NotationMaskHost bitsUsable hosts
/16255.255.0.01665,534
/24255.255.255.08254
/26255.255.255.192662
/30255.255.255.25222

The odd-looking 192 in the /26 mask is the binary giveaway: 11000000, two more ones spilling into the final byte. Masks that look arbitrary in decimal are always clean in binary, which is the running theme of the whole topic.

Counting hosts: the powers of two, minus two

Host capacity is pure bit arithmetic: n host bits give 2n patterns, minus two, because the all-zeros pattern names the network itself and the all-ones pattern is the broadcast address. A /24 has 8 host bits: 256 patterns, 254 usable. A /26 has 6: 64 patterns, 62 hosts. The minus-two is the detail exam questions and real deployments both hinge on, and it produces the classic gotcha at /30, where 4 patterns leave exactly 2 usable addresses, the standard size for the point-to-point links between routers, where exactly two devices exist. Subnetting a building is choosing where to cut: more network bits make more, smaller subnets, and the trade is always count of networks against size of each, in powers of two.

The hex view, and when you meet it

The same 32 bits also write as eight hex digits: 192.168.1.1 is C0A80101, each byte two digits. The hex costume appears in packet dumps, firewall logs, programming APIs that store addresses as integers, and configuration files of long lineage, and translating it back to dotted form is the job of the hex to IP converter, with the binary to IP and IP to hex directions completing the set. Hex is also the gateway to IPv6, whose addresses are 128 bits and written in hex natively, eight groups of four digits, the same bits-in-a-costume idea at four times the width. The base arithmetic behind all the costumes lives in the number systems pillar.

Frequently asked questions

Why do home networks always start with 192.168?

That range is one of the three blocks reserved for private use, never routed on the public internet, alongside 10.x.x.x and 172.16-31.x.x. Routers ship defaulting to a 192.168 subnet, and network address translation maps the private addresses to the home’s single public one.

What is the broadcast address actually for?

It is the all-ones host pattern that means “every device on this subnet”: 192.168.1.255 on a /24. Discovery protocols use it to ask questions when they do not yet know who to ask, which is how devices find printers and DHCP servers without configuration.

Can a subnet mask have its ones in any other arrangement?

No: the standard requires contiguous ones then zeros, which is what lets the slash count describe a mask completely. Hardware and the AND logic both depend on the boundary being a single clean cut; a gappy mask is simply invalid in modern networking.

How does IPv6 change this picture?

The arithmetic survives, the scarcity does not: 128-bit addresses make the host portion enormous (a standard /64 subnet has more addresses than there are atoms in a human body), so the careful minus-two counting of IPv4 fades. Prefixes, masks-as-bit-counts and the AND test all carry over unchanged.

ATV

Written by Nick (ATV Team)

We build and maintain the 600+ free, client-side tools on this site, and every guide is written against the tools themselves: each figure is computed and checked before it is published, and every linked tool is tested in the browser. More about how we work on the about page, and the full library of guides lives on the blog.