IP Class Binary

How the first bits of an IPv4 address determine its class — Class A (0), Class B (10), Class C (110), Class D (1110), and Class E (1111) — explained from the binary up.

Global network map showing IP address class binary classification
The Binary Prefix System Class A Class B Class C Class D & E Subnet Masks in Binary Classful vs CIDR FAQ

The Binary Prefix System

Back when the IPv4 address space was first designed, the engineers at the Internet Engineering Task Force (IETF) needed a way to split the 32-bit address space into networks of different sizes. Their solution was classful addressing — a five-class system where the first few bits of the address tell you everything: which class it belongs to, how many network bits there are, and how many host addresses are available.

The system is elegantly simple when you look at it in binary. An IPv4 address is 32 bits long, typically written as four octets (e.g., 192.168.1.1). The first octet's leading bits are the class identifier:

I remember studying IP classful addressing in networking class and thinking the binary patterns were elegant. A Class A starts with 0 (addresses 0-127), Class B with 10 (128-191), and Class C with 110 (192-223). The bit prefix is the entire classification.

Binary Prefix Quick Reference
Class A: 0xxx xxxx . xxxx xxxx . xxxx xxxx . xxxx xxxx
Class B: 10xx xxxx . xxxx xxxx . xxxx xxxx . xxxx xxxx
Class C: 110x xxxx . xxxx xxxx . xxxx xxxx . xxxx xxxx
Class D: 1110 xxxx . xxxx xxxx . xxxx xxxx . xxxx xxxx
Class E: 1111 xxxx . xxxx xxxx . xxxx xxxx . xxxx xxxx

This bit-level prefix system is what makes IP class identification so fast — a router or protocol stack only needs to inspect the first 1 to 4 bits of the first octet to know exactly how to treat an address. It is binary classification at its purest, and understanding it gives you a much deeper intuition for how the early internet was architected.

Class A — First Bit: 0

Class A was designed for the largest networks. With the first bit fixed at 0, the remaining 7 bits of the first octet define the network, and the remaining 24 bits (three octets) define the host. That gives 126 usable networks (27 - 2, subtracting the all-zeros and all-ones reserved networks) and over 16 million hosts per network.

Class A Example: 10.52.14.3 in Binary
Decimal: 10.52.14.3

Binary: 00001010 . 00110100 . 00001110 . 00000011
            |--net--| |--------host-----------|

First bit = 0 Class A
Network ID: 10.0.0.0
Subnet mask: 255.0.0.0 (8 network bits)
Only the first octet identifies the network; the last three identify the host.

In practice, large organizations like MIT, IBM, and HP received Class A blocks back in the 1980s. If you have ever used an address starting with 10 (the RFC 1918 private block) or seen a loopback address like 127.0.0.1, you have encountered Class A addressing. The binary tells the whole story: any address whose first bit is 0, regardless of what the rest of the bits say, is Class A.

Class B — First Two Bits: 10

Class B splits the address evenly: 16 bits for the network and 16 bits for the host. The first two bits are fixed at 10, leaving 14 bits for the network portion. This gives 16,384 possible networks with 65,534 hosts each. It was the sweet spot for mid-sized organizations.

Class B Example: 172.16.42.1 in Binary
Decimal: 172.16.42.1

Binary: 10101100 . 00010000 . 00101010 . 00000001
            |------network------| |----host----|

First two bits = 10 Class B
Network ID: 172.16.0.0
Subnet mask: 255.255.0.0 (16 network bits)
The network is identified by the first two octets; the host by the last two.

The 172.16.0.0/12 private range falls entirely within Class B territory. If you have worked with corporate networks, VPNs, or internal lab setups, you have almost certainly used addresses in this range. The binary tells you immediately: if the first two bits are 10, the first octet falls between 128 and 191, and you have 16 bits of host space to work with.

Class C — First Three Bits: 110

Class C is the most common class for small networks. It uses 24 bits for the network and only 8 bits for the host, giving 254 usable addresses per network (28 - 2). There are over 2 million possible Class C networks. The three fixed bits (110) leave 21 bits for network identification.

Class C Example: 192.168.1.100 in Binary
Decimal: 192.168.1.100

Binary: 11000000 . 10101000 . 00000001 . 01100100
            |----------network--------------| |host|

First three bits = 110 Class C
Network ID: 192.168.1.0
Subnet mask: 255.255.255.0 (24 network bits)
The first three octets identify the network; the last octet identifies the host.

The 192.168.0.0/16 private range is the most recognizable Class C block globally. Every home router ships with a default network in this range. The limitation is obvious when you look at the binary: with only 8 host bits, the maximum is 254 devices per network — fine for a home or small office, but impossible for a large organization. That is exactly why Class A and B existed, and also why classful addressing ultimately gave way to CIDR.

Class D — First Four Bits: 1110 and Class E — First Four Bits: 1111

Class D (1110) is reserved for multicast groups. Unlike Class A, B, and C, Class D addresses do not have a network/host split — the entire 32-bit address identifies a multicast group. When a host sends a packet to a Class D address, it is delivered to every host that has joined that multicast group. Protocols like IGMP and streaming video services use multicast extensively.

Class D Multicast Example: 224.0.0.1 in Binary
Decimal: 224.0.0.1

Binary: 11100000 . 00000000 . 00000000 . 00000001

First four bits = 1110 Class D
Address: 224.0.0.1 = "all hosts on this subnet"
No network/host split — the whole address is the group ID.
Class D (224.0.0.0 to 239.255.255.255) is purely for multicast group membership.

Class E (1111) was reserved for future and experimental use. It ranges from 240.0.0.0 to 255.255.255.255. In practice, Class E addresses are almost never used on the public internet — most operating systems and routers will not route them. The broadcast address 255.255.255.255 (binary: all 32 bits set to 1) technically falls within Class E space, though it serves a separate purpose.

Class E Binary Example: 240.10.20.30
Decimal: 240.10.20.30

Binary: 11110000 . 00001010 . 00010100 . 00011110

First four bits = 1111 Class E
Range: 240.0.0.0 to 255.255.255.255
Status: Reserved / Experimental
Class E addresses are not routable on the public internet and are treated as invalid by most network stacks.

Subnet Masks in Binary

The subnet mask is how you separate the network bits from the host bits. In classful addressing, each class had a default mask baked in. Seeing these masks in binary makes the pattern immediately obvious — network bits are all 1s, and host bits are all 0s.

Default Classful Subnet Masks in Binary
Class A: 11111111 . 00000000 . 00000000 . 00000000 = 255.0.0.0 (/8)
Class B: 11111111 . 11111111 . 00000000 . 00000000 = 255.255.0.0 (/16)
Class C: 11111111 . 11111111 . 11111111 . 00000000 = 255.255.255.0 (/24)

Notice the pattern: the contiguous block of 1s in the mask directly corresponds to the network portion of the address. A Class A mask has 8 consecutive 1s, Class B has 16, and Class C has 24. This is the same concept that CIDR notation uses today — /8, /16, /24 are the exact same binary masks.

Classful vs CIDR: Why Binary Prefixes Still Matter

Here is the thing that surprises most people: classful addressing was officially deprecated in 1993 with the introduction of CIDR (Classless Inter-Domain Routing, RFC 1519). The internet had grown so fast that the rigid class system was wasting huge chunks of address space. A company that needed 300 addresses could not get a Class C (254 addresses — too few) and had to take a Class B (65,534 addresses — massive waste). The math simply did not add up.

CIDR solved this by removing the fixed class boundaries entirely. Instead of assuming the network/host split from the first few bits, CIDR uses an explicit prefix length written as /N. A /26 gives 62 usable addresses, a /27 gives 30, and a /28 gives 14. You get exactly what you need and nothing more.

But here is the important part: the binary prefix logic from classful addressing is not dead. Every CIDR subnet mask is still a contiguous block of 1s followed by 0s. When you write 255.255.255.192 as 11111111.11111111.11111111.11000000, you are doing exactly the same binary masking that Class A/B/C routers did in 1983. The binary fundamentals never changed — only the boundaries did. Understanding IP class binary gives you a rock-solid foundation for subnetting, VLSM, and route aggregation regardless of whether you use classful or classless notation.

Work with Binary IP Addresses

Use our programming calculators to convert IP addresses between decimal, hex, and binary. See the 32-bit representation of any IP and understand how the bits map to network and host portions.

Frequently Asked Questions About IP Class Binary

What is IP class binary classification?

IP class binary classification is the traditional method of dividing the IPv4 address space into five classes (A through E) based on the first few bits of the 32-bit binary address. Class A starts with 0, Class B with 10, Class C with 110, Class D with 1110, and Class E with 1111. The first bits determine the network/host boundary and the total number of available networks and hosts per class.

How can you tell if an IP is Class A, B, or C in binary?

Look at the first bits of the 32-bit binary representation. If the first bit is 0, it is Class A. If it starts with 10, it is Class B. If it starts with 110, it is Class C. If it starts with 1110, it is Class D (multicast). If it starts with 1111, it is Class E (reserved). This is a simple binary prefix check that a router or protocol stack can perform at wire speed.

What are the binary subnet masks for each IP class?

Class A uses subnet mask 255.0.0.0 (binary: 11111111.00000000.00000000.00000000), meaning 8 network bits and 24 host bits. Class B uses 255.255.0.0 (binary: 11111111.11111111.00000000.00000000), meaning 16 network bits and 16 host bits. Class C uses 255.255.255.0 (binary: 11111111.11111111.11111111.00000000), meaning 24 network bits and 8 host bits.

What is the binary range for Class D and Class E IP addresses?

Class D addresses range from 224.0.0.0 to 239.255.255.255. In binary, the first four bits are 1110, so the first octet falls between 11100000 (224) and 11101111 (239). Class E addresses range from 240.0.0.0 to 255.255.255.255, with the first four bits being 1111, so the first octet falls between 11110000 (240) and 11111111 (255). Class D is used for multicast groups and Class E is reserved for experimental use.

Why was IP classful addressing replaced by CIDR?

Classful addressing wasted a massive amount of IP space. A Class A network contained over 16 million addresses, far too many for most organizations. A Class C network contained only 254 addresses, often too few. This led to rapid IPv4 exhaustion. CIDR (Classless Inter-Domain Routing), introduced in 1993, replaced fixed classes with variable-length subnet masks (VLSM), allowing network engineers to carve out exactly the number of addresses needed — for example, a /27 gives 30 host addresses with no wastage.

Related Tools

Bitwise Calculator →

AND, OR, XOR, NOT, shifts

Bitwise Guide →

Complete operations reference

Hex to ASCII →

Decode hex strings

SHA256 Generator →

Compute hashes