Skip to main content
Numverto logo NUMVERTO
Published: 4 min read By
binary networking ip address computer science

IP Address in Binary — How IPv4 Addresses Work with Binary

Learn how IPv4 addresses are represented in binary, how subnet masks work, and why networking uses binary. Includes conversion examples and reference table.

Introduction

Every device connected to the internet has an IP address — but did you know that routers and network hardware don’t see 192.168.1.1? They see 32 binary bits: 11000000.10101000.00000001.00000001. Understanding IP addresses in binary is essential for networking courses, subnet calculations, and CCNA/CompTIA exam preparation.

🔧 Convert numbers: Number System Converter — convert any decimal octet (0-255) to binary instantly.

What is an IPv4 Address?

An IPv4 address is a 32-bit number that identifies a device on a network. For human readability, it is written in dotted-decimal notation — four numbers (0-255) separated by dots.

Example: 192.168.1.1

Each number is called an octet because it represents 8 binary bits.

IPv4 Structure

ComponentDecimalBinary (8 bits)
Octet 119211000000
Octet 216810101000
Octet 3100000001
Octet 4100000001
Full Address192.168.1.111000000.10101000.00000001.00000001

Total: 4 octets × 8 bits = 32 bits

Common IP Values in Binary

DecimalBinaryUsage
000000000Network address / any
100000001First host / gateway
12701111111Loopback (localhost)
12810000000Class B start
19211000000Class C start
25511111111Broadcast / mask
1000001010Private network (10.x.x.x)
16810101000Part of 192.168.x.x
17210101100Private (172.16-31.x.x)

Worked Example: Convert 192.168.1.1 to Binary

Step 1: Convert each octet using division-by-2:

192: 192÷2=96R0, 96÷2=48R0, 48÷2=24R0, 24÷2=12R0, 12÷2=6R0, 6÷2=3R0, 3÷2=1R1, 1÷2=0R1 → 11000000

168:10101000

1:00000001 (pad to 8 bits)

1:00000001

Full binary: 11000000.10101000.00000001.00000001

What is a Subnet Mask?

A subnet mask separates the network portion from the host portion of an IP address. Common masks:

Mask (Decimal)Mask (Binary)CIDRHosts
255.0.0.011111111.00000000.00000000.00000000/816M
255.255.0.011111111.11111111.00000000.00000000/1665,534
255.255.255.011111111.11111111.11111111.00000000/24254
255.255.255.12811111111.11111111.11111111.10000000/25126

Rule: 1-bits = network portion, 0-bits = host portion.

How Subnetting Uses Binary

To find the network address: AND the IP with the subnet mask bit by bit.

Example: IP 192.168.1.130 with mask 255.255.255.128 (/25)

IP:   11000000.10101000.00000001.10000010
Mask: 11111111.11111111.11111111.10000000
AND:  11000000.10101000.00000001.10000000 = 192.168.1.128 (network)

Host part: last 7 bits → this host is .130 in the 192.168.1.128/25 subnet.

Why Binary Matters for Networking

  • Subnet calculations — all done in binary using AND operations
  • CIDR notation — /24 means “first 24 bits are network”
  • Routing decisions — routers compare binary prefixes
  • Access Control Lists (ACLs) — wildcard masks use inverse binary
  • Exam questions — CCNA, CompTIA Network+, GATE all test binary IP operations

Common Mistakes

  1. Forgetting to pad to 8 bits — decimal 1 must be 00000001, not just 1
  2. Confusing subnet mask 1s with network bits — consecutive 1s from the left only
  3. Wrong broadcast address — set all host bits to 1, not the full address to 255
  4. Mixing up network/host portions — mask tells you the boundary
  5. Forgetting private vs public ranges — 192.168.x.x, 10.x.x.x, 172.16-31.x.x are private

Frequently Asked Questions

How many bits is an IPv4 address?

32 bits total, divided into 4 octets of 8 bits each. This gives a total of 2³² = 4,294,967,296 possible addresses.

Why is 255.255.255.255 used as broadcast?

All host bits set to 1 means “send to all hosts on this network.” 255 = 11111111 in binary (all bits on).

What is CIDR /24?

/24 means the first 24 bits are the network portion, leaving 8 bits for hosts. This equals subnet mask 255.255.255.0 and allows 254 usable host addresses.

How do I find how many hosts a subnet supports?

Count the number of 0-bits in the subnet mask. Hosts = 2ⁿ − 2 (subtract network and broadcast addresses). For /24: 2⁸ − 2 = 254 hosts.

What is the difference between IPv4 and IPv6?

IPv4 uses 32-bit addresses (4 billion). IPv6 uses 128-bit addresses (340 undecillion) written in hexadecimal groups. IPv6 was created because IPv4 ran out of addresses.

Advertisement

Share this article

Learn Faster with Numverto

Explore free number system converters, binary tools, EMI calculators, GST calculators, and educational guides.

About Numverto

Numverto logo

Numverto Editorial Team

Numverto publishes educational content about number systems, computer science concepts, binary arithmetic, financial calculations, EMI formulas, GST calculations, and practical learning resources for students and professionals.

About | Contact | Editorial Policy

Article Metadata

Tags: binary, networking, ip address, computer science

Last Updated: June 2026

Related Calculators

Advertisement

Related Articles

Popular Tools

View all 13 free tools → · Read tutorials · Number system guide