Skip to content
ZeroServer.tools

IP to Binary Converter

Convert IPv4 addresses to binary and hex notation, and decode subnet masks.

Octet Breakdown

Octet 1Octet 2Octet 3Octet 4
Decimal19216811
Binary11000000101010000000000100000001
HexC0A80101

Full Representations

Full binary11000000.10101000.00000001.00000001
Full hexC0.A8.01.01
32-bit integer3232235777

Subnet Info (/24)

Subnet mask255.255.255.0
Mask binary11111111.11111111.11111111.00000000
Network address192.168.1.0
Broadcast address192.168.1.255

IP to Binary Converter — decode IPv4 addresses into binary and hex

Every IPv4 address is a 32-bit number split into four 8-bit octets. This converter shows each octet in decimal, binary (8 bits), and hexadecimal, plus the full dotted-binary and 32-bit integer representations. Enter an optional CIDR prefix length (e.g. /24) to also compute the subnet mask, network address (IP AND mask), and broadcast address (IP OR NOT mask) — essential for network planning and subnetting practice.

Built and maintained by Meet Shah · Last updated

What this tool is used for

  • Seeing the bit pattern of an address to work out where a subnet boundary falls.
  • Decoding a subnet mask to count the prefix length.
  • Checking whether two addresses share a network by comparing their masked bits.
  • Teaching subnetting by showing the octets as bits.
  • Confirming a mask is contiguous, which a valid mask must be.

Frequently Asked Questions

What does the binary view show me?
The 32 bits an IPv4 address actually is. Dotted decimal is a human convenience layered over one 32-bit integer — 192.168.1.1 is 11000000.10101000.00000001.00000001 — and seeing it that way is what makes subnet masks stop looking arbitrary.
How are the network and broadcast addresses derived?
Bitwise. The network address is the IP ANDed with the mask, so every host bit becomes 0; the broadcast is the IP ORed with the mask's complement, so every host bit becomes 1. A /24 gives 256 addresses of which 254 are usable, because those two are reserved.
What does the CIDR number mean?
How many leading bits are the network. /24 means the first 24 are fixed and the last 8 identify the host, which is 2⁸ = 256 addresses. Each step down doubles the block: /23 is 512, /22 is 1024. The mask is those bits in dotted decimal — /24 is 255.255.255.0.
Why is 192.168.001.1 rejected?
Because a leading zero is ambiguous and dangerous. `inet_aton` and several C libraries read `010` as OCTAL 8, so the same string names different hosts to different parsers — the mechanism behind a long line of SSRF filter bypasses. Refusing it is the only reading that cannot be wrong.
Does it accept a partial address like 1.2.3.?
No. A trailing empty part used to be read as 0 because `Number("")` is 0, so `1.2.3.` became 1.2.3.0 and a bare `...` became 0.0.0.0 — a string with no digits in it at all, reported as valid with a full binary expansion. Every part must now be one to three decimal digits.

Common errors and gotchas

  • Dropping leading zeros within an octet, which misaligns every bit after it.
  • Assuming a mask can have gaps. A valid subnet mask is a run of ones followed by a run of zeros.
  • Confusing the network address with the first usable host address.
  • Reading the prefix length as a byte count rather than a bit count.
  • Treating an octet's leading zero as octal, which changes the address in some parsers.

Related Converters tools

Private & free — this tool runs entirely in your browser.

IndieKitShip your Next.js startup in days.affiliate