openskills.info
Course Preview

Binary Data and Encoding

Binary data and encoding covers how computers represent, store, and transmit information below the text layer: number systems, byte ordering, character encodings, serialization formats, and the conversions needed when moving data between systems that make different assumptions about representation.

itComputer fundamentals

Binary Data and Encoding

Computers store and move bits. A bit has one of two values: zero or one. Eight bits form a byte, which can represent 256 distinct bit patterns. Those patterns have no built-in meaning.

Consider the byte 01000001. You can interpret it as the unsigned integer 65. In UTF-8, it encodes the letter A. In an image, the same pattern might be one color channel. The bits do not tell you which interpretation is correct. A data format does.

This is the central idea of binary data: representation and meaning are separate. To read bytes correctly, you need metadata or a shared agreement about type, width, byte order, and encoding.

Build values from bits

Binary is a positional numeral system with base two. Each position has a power-of-two weight.

bits:     1  0  1  1  0  1  1  0
weights:128 64 32 16  8  4  2  1
value:  128 + 32 + 16 + 4 + 2 = 182

An unsigned byte covers values from 0 through 255. More bytes provide more patterns. A 16-bit field has 65,536 patterns, while a 32-bit field has more than four billion.

Hexadecimal is a compact way to write bits. Each hexadecimal digit represents four bits, so two digits represent one byte. The byte above is B6 in hexadecimal. Hex dumps, protocol documents, file signatures, memory addresses, and debugging tools use hexadecimal because byte boundaries stay visible.

Continue the course

This section is part of the paid course.

See pricing to subscribe, or log in if you already have access.

Sources

  • https://csrc.nist.gov/glossary/term/byte
  • https://www.unicode.org/versions/Unicode17.0.0/core-spec/chapter-2/
  • https://www.unicode.org/versions/Unicode17.0.0/core-spec/chapter-3/
  • https://www.rfc-editor.org/info/rfc3629/
  • https://www.rfc-editor.org/info/rfc4648/
  • https://www.rfc-editor.org/rfc/rfc3550.html#section-4
  • https://www.rfc-editor.org/rfc/rfc2910.html
  • https://standards.ieee.org/ieee/754/6210/