Convert any IPv4 address into its 32-bit binary form, dotted or continuous, with every octet broken down. It also shows the place-value working behind each octet — which of 128, 64, 32, 16, 8, 4, 2 and 1 were used — so you can check the answer by hand rather than take it on trust.
Quick Answer: How to Convert an IP Address to Binary
Split the address at the dots into four octets and convert each one to eight binary digits on its own. 192.168.1.1 becomes 11000000.10101000.00000001.00000001. Each octet is exactly 8 bits, so the whole address is 32 bits. The quickest way by hand is place values: write out 128 64 32 16 8 4 2 1 and mark the ones that add up to the octet — 192 is 128 + 64, so 11000000.
Robert Harrison
OSINT & Network Utility Expert
Robert works on network diagnostics and the practical end of IP tooling — the conversions, lookups and calculations that sit underneath everything else.
Most binary converters hand back a string of ones and zeros and leave it there, which is no use to anyone checking their own work. The searches that reach this page are full of exam wording — people asking for the conversion with the solution. So the tool shows which place values make up each octet and that they add back up to the number. If the tool and your pencil disagree, you can see exactly where.
View all articles by RobertEvery device on a network has an IP address. People read them in a friendly decimal form like 192.168.1.1; the hardware only ever sees the bits underneath. IP to binary conversion is the step between those two views, and it is the point at which subnetting, masks and CIDR start to make sense instead of being rules to memorise.
An IPv4 address — IP is short for Internet Protocol — is four numbers called octets, separated by dots, each from 0 to 255. Convert each octet to eight binary digits and the whole address is exactly 32 bits long, never more and never fewer. That length is not a convention someone chose later: RFC 791, the 1981 specification that defines IPv4, says it in section 2.3 in six words — “Addresses are fixed length of four octets (32 bits)”.
If the dotted form itself is the part that is unfamiliar, what an IP address actually is covers the ground underneath this page, and how to read an IP address format walks through the dotted quad one field at a time.
The converter above gives you three views of the same address, plus the working:
Example: 192.168.1.1 converts to 11000000.10101000.00000001.00000001. Each group of eight digits is one octet.
A bit is a binary digit — a single 0 or 1. So an address “in bits” and an address “in binary” are the same thing written two ways, and bin is just the short form. The 32 bits of an IPv4 address are sometimes counted individually (bit 1 to bit 32, left to right) when talking about prefix lengths, which is the only place the distinction ever matters: a /26 means the first 26 of those bits belong to the network.
The same goes for what the tool itself gets called. An IP address to binary converter, an IPv4 to binary converter and an IP to binary calculator are three names for the one box at the top of this page, and none of them does anything the others do not. What this one adds is that it shows the conversion with the solution — the place values behind every octet — rather than handing back 32 digits and leaving you to trust them.
It is not an academic exercise. The reason engineers, administrators and analysts do it is that several everyday operations are only defined in binary:
/24 literally means “the first 24 bits”Before diving deeper into IP to binary conversion, let's understand how binary numbers work. Binary is a base-2 number system using only two digits: 0 and 1. Decimal (what humans use) is base-10 with digits 0-9.
In an 8-bit binary number, each position has a value that doubles from right to left:
| 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
| 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 |
128 + 64 = 192
To convert decimal 192 to binary, we check which place values sum to 192. Since 128 + 64 = 192, we put 1s in those positions and 0s elsewhere, giving us 11000000.
Each octet in an IP address uses 8 bits. The minimum value is 0 (00000000) and maximum is 255 (11111111). Here are key values to memorize:
0
00000000
128
10000000
192
11000000
255
11111111
Learning to convert IP to binary manually is a valuable skill. Here is the complete process:
Take your IP address and identify the four octets. For 192.168.1.1:
For each decimal number, repeatedly divide by 2 and record the remainders:
Converting 192:
192 ÷ 2 = 96 remainder 0
96 ÷ 2 = 48 remainder 0
48 ÷ 2 = 24 remainder 0
24 ÷ 2 = 12 remainder 0
12 ÷ 2 = 6 remainder 0
6 ÷ 2 = 3 remainder 0
3 ÷ 2 = 1 remainder 1
1 ÷ 2 = 0 remainder 1
Read remainders bottom-to-top: 11000000
Each octet must be exactly 8 bits. If your result is shorter, add leading zeros. For example, decimal 1 converts to binary 1, but we write it as 00000001 to maintain 8 bits.
Join the four binary octets with dots or without:
With dots: 11000000.10101000.00000001.00000001
Without dots: 11000000101010000000000100000001
Pro Tip: For quick mental conversion, memorize the powers of 2: 128, 64, 32, 16, 8, 4, 2, 1. Any decimal 0-255 can be expressed as a combination of these values.
Some addresses get looked up far more than the rest. If you came here for one in particular — 192.168.0.1 in binary, 192.168.1.1 in binary, or one of the lab addresses like 172.16.31.30 in binary that turn up in course exercises — it is in the table below. Each row is a link: open it and the converter loads with that address already done, place-value working included.
A note on wording, because exam questions ask it both ways: the binary equivalent of an address and the address in binary mean exactly the same thing.
Localhost / loopback
127.0.0.1
Router gateway (most common)
192.168.0.1
Router gateway (also very common)
192.168.1.1
Network address of a /24
192.168.1.0
Private host address
192.168.11.10
Private range 10.0.0.0/8
10.0.0.1
Private range 172.16.0.0/12
172.16.31.30
Google Public DNS
8.8.8.8
Cloudflare DNS
1.1.1.1
Subnet mask, /24
255.255.255.0
Broadcast address
255.255.255.255
Unspecified / any address
0.0.0.0
Reading these quickly: 192 is always 11000000 and 168 is always 10101000, so anything on the 192.168.x.y range starts 11000000.10101000. Only the last two octets change, which is why home-network addresses look so similar in binary.
Three of the ranges above — 10.0.0.0, 172.16.0.0 and 192.168.0.0 — are the blocks RFC 1918 section 3 reserves for private networks, written there as the 10/8, 172.16/12 and 192.168/16 prefixes. They are why the same handful of addresses shows up on millions of home routers, and why they are the ones people keep converting. Where those ranges came from originally is the subject of IP address classes A to E.
Subnetting splits one network into smaller ones, and the split happens at a bit position. That is why the work is done in binary: in dotted decimal there is nowhere to point at.
Every address has a network portion, which says which network it belongs to, and a host portion, which says which machine on that network. The subnet mask marks the boundary: its ones cover the network bits and its zeros cover the host bits.
With 192.168.1.100 and a mask of 255.255.255.0, which is /24:
IP address
11000000.10101000.00000001.01100100
Subnet mask
11111111.11111111.11111111.00000000
24 network bits (the ones) · 8 host bits (the zeros)
The first 24 bits identify the network; the last 8 identify the host. Eight host bits give 256 combinations, of which 254 are usable addresses once the network address and the broadcast address are set aside.
A mask is an address, so the method is the same — but there is a shortcut worth knowing. A valid mask is a run of ones followed by a run of zeros with nothing mixed in, which means only nine octet values can ever appear in one. Here they all are:
| Decimal | Binary | Bits set | Appears in |
|---|---|---|---|
| 0 | 00000000 | 0 | /8, /16, /24 — as a trailing octet |
| 128 | 10000000 | 1 | /9, /17, /25 |
| 192 | 11000000 | 2 | /10, /18, /26 |
| 224 | 11100000 | 3 | /11, /19, /27 |
| 240 | 11110000 | 4 | /12, /20, /28 |
| 248 | 11111000 | 5 | /13, /21, /29 |
| 252 | 11111100 | 6 | /14, /22, /30 |
| 254 | 11111110 | 7 | /15, /23, /31 |
| 255 | 11111111 | 8 | /8, /16, /24, /32 — a full octet |
So 255.255.255.192 in binary is 11111111.11111111.11111111.11000000 — 8 + 8 + 8 + 2 = 26 ones, which is /26. Counting the ones is all a CIDR prefix ever is.
A mask with a gap in it is not a mask. 255.255.0.255 looks plausible and converts to 11111111.11111111.00000000.11111111, but the ones are not contiguous, so it cannot be written as a /n prefix and modern equipment will refuse it. If a value outside the nine above turns up in a mask, something is wrong upstream of the arithmetic.
A prefix like /24, /16 or /8 says how many of the 32 bits belong to the network, counted from the left. Nothing more. RFC 4632 section 3.1 puts it as a prefix “followed by the ‘/’ (slash) character, followed by a decimal value between 0 and 32 that describes the number of significant bits”. Once you can see the 32 bits, the notation stops being something to remember and becomes something to read.
If the mask itself is the part that has never quite clicked, what a subnet mask is, explained simply takes it from the beginning. For the ranges, host counts and usable addresses rather than just the bits, use the subnet calculator.
An IPv4 address is 32 bits, so there are 232 of them — 4,294,967,296. That looked limitless in the early 1980s. It is now fewer addresses than there are phones, and the shortage is why IPv6 exists. How IPv4 ran out of addresses is the longer version of that story.
IPv4 — 32 bits
Four 8-bit octets, written in decimal
11000000.10101000.00000001.00000001
About 4.3 billion addresses
IPv6 — 128 bits
Eight 16-bit hextets, written in hexadecimal
2001:0db8:0000:0000:0000:0000:0000:0001
2128 addresses
This converter does IPv4 to binary only, and it will refuse an IPv6 address rather than return something misleading. The arithmetic is not the difficulty — each hexadecimal digit is exactly four bits, so an IPv6 address is 128 binary digits. What differs is the notation: IPv6 allows leading zeros to be dropped and one run of zero groups to be replaced by ::, so the address has to be written out in full before any bit position means anything.
To write an IPv6 address out in full, use the IPv6 expander, and for its 128 bits the IPv6 to binary converter.
Beyond academic understanding, IP binary conversion has real-world applications:
When two devices cannot communicate, comparing their IP addresses in binary reveals if they are on the same network. If the network portions match, they should communicate directly. If not, they need a router.
Firewalls and routers use binary pattern matching with wildcard masks to filter traffic. Understanding binary helps you write accurate ACL rules.
When designing networks, administrators calculate subnet sizes using binary. Knowing that /24 gives 256 addresses (2^8) while /25 gives 128 (2^7) requires binary understanding.
Cybersecurity professionals analyze IP addresses in binary to understand network scans, identify patterns in attacks, and configure intrusion detection systems.
CCNA, CompTIA Network+, and other networking certifications test binary conversion skills. Being able to quickly convert IP to binary mentally gives you an advantage on timed exams.
Every one of those jobs starts the same way: take the address apart into its 32 bits and look at where the boundary falls. That is the whole reason this conversion is worth being able to do without a tool as well as with one.
11000000.10101000.00000000.00000001, or 11000000101010000000000000000001 written without the dots. Working through it octet by octet: 192 is 128+64, 168 is 128+32+8, 0 is nothing at all, and 1 is just the final bit. It is one of the two commonest home-router gateway addresses, which is why it gets looked up so often.
11000000.10101000.00000001.00000001. The only difference from 192.168.0.1 is the third octet: 1 instead of 0, so 00000001 instead of 00000000. Paste either into the converter above and it will show you which place values make up each octet.
Split the address at the dots into four octets, then convert each one on its own. The quickest method is place values: write down 128 64 32 16 8 4 2 1, and work left to right subtracting each value you can. For 168: 128 fits, leaving 40; 64 does not; 32 fits, leaving 8; 16 does not; 8 fits, leaving 0. So the bits under 128, 32 and 8 are 1 and the rest are 0, giving 10101000. Pad every result to eight digits and join the four with dots.
Yes. A bit is a binary digit — one 0 or one 1 — so converting an address to bits and converting it to binary are the same operation. "IP to bin" is the same request again, shortened. Whichever of the three you searched for, the tool above is the one you want.
Exactly 32: four octets of eight bits each. That is the whole reason IPv4 runs out of addresses — 232 is 4,294,967,296, and the internet outgrew that. IPv6 uses 128 bits instead.
11111111.11111111.11111111.00000000. That is the /24 subnet mask: 24 ones followed by 8 zeros. The ones mark the network part of an address and the zeros mark the host part, which is exactly why subnet masks are easier to reason about in binary than in dotted decimal.
The same way as any address, but there is a shortcut: a valid mask only ever uses nine octet values. 0 is 00000000, then 128, 192, 224, 240, 248, 252, 254 and 255 fill in one more bit from the left each time, ending at 11111111. The full table of all nine is further down this page.
One of the four numbers between the dots. The word means a group of eight bits, which is why each one runs from 0 to 255 — that is every value eight bits can hold, 28 = 256 of them counting zero. Anything above 255 in an address is not a typo the tool can fix; it is not a valid address.
Use the place-value row: 128 64 32 16 8 4 2 1. 128 fits into 192 and leaves 64; 64 fits exactly and leaves nothing. So the first two bits are 1 and the rest are 0 — 11000000. Any number from 0 to 255 works the same way, and an octet is always padded to eight digits, so 1 is written 00000001 rather than 1.
Because a leading zero is genuinely ambiguous, and guessing would be worse than refusing. Several C libraries read a leading zero as octal, which makes 010 mean 8, not 10 — so 010.1.1.1 can resolve to 8.1.1.1. A converter that silently assumed decimal would hand you the bits for an address your own system does not agree on. Strip the leading zeros and enter it again.
No — this converter is IPv4 only, and will refuse an IPv6 address rather than produce something misleading. IPv6 is 128 bits against IPv4's 32, and it is written in hexadecimal, so it needs a different tool. The IPv6 expander linked further down this page writes one out in full.
The conversion runs on the server, so the address you submit is sent to TrustMyIP, converted and returned. This page writes nothing to a database. If you would rather nothing left your machine, the place-value method above takes about fifteen seconds per octet once you have done it a few times.
The rest of the address-conversion set, and the calculators that use the bits.
Paste any IPv4 address for the continuous and dotted binary, the four octets, and which place values make up each one — free, and with nothing to sign up for.