Skip to content

IPv4 address to binary

See an IPv4 address in binary, hex, octal and as a 32-bit integer, octet by octet, with the place-value arithmetic written out.

  • Runs in your browser
  • Nothing you enter is sent
  • Free, no account
IPv4 address
Every representation of the same 32 bits, side by side — the view that makes subnet masks finally make sense.

A plain address, or one with a /prefix if you want the mask broken down too.

Octet by octet
OctetDecimalBinaryHexOctal
#1192110000000xC0300
#2168101010000xA8250
#31000000010x011
#410000010100x0A12
The whole address
Dotted decimal192.168.1.10
Dotted binary11000000.10101000.00000001.00001010
Flat binary11000000101010000000000100001010
32-bit integer3232235786
Hexadecimal0xC0A8010A
ClassC
ScopePrivate (RFC 1918, 192.168.0.0/16)
192 . 168 . 1 . 10
= 192×256^3 + 168×256^2 + 1×256^1 + 10×256^0
= 3221225472 + 11010048 + 256 + 10
= 3232235786
Positional notation: each octet is one byte, so the leftmost is worth 2²⁴.

An address is 32 bits in four groups

Dotted decimal is a display convention, nothing more. The address itself is a single 32-bit number, split into four bytes purely so humans can read it. Seeing all four representations side by side is the fastest way to make subnetting click.

192   . 168   .   1   .  10
11000000 10101000 00000001 00001010
C0        A8        01        0A
= 3232235786 as a single integer

Why binary makes masks obvious

A subnet mask is a run of ones followed by a run of zeros. Once both the address and the mask are written in binary, the network address is simply the columns where both have a 1:

address 11000000 10101000 00000001 00001010
/26     11111111 11111111 11111111 11000000
network 11000000 10101000 00000001 00000000
host bits                            001010

The six free bits give 64 addresses, and the network boundary lands every 64 in the last octet — 0, 64, 128, 192. That is the same table people memorise, derived rather than recalled.

Boundaries worth knowing by eye

Last-octet maskBinaryPrefixBlock size
000000000/24256
12810000000/25128
19211000000/2664
22411100000/2732
24011110000/2816
24811111000/298
25211111100/304
25411111110/312

Each value is the previous one plus the next power of two from the top: 128, 192, 224, 240 … Any other value in a mask — 100, 255.0.255.0 — is not a valid mask at all.

The integer form

Storing an address as a 32-bit unsigned integer is standard practice in databases and log pipelines: it sorts correctly, indexes tightly, and turns a “is this address inside that block?” question into a single integer range query. MySQL has INET_ATON/INET_NTOA, PostgreSQL has a native inet type, and most languages have a one-line conversion. Both the decimal and hex forms are shown above.

Recognising an address from its bits

  • Starts 00001010 — the 10.0.0.0/8 private block.
  • Starts 11000000 10101000 — 192.168.0.0/16, the home-router range.
  • Starts 1010 1100 0001 — inside 172.16.0.0/12.
  • Starts 1110 — multicast, 224.0.0.0/4.
  • Starts 01111111 — loopback, 127.0.0.0/8.

The class and scope of whatever you enter are identified above, from the bits alone.

What this page does not do

There is no lookup of any kind — no WHOIS, no geolocation, no reverse DNS — because all three need a network request and this site makes none. Everything shown is derived arithmetically from the address you typed, in your browser.

Questions

Why convert an IP to binary at all?

Because subnetting is a bitwise operation. Once you can see the address and the mask as bit patterns, the AND that produces the network address becomes obvious rather than something to memorise.

What is the 32-bit integer form for?

Databases and log pipelines often store addresses as a single unsigned integer — it sorts and range-queries far faster than a string. 192.168.1.1 is 3232235777.

Why are there always eight bits per octet?

Because each octet is one byte, and a byte is eight bits. That is also why the maximum value is 255: eight ones is 2⁸ − 1.

Does it work for addresses with a prefix?

Yes. Include /24 or a dotted mask and the mask is broken down alongside the address, so you can see exactly which bits it fixes.