Back to portfolioUTILITIES / PLAYGROUND

Cybersecurity Playground

Interactive, sandboxed client-side utilities to inspect network configurations, parse tokens, matching strings, and test basic binary formats.

Memory in Computer: Bits & Bytes

At the lowest level, all computer data is stored as electrical signals—either ON (1) or OFF (0). These single states are called Bits. To represent complex data like text or colors, we group these bits together into Bytes, and use numbering systems like Decimal, Hexadecimal, and Octal to read them.

Interactive Lesson

Understanding scale step-by-step

Click 'Play Video' to start the interactive lesson.

Interactive Lesson: Deep Dive Math

Detailed visual math for conversions

Click 'Play Video' to learn Number Conversions.

Bit (Binary Digit)

The smallest unit of data in a computer. It has a single binary value: either 0 or 1.

Byte (8 Bits)

A group of 8 bits. It is the basic building block for memory. A single Byte can represent 256 different values (0 to 255).

Numbering Systems

Binary (Base-2)

The language of computers. It uses only 2 digits (0 and 1). Example: 11111111 (which equals 255 in decimal).

Quaternary / Tetra (Base-4)

A system grouping bits into twos. It uses 4 digits (0-3). Every quaternary digit represents exactly two bits. Example: 33 (which equals 15 in decimal).

Octal (Base-8)

An older system grouping bits into threes. It uses 8 digits (0-7). It is rarely used today outside of Linux file permissions. Example: 377.

Decimal (Base-10)

The standard numbering system we use daily. It uses 10 digits (0-9). Example: 255.

Hexadecimal (Base-16)

A compact way to read binary. It uses 16 symbols (0-9, A-F). Two hex digits represent one full byte perfectly. Example: FF.

BaseNameDigitsBinary Relationship
2Binary0–11 bit per digit
4Quaternary0–32 bits per digit
8Octal0–73 bits per digit
10Decimal0–9None
16Hexadecimal0–9, A–F4 bits per digit

Data Units Scale

1 KB
Kilobyte
1,024 Bytes
~ A short paragraph of text
1 MB
Megabyte
1,024 Kilobytes
~ A small high-quality photograph
1 GB
Gigabyte
1,024 Megabytes
~ A high-definition movie
1 TB
Terabyte
1,024 Gigabytes
~ A massive library of 250,000 photos
1 PB
Petabyte
1,024 Terabytes
~ 20 million tall filing cabinets of text
1 EB
Exabyte
1,024 Petabytes
~ All words ever spoken by mankind (5 EB)
1 ZB
Zettabyte
1,024 Exabytes
~ Total internet traffic worldwide in 1 year
1 YB
Yottabyte
1,024 Zettabytes
~ Too big to measure! (1 Trillion Terabytes)

Lesson Notes: Step-by-Step Conversions

⚠️ Pro Tip: Decimal vs. Binary Sizes (KB vs. KiB)

Ever noticed that a 1 Terabyte hard drive only shows up as ~931 Gigabytes in Windows? That is because of how sizes are measured:
Decimal Scale (SI): Hard drive manufacturers use base-10. 1 KB = 1,000 Bytes.
Binary Scale (IEC): Operating systems use base-2. 1 KiB (Kibibyte) = 1,024 Bytes.
Windows measures in binary (Gibibytes) but labels it as "GB," causing confusion!

1. Binary to Decimal

Assign powers of 2 (starting from 1 on the far right, and doubling each time: 1, 2, 4, 8, 16, 32, 64, 128) to each bit. Add up the powers where the bit is a 1.

1286432168421
10101111
128 + 32 + 8 + 4 + 2 + 1 = 175

💡 Reverse (Decimal to Binary): Divide the decimal number by 2 repeatedly and write down the remainders from bottom to top!

2. Binary to Hexadecimal

Split the 8 bits perfectly in half into two 4-bit "nibbles". Calculate the decimal value of each nibble independently (from 0 to 15). If a value is between 10 and 15, replace it with a letter (A=10, B=11, C=12, D=13, E=14, F=15).

Left Nibble: 1010
Math: 8 + 0 + 2 + 0 = 10
Value: A
Right Nibble: 1111
Math: 8 + 4 + 2 + 1 = 15
Value: F
Final Hexadecimal: AF

3. Binary to Quaternary (Base-4)

Split the 8 bits into four 2-bit groups (dyads). Calculate the decimal value of each group independently (from 0 to 3).

Group 1: 10
Math: 2 + 0 = 2
Value: 2
Group 2: 10
Math: 2 + 0 = 2
Value: 2
Group 3: 11
Math: 2 + 1 = 3
Value: 3
Group 4: 11
Math: 2 + 1 = 3
Value: 3
Final Quaternary: 2233

4. Binary to Octal

Start from the far right side, and split the bits into groups of three. Calculate the decimal value of each small group (from 0 to 7) independently.

Left Group: 10
Math: 2 + 0 = 2
Value: 2
Middle Group: 101
Math: 4 + 0 + 1 = 5
Value: 5
Right Group: 111
Math: 4 + 2 + 1 = 7
Value: 7
Final Octal: 257

Live Number Converter

Binary (Base-2)11111111
Hexadecimal (Base-16)0xFF
Octal (Base-8)0o377

Comparison Table

DecimalBinaryHexOctal
0000000
1000111
2001022
3001133
4010044
5010155
6011066
7011177
81000810
91001911
101010A12
111011B13
121100C14
131101D15
141110E16
151111F17