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
A plain address, or one with a /prefix if you want the mask broken down too.
| Octet | Decimal | Binary | Hex | Octal |
|---|---|---|---|---|
| #1 | 192 | 11000000 | 0xC0 | 300 |
| #2 | 168 | 10101000 | 0xA8 | 250 |
| #3 | 1 | 00000001 | 0x01 | 1 |
| #4 | 10 | 00001010 | 0x0A | 12 |
| Dotted decimal | 192.168.1.10 | |
| Dotted binary | 11000000.10101000.00000001.00001010 | |
| Flat binary | 11000000101010000000000100001010 | |
| 32-bit integer | 3232235786 | |
| Hexadecimal | 0xC0A8010A | |
| Class | C | |
| Scope | Private (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
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 mask | Binary | Prefix | Block size |
|---|---|---|---|
| 0 | 00000000 | /24 | 256 |
| 128 | 10000000 | /25 | 128 |
| 192 | 11000000 | /26 | 64 |
| 224 | 11100000 | /27 | 32 |
| 240 | 11110000 | /28 | 16 |
| 248 | 11111000 | /29 | 8 |
| 252 | 11111100 | /30 | 4 |
| 254 | 11111110 | /31 | 2 |
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.