What Is an IP to Binary Calculator?
An IP to binary calculator converts a readable IPv4 or IPv6 address into the exact sequence of zero and one bits used to represent it. IPv4 contains 32 bits arranged as four 8-bit octets. IPv6 contains 128 bits, usually written as eight hexadecimal hextets. Binary makes the underlying structure visible and is especially helpful when learning subnetting, checking masks, or debugging address conversion.
The ipdnslookup calculator keeps every leading zero, groups the result into readable units, and provides a component breakdown. It also shows the number of one and zero bits, integer and hexadecimal equivalents, address type, expanded form, and a round-trip check.
How to Use the IP to Binary Calculator
- Enter one IPv4 address such as
192.168.1.1or one IPv6 address such as2001:db8::1. - Select Convert IP to Binary.
- Read the grouped binary address in the main result.
- Review each octet or hextet in the component breakdown.
- Confirm the round-trip result matches the normalized input.
Enter an individual address without a slash prefix. To inspect a CIDR network, use the CIDR Notation Calculator.
IPv4 Binary Conversion Example
The address 192.168.1.1 contains four decimal octets. Each is converted separately and padded to eight bits:
192 = 11000000168 = 101010001 = 000000011 = 00000001
Joining the four groups gives 11000000.10101000.00000001.00000001. The zeroes before each final 1 are required because every IPv4 octet occupies exactly eight bits.
How Decimal Octets Become Binary
An 8-bit octet uses place values 128, 64, 32, 16, 8, 4, 2, and 1. Put a one in a position when that value is included and a zero when it is not. For 192, the 128 and 64 positions are on, producing 11000000. For 168, the values 128, 32, and 8 are on, producing 10101000.
Every valid IPv4 octet is between 0 and 255. Zero converts to 00000000, while 255 converts to 11111111. Four complete octets always produce 32 bits.
IPv6 Binary Conversion Example
IPv6 uses hexadecimal because 128 raw bits are difficult to read. Each hexadecimal digit represents four bits, and each four-digit hextet represents 16 bits. The address 2001:db8::1 expands to 2001:0db8:0000:0000:0000:0000:0000:0001.
The first hextet 2001 becomes 0010000000000001. The final hextet 0001 becomes 0000000000000001. The compressed middle hextets are all sixteen zero bits. The complete result remains 128 bits even when the written IPv6 address uses ::.
Why Use Our IP to Binary Calculator?
- Complete width: IPv4 is padded to 32 bits and IPv6 to 128 bits.
- Clear grouping: Octets, bytes, and hextets remain easy to inspect.
- Advanced details: Bit counts and equivalent numeric formats are included.
- Validation: Invalid or CIDR-formatted input is rejected clearly.
- IPv6 support: Compressed input is expanded before its components are explained.
- No signup: The conversion is available immediately.
Understanding the Results
- Binary Address: The complete address expressed as zero and one bits.
- Expanded Address: Normalized IPv4 or fully expanded IPv6 text.
- Address Type: A classification such as private, public, loopback, link-local, multicast, or reserved.
- One Bits and Zero Bits: Counts of each bit value across the complete address.
- Integer: The same bits interpreted as one unsigned whole number.
- Hexadecimal: A compact base-16 representation.
- Round-trip Check: The address reconstructed from the binary number.
- Component Breakdown: Each source octet or hextet beside its fixed-width binary value.
How Binary Helps with Subnetting
A CIDR prefix divides an address into network bits and host bits. For an IPv4 /24, the first 24 bits identify the network and the remaining 8 bits identify positions inside it. Addresses with matching first 24 bits belong to the same /24 network.
For example, 192.168.1.10 and 192.168.1.200 share the first three binary octets. With a /24 mask, they share a network. With a longer prefix, some bits in the final octet also become network bits, so a visible binary comparison becomes useful.
Binary Masks and Bitwise AND
A subnet mask contains one bits for the network prefix followed by zero bits for the host portion. A /26 IPv4 mask is 11111111.11111111.11111111.11000000, or 255.255.255.192. A bitwise AND between an IP address and that mask clears host bits and returns the network address.
This calculator converts the address itself. Use the Subnet Mask Calculator when you also need the mask, wildcard, capacity, and network boundaries.
Common Uses for Binary IP Conversion
- Learning how IPv4 octets map to bits.
- Understanding CIDR prefixes and subnet boundaries.
- Comparing network portions of two addresses.
- Checking bitwise calculations in network code.
- Inspecting packet fields and log conversions.
- Expanding IPv6 into a complete 128-bit layout.
- Verifying database or programming-language conversions.
Leading Zeroes Matter in Binary Output
The decimal value 1 can be written as binary 1, but an IPv4 octet needs 00000001. Removing the seven leading zeroes would make the grouped address ambiguous and shorten its expected width. IPv6 has the same requirement at the bit level even though its text form permits compressed zero hextets.
Always preserve a known width when exchanging binary address data. A separate version field is also important because a 32-bit IPv4 value and a 128-bit IPv6 value follow different formatting and interpretation rules.
Binary, Decimal, and Hexadecimal Are Equivalent
These formats do not create different addresses. Binary is base 2, everyday integers are base 10, and hexadecimal is base 16. Each is a different way to display the same numeric value. Hexadecimal aligns neatly with groups of four bits, which is why IPv6 uses it.
The IP to Integer Calculator is better when the decimal number is the primary goal. This page focuses on the bit layout and component-level explanation.
Accuracy and Input Notes
- IPv4 octets must be decimal values from 0 to 255.
- IPv6 must contain valid hexadecimal groups and compression.
- A CIDR suffix is not accepted because it is not part of one address value.
- IPv6 output must use exact integer arithmetic rather than floating-point numbers.
- Several valid IPv6 spellings may normalize to the same address and binary value.
- The conversion does not reveal a location, owner, threat score, or live network status.
IPv4 is specified in RFC 791. The IPv6 addressing architecture and its 128-bit addresses are defined in RFC 4291.
Frequently Asked Questions
How many binary bits are in an IPv4 address?
IPv4 always contains 32 bits, grouped as four 8-bit octets.
How many bits are in IPv6?
IPv6 always contains 128 bits, commonly displayed as eight 16-bit hexadecimal hextets.
Why does the binary result include leading zeroes?
They preserve the required width of each component and the full address.
Can binary tell me whether two addresses share a subnet?
Yes, when you also know the prefix. Compare the number of leading bits identified by that prefix.
Does IPv6 compression remove bits?
No. It shortens only the text. The omitted groups are restored as zeroes during expansion.
Can I enter a domain name?
No. Enter a literal IPv4 or IPv6 address so the calculator can perform an exact conversion.
Related IP Calculators
Use the IP to Integer Calculator for exact decimal values, the Subnet Mask Calculator for mask bits, and the Network Address Calculator for bitwise network boundaries. Browse all ipdnslookup calculators for additional conversions.