InfyCalculator
💻

IP to Binary Converter

Convert an IPv4 address to binary, hexadecimal and a 32-bit decimal integer — or binary back to dotted decimal — with the address class, private/public type and octet-by-octet breakdown.

IPv4 address
Loading calculator…

How it works

Each octet (0–255) → 8 bits: 128 64 32 16 8 4 2 1 · 32-bit integer = o₁ × 256³ + o₂ × 256² + o₃ × 256 + o₄ · class by first octet: A 0–127, B 128–191, C 192–223, D 224–239, E 240–255

An IPv4 address is a 32-bit number written as four decimal octets. Converting each octet to 8 binary digits (padding with leading zeros) gives the form used to work out subnet masks, network and host bits. The address type follows IANA’s special-purpose registry: 10/8, 172.16/12 and 192.168/16 are private (RFC 1918), 100.64/10 is carrier-grade NAT space, 127/8 is loopback and 169.254/16 is link-local; classes A–E are historical (classful addressing was replaced by CIDR in 1993) but still taught.

Worked example

192.168.1.10: 192 = 128 + 64 → 11000000; 168 = 128 + 32 + 8 → 10101000; 1 → 00000001; 10 = 8 + 2 → 00001010. So the address is 11000000.10101000.00000001.00001010 in binary, 0xC0A8010A in hex and 3,232,235,786 as a 32-bit integer — a class C, private (RFC 1918) address.

Sources: RFC 1918 — Address Allocation for Private Internets · IANA IPv4 Special-Purpose Address Registry

Frequently asked questions

How do I convert an IP address to binary?

Convert each of the four numbers separately to 8-bit binary using the place values 128, 64, 32, 16, 8, 4, 2, 1, then join them with dots. 192 is 11000000 because 128 + 64 = 192.

How do I convert binary back to an IP address?

Split the 32 bits into four groups of 8 and add the place values of the 1 bits in each group. 10101000 = 128 + 32 + 8 = 168. You can paste binary straight into this converter.

Which IP addresses are private?

10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255 and 192.168.0.0–192.168.255.255 (RFC 1918). They are used inside home and office networks and are not routed on the internet.

Are IP address classes still used?

Not for routing — CIDR replaced them in 1993 — but classes A, B and C are still taught and give the old default masks /8, /16 and /24.

What is the decimal integer form for?

Databases and some programs store IPv4 addresses as a single 32-bit number, which makes range checks easy. 192.168.1.10 = 3,232,235,786.

Related calculators

This calculator is for educational purposes. Double-check important results before acting on them.