Turning Subnet Bits into Dotted-Decimal Numbers
Network work keeps dragging you back into base-2. A subnet mask, a wildcard mask and an access-list entry are all just strings of bits, but every router prompt, every interface configuration and every ticket you write wants those bits back in dotted-decimal form. This page takes one binary octet — or a whole 32-bit string — and gives you the decimal number that belongs in the address field.
11000000 = 128 + 64 = 192 — the first octet of the 192.168.0.0 private range and the value of a /26 mask.Where the Bits Come From
Mask Design on Paper
Captures and Packet Views
The same reading works for any field that is documented in bits rather than bytes: a DSCP value, a VLAN priority, or an option field you are decoding by hand while studying for a certification exam.
Reading an Octet in Three Steps
Type the ones and zeros
The upper field accepts nothing but 0 and 1. Dots, spaces and stray letters never make it into the box, so a mask copied out of a lecture slide arrives clean.
Watch the decimal appear
The lower field updates on every keystroke, so you can add one bit at a time and see the mask value climb through 128, 192, 224 and 240 as you go.
Copy it into the config
The copy button on the decimal field puts the bare number on your clipboard, ready to drop between the dots of an address. Pressing Enter in a field does the same thing.
240 there and the bit pattern appears above it. The swap button opens the decimal-to-binary page with your current value already loaded.Subnet Masks Read Bit by Bit
A legal IPv4 mask is a run of ones followed by a run of zeros, which is why only nine values can ever appear in a mask octet. These are the six you meet most often, together with the prefix length the octet completes when the octets before it are all ones.
| Mask octet in bits | Decimal | Prefix | Usable hosts in that block |
|---|---|---|---|
10000000 | 128 | /25 | 126 |
11000000 | 192 | /26 | 62 |
11100000 | 224 | /27 | 30 |
11110000 | 240 | /28 | 14 |
11111000 | 248 | /29 | 6 |
11111100 | 252 | /30 | 2 |
Only Zeros and Ones Get In
Characters outside base-2 are dropped as you type, so a mask pasted with dots still lands as a clean bit string.
Nibble Spacing While You Read
Long bit strings are shown in groups of four so you can count 32-bit masks without losing your place. The spaces are display only and never copied.
Send a Colleague the Pattern
Add ?v=11111000 to the page address and it opens with that mask already converted — handy in a change ticket or a lab handout.
Questions from the Network Bench
Why can a mask octet never be 190 or 200?
A mask has to be contiguous: every network bit comes before every host bit. That allows only 0, 128, 192, 224, 240, 248, 252, 254 and 255. A value such as 200 would need the pattern 11001000, which switches back to a 1 after a 0 and no longer describes a prefix.
Do leading zeros in my bit string matter?
Not to the arithmetic. 00001010 and 1010 both come out as 10. They matter to you though: an octet is eight positions wide, so keep the padding when you are lining up four octets by eye.
Can I paste all 32 bits of a mask at once?
You can, and you will get the single huge number the whole 32-bit word represents rather than four octets. For dotted-decimal output, feed the eight bits of one octet at a time.
How do I get the wildcard mask from the same bits?
Flip every bit and convert again, or subtract the result from 255. The octet 11110000 gives 240, so its wildcard partner is 15 — the value an access list expects.
Does the copy button add the 0b marker?
Only on the binary side, where copying gives you 0b11000000 for source code. Copying the decimal field gives the plain number 192, which is what a router configuration line needs.
No comments yet. Be the first to comment!