Language
English English Vietnamese (Tiếng Việt) Vietnamese (Tiếng Việt) Chinese (简体中文) Chinese (简体中文) Portuguese (Brazil) (Português do Brasil) Portuguese (Brazil) (Português do Brasil) Spanish (Español) Spanish (Español) Indonesian (Bahasa Indonesia) Indonesian (Bahasa Indonesia)
Binary to Decimal

Binary to Decimal

Type a bit string and read the dotted-decimal value back: mask octets, wildcard values and any header field a diagram prints in ones and zeros.

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.

Each position doubles: reading right to left the weights are 1, 2, 4, 8, 16, 32, 64, 128. Add the weights where a 1 sits. 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

You decide how many host bits a segment needs, write the mask as ones followed by zeros, then have to say it out loud as four numbers.

Captures and Packet Views

Analyser panes and textbook diagrams often print header fields as raw bits; the decimal value is what you compare against the running configuration.

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

1

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.

2

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.

3

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.

Going the other way: the decimal field is a real input too — type 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 bitsDecimalPrefixUsable hosts in that block
10000000128/25126
11000000192/2662
11100000224/2730
11110000240/2814
11111000248/296
11111100252/302

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.

01
0b
0123456789

Mask Octets in Bits

10000000 = 128
11000000 = 192
11100000 = 224
11110000 = 240
11111000 = 248
11111111 = 255

Binary (Base-2)

Masks and header fields live here: eight positions per octet, each worth twice the one to its right.

Decimal (Base-10)

The form an interface configuration accepts, four octets joined by dots and nothing else.

Feed one octet at a time to keep dotted-decimal output
11000000 = 192, the /26 mask octet
Copying the decimal field gives a bare number with no prefix
Append ?v=11110000 to the address to share a pre-filled octet
Want to learn more? Read documentation →
1/5
Start typing to search...
Searching...
No results found
Try searching with different keywords