IPv4 to Binary Converter

Enter an IPv4 address and pick a direction to convert between dotted decimal and binary.

Result

11000000.10101000.00000001.00001010
3,232,235,786
Dotted decimal → binary

How it is calculated

An IPv4 address is four numbers (octets) separated by dots. In address-to-binary mode each octet, 0 to 255, is written in base 2 and padded with leading zeros to exactly eight digits, then the four groups are joined with dots. In binary-to-address mode each group of up to eight 0s and 1s is read as a base-2 number, b7·128 + b6·64 + b5·32 + b4·16 + b3·8 + b2·4 + b1·2 + b0, and printed in decimal.

In both directions the tool also reports the 32-bit integer value a·2²⁴ + b·2¹⁶ + c·2⁸ + d. The input must have exactly four dot-separated parts. Decimal octets must be digits only and not above 255; binary groups may only contain 0 and 1, and a group shorter than eight digits is accepted and read as a number (so 1010 means 10). Anything else returns no result. Only IPv4 is covered, not IPv6.

Worked example

Convert 192.168.1.10 in address-to-binary mode. 192 = 128 + 64, so 11000000. 168 = 128 + 32 + 8, so 10101000. 1 becomes 00000001 after padding to eight digits, and 10 = 8 + 2 becomes 00001010. The tool shows 11000000.10101000.00000001.00001010, and the 32-bit integer 3,232,235,786 beneath it. Switching to binary-to-address mode and entering that binary string returns 192.168.1.10.

Try this example →

Common mistakes

  • Leaving the direction set to address-to-binary while entering binary digits, or the reverse. A binary string in the wrong mode is rejected, as is a decimal address in binary-to-address mode.
  • Writing an octet above 255 (such as 192.168.1.256) or giving only three parts. Both return nothing rather than a corrected address.
  • Leaving out the padding zeros when typing binary by hand. A short group such as 1 or 1010 is accepted and read as 1 or 10, so 11000000.10101000.1.1010 gives 192.168.1.10 and can hide a typo. Write all eight digits per group.
  • Entering a binary group with digits other than 0 or 1, for example 11000002. Only 0 and 1 are allowed in that mode.
  • Entering a CIDR prefix such as 192.168.1.10/24. The slash part is not accepted; enter the address alone.

Sources

About this calculator

An IPv4 address like 192.168.1.1 is really a 32-bit number, split into four 8-bit octets and written in dotted decimal for humans to read. Each octet ranges from 0 to 255 because that's the full range of an 8-bit binary value (00000000 to 11111111).

Converting between the decimal and binary forms — and seeing the full 32-bit integer — is a routine task for network engineers and students studying subnetting, ACLs, and routing tables, since subnet masks, wildcard masks, and CIDR calculations are all defined in binary underneath the dotted decimal notation everyone actually types. It's a staple exercise in CCNA/CCNP and networking coursework.

Was this helpful?

You can pick up to 3 reactions.

Comments (1)

  • Editorial team

    The tool accepts any four octets, so you can paste a subnet mask too. 255.255.255.0 becomes 24 ones followed by 8 zeros, and the number of leading ones is the prefix length, /24. The 32-bit value shown for that mask is 4,294,967,040. Would you rather see CIDR notation or IPv6 supported first? Let us know which of the two matters more to you.

Popular calculators

All Calculators