IP to Binary Converter

Convert dotted IPv4 addresses into raw 32-bit binary form.

Result

About this tool

IP to Binary converts IPv4 dotted-decimal addresses into their raw 32-bit binary representation. This is the foundation of subnetting - every subnet mask, wildcard mask, and CIDR calculation operates on binary values. Seeing the bit-level structure of an address makes the logic of network/host boundaries, wildcard ACLs, and prefix matching immediately clear.

Real example

Input: 192.168.1.1

Each decimal octet is converted to its 8-bit binary form:
192 -> 11000000
168 -> 10101000
1 -> 00000001
1 -> 00000001
Result: 11000000101010000000000100000001

Now apply a /24 subnet mask (11111111111111111111111100000000 = 255.255.255.0): the ANDing of these two values gives the network address 11000000101010000000000000000000 = 192.168.1.0. This is how routers compute which subnet a packet belongs to.

Common use cases

  • Subnetting practice: CCNA and network+ exams require manual binary subnetting. Convert your IP and mask here to verify your work. Combine with the CIDR / IP Converter to check full subnet range calculations.
  • ACL wildcard mask debugging: Cisco ACLs use wildcard masks (inverse masks) instead of subnet masks. Seeing both the IP and mask in binary makes it clear which bits are matched and which are wildcarded.
  • Script validation: When writing code that performs bitwise IP operations, convert a few known IPs to binary and trace through your logic to confirm it is correct.
  • Teaching and documentation: Binary representation diagrams help students and teammates understand why 192.168.0.0/16 contains 65,534 usable hosts - the 16 host bits become visible immediately.

How it works

Each of the four octets is converted from decimal to binary using n.toString(2).padStart(8, '0'). The padStart(8, '0') ensures each octet is exactly 8 bits, preserving leading zeros. For example, octet 1 becomes 00000001, not 1. The four 8-bit strings are concatenated into a single 32-bit output string.

Common mistakes

  • Forgetting leading zeros: Octet 1 is 00000001, not 1. If you are manually computing binary and drop leading zeros, your subnet math will produce wrong results.
  • Confusing host and network bits: The binary output shows the full address. To identify the network portion, you need to AND it with the subnet mask. This tool shows the address alone - use the CIDR / IP Converter to compute the network address.
  • Using this for IPv6: IPv6 addresses are 128 bits across 8 groups of 16 bits each. Use the IPv6 to Binary tool for those.

FAQ

Can I see the binary with dots between octets
The output is a continuous 32-bit string for easy copy/paste into calculations. To see octets separated, just mentally split at every 8th character: positions 1-8, 9-16, 17-24, 25-32.

What is the binary for 255.255.255.0 (a /24 mask)
11111111111111111111111100000000 - 24 ones followed by 8 zeros. The count of leading ones is always the CIDR prefix length.

How do I go the other direction (binary to IP)
Use the Binary to IP tool - paste the 32-bit binary string and it returns the dotted-decimal address.

Does the bit pattern change for private vs public addresses
No - the conversion is purely mathematical. The RFC 1918 private ranges (10.x, 172.16-31.x, 192.168.x) convert the same way as any other address.

Learn more

Looking for the full picture of how IPv4 addressing, CIDR notation, and subnet masks fit together The IP Addressing & Networking Guide covers all four address formats (dotted-decimal, binary, hex, and integer), private ranges, and CIDR subnetting with worked examples. For a deep dive into subnet planning, see the CIDR Subnetting Explained article.

Binary IP in networking operations

Binary is the native representation of IP addresses in network hardware and operating system kernels. The dotted-decimal notation you type into a terminal is immediately converted to a 32-bit integer before any routing decision is made. Understanding binary representation makes subnet math intuitive rather than mechanical.

Subnet masking: A subnet mask in binary is always a run of 1s followed by a run of 0s. The 1 bits identify the network portion of an address; the 0 bits identify the host portion. A /24 mask is 24 ones followed by 8 zeros: 11111111 11111111 11111111 00000000. Applying the mask (bitwise AND of address and mask) extracts the network address. The binary form makes it immediate — any address that shares the first 24 bits with 192.168.1.0 is on the same /24 network.

Broadcast address: Set all host bits to 1. For 192.168.1.0/24, the host bits are the last 8. Setting them all to 1 gives 11000000 10101000 00000001 11111111 = 192.168.1.255. The binary form makes this derivation mechanical: copy the network bits, set the host bits.

VLSM (Variable Length Subnet Masking): When subdividing a network into subnets of different sizes, binary layout shows exactly where the prefix boundaries fall. A /26 has 6 host bits (2⁶ = 64 addresses per subnet). Splitting a /24 into four /26s is visible in binary as dividing the last 8 bits into a 2-bit subnet field and a 6-bit host field.

Reading the binary output

This tool outputs a continuous 32-bit string — no separators between octets — to make it easy to paste directly into calculations or pattern matching. When reading it mentally, split at every 8th character. The four groups correspond to the four decimal octets left to right.

For 10.0.0.1: 00001010 00000000 00000000 00000001. The leading zeros in the first octet are significant — they must be present to maintain the full 32-bit width. Each octet must be exactly 8 characters. An output of 28 characters indicates a bug; always verify the total length is 32 before using the output in bitwise operations.

See also: Binary to IP (reverse), IP to Hex, IP to Decimal, CIDR IP Converter.

Related tools

  • Binary to IP — reverse — convert a 32-bit binary string back to dotted notation
  • IP to Hex — convert the same IPv4 address to 8-character hex format
  • IP to Decimal — convert the IP to an unsigned 32-bit integer
  • CIDR / IP Converter — visualize how subnet masks work in binary for CIDR calculations