IPv4 to Binary Converter & IP Address Calculator
Convert dot-decimal IPv4 addresses to 32-bit binary code or decode binary streams back into IP addresses. Features interactive octet bit toggles, hexadecimal and 32-bit integer representations, and subnet class detection.
The Engineering Guide to IPv4 to Binary Conversion & IP Architecture
Every device connected to a computer network or the global Internet relies on an Internet Protocol (IP) address for packet routing and host identification. While network administrators and software engineers read IPv4 addresses in human-friendly dotted decimal notation (such as 192.168.1.1), routers, switches, and network interface cards (NICs) process these addresses strictly as 32-bit binary numbers consisting of zeros and ones.
Our online ip address to binary calculator provides bidirectional translation between decimal IP addresses and 32-bit binary notation. Whether you are studying for Cisco CCNA / CompTIA Network+ certifications, configuring CIDR subnet boundaries, or auditing firewall access control lists (ACLs), this tool breaks down every octet, calculates subnet masks, and reveals the underlying binary logic governing computer networks.
How to Convert an IP Address to Binary: Step-by-Step Mathematical Method
An IPv4 address is divided into 4 segments called octets, separated by periods. Each octet contains 8 bits, and 4 octets × 8 bits = 32 bits. Because an 8-bit byte has 28 = 256 combinations, each decimal number ranges from 0 to 255.
To perform the conversion of ip address to binary, evaluate each octet against the 8 descending powers of two: 128, 64, 32, 16, 8, 4, 2, and 1.
1st Octet (192): 192 ≥ 128 (bit=1, rem 64) → 64 ≥ 64 (bit=1, rem 0). Remaining bits = 0.
Binary: 11000000 (128 + 64 = 192)
2nd Octet (168): 168 ≥ 128 (bit=1, rem 40) → 40 < 64 (bit=0) → 40 ≥ 32 (bit=1, rem 8) → 8 ≥ 8 (bit=1, rem 0). Remaining bits = 0.
Binary: 10101000 (128 + 32 + 8 = 168)
3rd Octet (1): All positions 128 down to 2 are 0 → 1 position is 1.
Binary: 00000001
4th Octet (1): Same as 3rd octet.
Binary: 00000001
Combined 32-bit Result: 11000000.10101000.00000001.00000001
How to Convert Binary Back into an IP Address
To reverse the process using our binary to ip calculator, split the 32-bit string into four 8-bit blocks. For each block, sum the active bit weights:
Take binary octet 10101100:
(1 × 128) + (0 × 64) + (1 × 32) + (0 × 16) + (1 × 8) + (1 × 4) + (0 × 2) + (0 × 1)
= 128 + 32 + 8 + 4 = 172.
IPv4 Class Architecture & Binary Prefix Signatures
In historical classful networking (RFC 791), the leading binary bits of the first octet determined the network class and default subnet mask:
| Network Class | First Octet Range | Binary Leading Bits | Default Subnet Mask | Primary Intended Purpose |
|---|---|---|---|---|
| Class A | 1 – 126 | 0... |
255.0.0.0 (/8) | Enormous global enterprise and carrier networks (16.7M hosts/net). |
| Loopback | 127 | 01111111 |
255.0.0.0 (/8) | Local host loopback testing (127.0.0.1 = localhost). |
| Class B | 128 – 191 | 10... |
255.255.0.0 (/16) | Medium to large enterprise campus networks (65,534 hosts/net). |
| Class C | 192 – 223 | 110... |
255.255.255.0 (/24) | Small office and residential home routers (254 hosts/net). |
| Class D | 224 – 239 | 1110... |
N/A | Multicast streaming groups (audio, video, OSPF/RIP routing). |
| Class E | 240 – 255 | 1111... |
N/A | Reserved by IANA for experimental and research use. |
Private vs Public IP Ranges (RFC 1918) in Binary
To conserve IPv4 addresses, the Internet Engineering Task Force (IETF) reserved three blocks for private local networks that do not route on the public internet:
- 10.0.0.0 to 10.255.255.255 (10.0.0.0/8): Binary starts with
00001010. Widely used in cloud VPCs, corporate data centers, and VPN tunnels. - 172.16.0.0 to 172.31.255.255 (172.16.0.0/12): Binary starts with
10101100.0001. Common in container platforms like Docker and Kubernetes. - 192.168.0.0 to 192.168.255.255 (192.168.0.0/16): Binary starts with
11000000.10101000. Standard default subnet for Wi-Fi routers and home broadband gateways.
Frequently Asked Questions About Converting IP to Binary
An IPv4 address consists of 4 decimal numbers separated by dots (octets). To convert an IP address to binary, convert each decimal octet (0 to 255) into its 8-bit binary representation using powers of two (128, 64, 32, 16, 8, 4, 2, 1). For example, 192 converts to 11000000, 168 converts to 10101000, 1 converts to 00000001, giving 11000000.10101000.00000001.00000001.
Divide the 32-bit binary stream into 4 groups of 8 bits. For each 8-bit octet, add the decimal values corresponding to positions with a '1' bit. For instance, binary octet 11000000 has 1s at positions 128 and 64 (128 + 64 = 192). Repeating for all four octets reconstructs the dot-decimal IP address.
The 32-bit binary representation of 192.168.1.1 is 11000000.10101000.00000001.00000001 (or 11000000101010000000000100000001 unspaced).
An octet is an 8-bit segment of data. An IPv4 address has 32 bits total, grouped into exactly 4 octets. Because 8 bits can store 2^8 = 256 unique numbers, each decimal octet ranges from 0 to 255.
A subnet mask consists of consecutive 1s representing the network portion followed by consecutive 0s for the host portion. A standard /24 subnet mask (255.255.255.0) in binary is: 11111111.11111111.11111111.00000000.
Private IP addresses (RFC 1918) are reserved for local internal networks (LANs). In binary, 10.0.0.0/8 starts with 00001010, 172.16.0.0/12 starts with 10101100.0001, and 192.168.0.0/16 starts with 11000000.10101000. Public IPs are globally routable across the public internet.
Yes. Our binary to IP calculator accepts unspaced continuous 32-bit binary strings (e.g. 11000000101010000000000100000001), space-separated binary, or dot-separated binary.
To find an IP's 32-bit integer, multiply the octets: (octet1 × 256^3) + (octet2 × 256^2) + (octet3 × 256) + octet4. For 192.168.1.1, the 32-bit integer is 3,232,235,777.