Octet: Why an IPv4 Number Stops at 255
An octet is eight bits: eight positions, each holding a zero or a one. That small group has 256 possible patterns. It explains why the dotted numbers in an Internet Protocol version 4 (IPv4) address can go as high as 255, but no higher.
A bit has two possible values. Every additional bit doubles the number of combinations: two bits have four patterns, three have eight, and eight have 256.
If those eight bits represent a whole number without a positive-or-negative sign, counting starts at zero. The 256 possibilities therefore run from 0 through 255.
| Eight-bit pattern | Value as an unsigned number |
|---|---|
00000000 | 0 |
00000001 | 1 |
11111111 | 255 |
The octet tells you how much data there is. The rules of the file or communication format tell you what that data means.
Why the Internet Is Running Out of Addresses
Four groups behind an IPv4 address
An IPv4 address contains 32 bits, divided into four octets. In the familiar dotted form, each octet appears as a decimal number.
Take the example address 192.168.1.1. The number 192 displays the value of its first octet. It has three printed digits, but it still represents eight bits. Each following number represents another eight-bit group.
The internet address syntax specification defines this dotted-decimal IPv4 form, with each field limited to 0 through 255. A field containing 256 wouldn't fit its one-octet range.
This count belongs specifically to IPv4. Internet Protocol version 6, or IPv6, uses 128-bit addresses, which equals 16 octets. The IPv6 specification defines that larger width. “IP address” by itself doesn't tell you that there are four octets; the version matters.
The address identifies a network destination. Octets give us a precise way to count the data used to express it.
Why use “octet” when “byte” is familiar?
In modern usage, a byte normally means eight bits, too. The two words therefore describe the same amount in an ordinary eight-bit-byte system.
Historically, byte sizes could differ. The Internet Security Glossary uses octet to make the eight-bit width explicit. That precision is useful in a protocol specification, where both ends need to agree on exactly how much data a field contains.
A requirement for four octets means 32 bits. It doesn't depend on how many decimal digits someone uses to display their values.
- Get five gigabit ports and a fast ARM processor for the price of a basic home router.
- Practice real routing at your desk on gear that network pros also deploy.
- Tuck it beside your modem: it takes up almost no room.
A character follows its encoding
Text adds a different kind of interpretation. The letter A is a character. Its stored representation depends on the encoding, the rules that turn characters into data.
Unicode assigns numbered values called code points to characters. UTF-8 is one way to encode those code points, using between one and four octets per code point. Its specification defines those lengths.
Uppercase A takes one octet in UTF-8. The single code point for é takes two. Other code points can need three or four. Counting the characters visible on a screen therefore doesn't reliably give the length of the stored data.
A program checking a length in octets counts eight-bit groups, even when a reader sees only a single character represented by several of them.
What Is a Bit? A Small Unit With an Eightfold Catch

Byte: Why One Character Can Take More Than One Byte

IP Addresses: Why Your Device Can Have More Than One

QUOTE:
"Amateurs hack systems, professionals hack people."
