Networking 8 min read

Subnetting Made Simple: IP Addresses and Masks in Binary

Understand IPv4 addresses, subnet masks and CIDR by looking at the bits. Includes worked examples and a cheat sheet.

Imaginex AI Team
November 27, 2026

An IP Address Is Just 32 Bits

192.168.1.10 looks like four numbers, but a computer sees 32 bits:

11000000.10101000.00000001.00001010

Each of the four octets is 8 bits, so each ranges from 0 to 255. See it for any address with the [IP to Binary Converter](/tools/ip-to-binary).

The Subnet Mask Splits Network from Host

A mask such as 255.255.255.0 is a run of 1s followed by 0s:

11111111.11111111.11111111.00000000

Bits under the 1s identify the network. Bits under the 0s identify a device on that network. CIDR notation simply counts the 1s, so 255.255.255.0 is /24.

Worked Example: 192.168.1.10/26

  • /26 means 26 network bits and 6 host bits.
  • 6 host bits give 2^6 = 64 addresses per subnet.
  • Subnets start at .0, .64, .128 and .192, so .10 is in the .0 subnet.
  • The network address is 192.168.1.0 and the broadcast address is 192.168.1.63.
  • Usable hosts are .1 to .62, which is 62 devices.
  • Quick Reference

    CIDRMaskUsable hosts
    /24255.255.255.0254
    /25255.255.255.128126
    /26255.255.255.19262
    /27255.255.255.22430
    /30255.255.255.2522

    The full table from /0 to /32 is in our [subnet mask cheat sheet](/tools/ip-to-binary/subnet-mask-table).

    Other Ways to Write an IP

    Databases often store IPv4 addresses as a single number because range checks become simple comparisons. 192.168.1.10 is 3232235786 as an integer. Convert with [IP to Decimal](/tools/ip-to-decimal) and back with [Decimal to IP](/tools/decimal-to-ip). Packet captures sometimes show hex instead: use [Hex to IP](/tools/hex-to-ip).

    Summary

    Subnetting gets easy once you look at the bits. Count the 1s for the prefix, count the 0s for the host space, and the network and broadcast addresses follow.

    Tags
    subnettingIPv4CIDRnetworkingCCNA

    Try our free tools

    Put these tips into practice with 45+ free online tools - no signup, no login.

    Browse Free Tools