LearnViz CompSci
Home / Learn / Computer Architecture & Logic / Hexadecimal and Octal

Beginner Topic 2 of 51 Computer Architecture & Logic

Hexadecimal and Octal

Compact base-16 and base-8 notations for binary data.

How it works

Hexadecimal is base 16, using digits 0 to 9 and A to F, and octal is base 8. Each hex digit stands for exactly four bits and each octal digit for three, so conversion to and from binary is a simple grouping with no arithmetic. This makes long bit patterns compact and readable for humans.

Where it is used

Memory addresses, color codes like #FF8800, MAC addresses, machine-code dumps and debugger output use hex. Unix file permissions such as 755 use octal. Programming languages mark them with prefixes like 0x and 0o.

Common pitfall

Leading-zero octal literals such as 010 equal 8 in some languages and surprise newcomers. Mixing up letter case or forgetting the base prefix causes misreads. Pad to full digits when comparing, and remember that hex is only a notation: the machine still stores binary.

Where it fits in the course

Hexadecimal and Octal is topic 2 of 51 in Computer Architecture & Logic, rated Beginner. It follows Binary Number System. The next topic is Two's Complement.

Practice and explore

How to study this topic

  1. Read the explanation above and restate the definition in your own words.
  2. Open the interactive lesson and answer its mini quiz.
  3. Read the common pitfall, then write a short example that avoids it.
  4. Check your understanding in the Computer Architecture & Logic quiz, and revisit the topic if you miss a question.

Frequently asked questions

What is Hexadecimal and Octal?
Compact base-16 and base-8 notations for binary data. It belongs to Computer Architecture & Logic and is a beginner-level topic.
Where do people use Hexadecimal and Octal?
Memory addresses, color codes like #FF8800, MAC addresses, machine-code dumps and debugger output use hex.
What is the most common mistake with Hexadecimal and Octal?
Leading-zero octal literals such as 010 equal 8 in some languages and surprise newcomers.
What should I learn before this topic?
Start with Binary Number System, the topic just before it in Computer Architecture & Logic.
How can I practice it?
Answer the mini quiz in the interactive lesson, then take the Computer Architecture & Logic quiz. You can also explore Binary & Two's Complement in the Visual Lab.
Is Hexadecimal and Octal hard to learn?
It is a Beginner topic, so it works as an entry point. If the terms are new, read the explanation twice and try the visualizer before the quiz.
How long does it take to learn Hexadecimal and Octal?
Most learners can read the explanation and finish the interactive lesson in under an hour. Fluency comes from applying the idea, so plan a few short practice sessions with the quiz.
Which topics are related to Hexadecimal and Octal?
Binary Number System, Two's Complement, Floating Point Representation are closely connected. The full list is in the related topics section of this page.
What should I study after Hexadecimal and Octal?
Continue with Two's Complement, the next topic in Computer Architecture & Logic.

Related topics