Keyboard Shortcuts

Ctrl+K
Open search
Esc
Close search / dialog
↑
Back to top

Bytes and Binary

12 minbeginnerModule 1: Fundamentals

Why This Matters

Every file on your computer — including executables, images, and documents — is made of bytes. Understanding bytes is the foundation for understanding any binary format, including ELF.

Without understanding bytes, you can't read hex dumps, debug parsers, or reason about file layouts.

A Simple Model

Think of a byte as a small container that holds a number between 0 and 255. That's it. A byte is just a number.

When you see 0x41 in a hex dump, that's the number 65 in decimal. It happens to be the ASCII code for the letter 'A'.

The Actual Detail

A byte is 8 bits. Each bit is either 0 or 1. So a byte can represent 2^8 = 256 different values (0-255).

We write bytes in hexadecimal (base-16) because it's compact: one byte = exactly two hex digits.

DecimalHexBinaryASCII
00x0000000000NUL
650x4101000001A
1270x7f01111111DEL
2550xff11111111—

A Real Example

The ELF magic number starts with these 4 bytes:

7f 45 4c 46

In decimal: 127, 69, 76, 70. In ASCII: . E L F. That's right — the first four bytes literally spell "ELF".

Try It

Click on each byte to see its decimal, hex, and ASCII values:

7f454c46
Click a byte above

Check Your Understanding

Without looking back: what decimal value does the hex byte 0x41 represent?

Apply It

Here's a hex dump of 4 bytes. What ASCII text do they spell?

48 65 6c 6c

Connect

You now understand bytes — the building blocks of every binary format. Next, we'll see how bytes are organized into larger structures.

Every ELF header, every section, every symbol table entry — they're all just bytes. The format specification tells us how to interpret them.

Fill in the Blank

Complete the code: A byte has bits, and can represent values from 0 to .

← Swipe to navigate →