Binary to Decimal Convertor

Whenever a router decides to forward a piece of a packet, it performs a calculation. Most network engineers have done that check by hand at some point. Bit by bit. Figuring out the network ID. That whole process depends on moving between binary and decimal without freezing up. Honestly? If you’ve ever stared at 11000000.10101000.00000001.00000001 and felt your eyes glaze over, yeah, me too.

This guide is for you. We’ll walk through why binary is the real language of IPv4. How the conversion math actually works (no memorization required—I promise). And how tools like SubnetLab’s converter let you double-check your work fast.

By the end, turning an octet like 11000000 into 192 will feel kinda natural. Like reading a postcode. Or at least, not terrifying. You can’t really get subnetting until you see why 255 equals 11111111 and 192 equals 11000000. Everything else in IP networking follows from that.

Binary to Decimal Converter

Binary to Decimal

Enter a binary number (0s and 1s) to get its decimal value

Binary Input

Only 0s and 1s – up to 32 digits.

Decimal Result

Decimal Equivalent:
0

Why Binary is Important in IPv4

You will learn:

  • Why IPv4 uses binary numbers
  • How binary and decimal conversion works
  • How subnet masks work
  • Easy examples you can understand quickly
  • How to find the network ID, broadcast address, and usable host range
  • The difference between IP address classes and why it still matters
  • How to convert between hexadecimal and binary for IPv6

After using this tool, conversion from binary numbers into decimal numbers will be easier for you.

Important Binary Values

Decimal Value Binary Value
255 11111111
192 11000000

Once you clearly understand these values, subnetting and IP addressing become much easier to understand.

Example IPv4 address: 192.168.1.100 is a human-friendly decimal representation because it’s easy to remember. Routers only understand binary language: 0, 1.

Each octet can range from: 00000000 to 11111111 Which equals: 0 to 255 in decimal

Quick Reference Table

Item Value
Total IPv4 size 32 bits
Octets 4
Bits per octet 8
Binary range 00000000 to 11111111
Decimal range 0 to 255
Total IPv4 addresses 4,294,967,296

Learn Binary Position Values

Binary uses base 2. Each position has a value:

Binary Position Value
1st 128
2nd 64
3rd 32
4th 16
5th 8
6th 4
7th 2
8th 1

To convert binary to decimal:

  • Add the values where the bit is 1
  • Ignore the values where the bit is 0 That’s the full method.

Example 1 — Convert 11000000 to Decimal

Binary:

11000000

Now match the bits with values:

128 64 32 16 8 4 2 1

1 1 0 0 0 0 0 0

Only 128 and 64 are active.

128 + 64 = 192

So:

11000000 = 192

Example 2 — Full IP Address Conversion

IP Address:

192.168.1.1

Binary form:

Decimal Binary
192 11000000
168 10101000
1 00000001
1 00000001

For 168:

10101000

Active values are:

128 + 32 + 8 = 168

Understanding Subnet Masks

Subnet masks also use binary. Example subnet mask: 255.255.255.0 Binary version: 11111111.11111111.11111111.00000000

The 1s show the network portion. The 0s show the host portion. CIDR notation is a short form of subnet masks. Example: /24 means: 24 ones in the subnet mask. So: 11111111.11111111.11111111.00000000 equals: 255.255.255.0

Example 3 — Finding Network ID

Suppose:

  • IP Address = 192.168.1.55
  • Subnet Mask = 255.255.255.0

Binary form:

IP Address 11000000 10101000 00000001 00110111

Subnet Mask 11111111 11111111 11111111 00000000

When we apply the AND operation:

| Result | 11000000 | 10101000 | 00000001 | 00000000 |

Decimal result: 192.168.1.0 This is the network ID.

Example 3B — Finding the Broadcast Address

Once you have the network ID, the broadcast address is easy to find: flip every host bit (the 0s in the subnet mask) to 1, then convert back to decimal.

Using the same example:

  • Network ID = 192.168.1.0
  • Subnet Mask = 255.255.255.0 (host bits are the last 8 bits)

Last octet with all host bits set to 1:

00000000 → 11111111 = 255

So the broadcast address is: 192.168.1.255

The broadcast address is always the “top” of the range, and the network ID is always the “bottom.” Everything in between is usable by hosts.

Example 3C — Finding the Usable Host Range

For a /24 network (192.168.1.0/24):

  • Network ID: 192.168.1.0 (not assignable to a host)
  • First usable host: 192.168.1.1
  • Last usable host: 192.168.1.254
  • Broadcast address: 192.168.1.255 (not assignable to a host)

Rule of thumb: the usable range is always network ID + 1 through broadcast − 1.

Calculating Number of Hosts and Subnets

This is where binary really pays off, because both numbers come from powers of 2.

Number of usable hosts per subnet: 2^(host bits) − 2

The “−2” removes the network ID and the broadcast address, since neither can be assigned to a device.

Number of subnets created: 2^(borrowed bits)

“Borrowed bits” are the bits taken from the host portion and given to the network portion when you subnet.

Example: Take 192.168.1.0/24 and subnet it into /26 blocks.

  • Original host bits for /24: 8
  • New host bits for /26: 6
  • Borrowed bits: 24 → 26 = 2 bits borrowed
  • Subnets created: 2^2 = 4
  • Hosts per subnet: 2^6 − 2 = 62

This matches the Hosts column in the Common Subnet Masks table below — /26 shows 62 usable hosts.

Common Subnet Masks

CIDR Subnet Mask Hosts
/8 255.0.0.0 16,777,214
/16 255.255.0.0 65,534
/24 255.255.255.0 254
/25 255.255.255.128 126
/26 255.255.255.192 62
/27 255.255.255.224 30
/28 255.255.255.240 14
/29 255.255.255.248 6
/30 255.255.255.252 2

As subnet masks grow larger, available hosts become smaller.

Decimal to Binary Conversion

You can also convert decimal numbers into binary. Example: Convert 172 into binary. Start from 128 and move down.

Value Fits?
128 Yes
64 No
32 Yes
16 No
8 Yes
4 Yes
2 No
1 No

Binary result: 10101100

Check: 128 + 32 + 8 + 4 = 172

Correct.

Example — Convert 201 into Binary

Value Fits?
128 Yes
64 Yes
32 No
16 No
8 No
4 No
2 No
1 Yes

Binary result: 11001001

Check: 128 + 64 + 8 + 1 = 201

Correct.

Common Binary Values

Decimal Binary
0 00000000
1 00000001
10 00001010
128 10000000
168 10101000
172 10101100
192 11000000
224 11100000
240 11110000
248 11111000
252 11111100
254 11111110
255 11111111

IP Address Classes (Classful Addressing)

Before CIDR became the norm, IPv4 addresses were divided into classes based on the value of the first octet’s leading bits. You’ll still see this terminology in certification material and legacy documentation, so it’s worth knowing.

Class First Octet Range Leading Bits Default Mask Typical Use
A 1–126 0 255.0.0.0 (/8) Very large networks
B 128–191 10 255.255.0.0 (/16) Medium/large networks
C 192–223 110 255.255.255.0 (/24) Small networks
D 224–239 1110 N/A Multicast
E 240–255 1111 N/A Experimental/reserved

Note that 127 is skipped in Class A — that entire range is reserved for loopback testing (127.0.0.1 is the classic “localhost” address).

Modern networks mostly use CIDR (/8, /24, /27, and so on) instead of strict classes, but the binary logic is identical either way — it’s still about counting 1s and 0s in the mask.

Private vs Public IP Addresses

Not every address is routable on the public internet. Certain binary ranges are reserved for private, internal use:

Class Private Range CIDR
A 10.0.0.0 – 10.255.255.255 10.0.0.0/8
B 172.16.0.0 – 172.31.255.255 172.16.0.0/12
C 192.168.0.0 – 192.168.255.255 192.168.0.0/16

Any address outside these ranges is generally public and reachable over the internet (subject to other reserved blocks like multicast and loopback). This is why almost every home router hands out addresses starting with 192.168 — it’s a private range by design, not by accident.

Real Networking Uses

Access Control Lists (ACLs)

Wildcard masks are used in Cisco routers. Example: 10.0.0.0 0.255.255.255 Wildcard masks are the opposite of subnet masks. They help routers decide which IP addresses match a rule.

Worked wildcard mask example:

A subnet mask of 255.255.255.0 becomes a wildcard mask by inverting every bit:

11111111.11111111.11111111.00000000 (subnet mask) 00000000.00000000.00000000.11111111 (wildcard mask, inverted)

In decimal, that’s 0.0.0.255. So an ACL line like

permit 192.168.1.0 0.0.0.255

matches every address from 192.168.1.0 through 192.168.1.255 — the same range a /24 subnet mask would define, just expressed in reverse (0s mean “must match,” 1s mean “don’t care”).

VLSM

VLSM helps divide networks into smaller subnetworks of different sizes, so you don’t waste addresses on a link that only needs 2 hosts (like a router-to-router connection) by giving it a full /24.

Example: A /28 subnet has: 11110000 in the last octet. That means blocks increase by 16: 0, 16, 32, 48, and so on.

So from a single 192.168.1.0/24 network, VLSM might carve out:

  • 192.168.1.0/26 (62 hosts) for a large office
  • 192.168.1.64/27 (30 hosts) for a smaller office
  • 192.168.1.96/30 (2 hosts) for a router link

Each subnet’s size is still governed by the same binary math from the “Calculating Number of Hosts and Subnets” section above.

IPv6

Hexadecimal values are used in IPv6 because it does not accept decimal, but binary still works the same way. CIDR notation like /64 still means network bits.

Since hex shows up here, it helps to know the conversion. Each hex digit maps to exactly 4 binary bits:

Hex Binary Hex Binary
0 0000 8 1000
1 0001 9 1001
2 0010 A 1010
3 0011 B 1011
4 0100 C 1100
5 0101 D 1101
6 0110 E 1110
7 0111 F 1111

An IPv6 address like 2001:0db8::1 is written in groups of 4 hex digits (16 bits each), for a total of 128 bits — four times the length of an IPv4 address. The same “add up the active bit values” logic from earlier still applies; you’re just working in groups of 4 bits instead of 8.

Frequently Asked Questions

Why does an IPv4 octet stop at 255?

Because 8 bits can only store values from 0 to 255. 11111111 is the largest possible 8-bit binary number.

What is the difference between subnet mask and wildcard mask?

  • Subnet masks use 1s for network bits
  • Wildcard mask uses 1s for variable bits. Wildcard masks are commonly used in Cisco ACLs.

Is binary important for CCNA? Yes. Binary understanding is very important for:

  • Subnetting
  • CIDR
  • VLSM
  • Network calculations

Why is the network ID and broadcast address never assigned to a device? They’re reserved so routers can identify the subnet itself (network ID) and send a message to every host on it at once (broadcast). That’s why the host-count formula subtracts 2 from the total addresses in a subnet.

Common mistakes to avoid:

  • Forgetting to subtract 2 when calculating usable hosts
  • Mixing up which bits are “network” vs “host” when reading a mask
  • Assuming a /24 always means 192.168.x.x — CIDR is independent of class
  • Applying the AND operation incorrectly by forgetting to convert both the IP and mask to binary first

Open the Binary to Decimal Converter →

Final Words

Binary-to-decimal conversion will be easy for you after using our simple tool. You will also learn the following things as described below:

  • Learn the binary position values
  • Practice common subnet masks
  • Convert numbers regularly
  • Practice finding the network ID, broadcast address, and usable host range together
  • Get comfortable moving between binary and hex for IPv6

Once you understand binary, subnetting and networking become much easier to understand.