Binary, Hexadecimal & Decimal: learn number systems
Binary, Hexadecimal & Decimal is an interactive course to learn binary and hex from scratch. Its 24 short sections cover place value, converting between binary, decimal and hexadecimal in every direction, bits, nibbles and bytes, binary addition, overflow and hex colour codes, with a converter, animation or practice question in every one.
Computers store everything as 0s and 1s. Binary is how they count, and hexadecimal is the shorthand people use to write binary without getting lost in long strings of digits.
What the course covers
| Sections | Topic | What you do |
|---|---|---|
| 1 to 4 | Bits, place value and binary to decimal | Flip eight bit switches and watch the value change, then convert binary to decimal |
| 5 to 7 | Counting in binary, and bits, nibbles and bytes | Watch binary and decimal counters roll over together, then sort numbers by how many bits they need |
| 8 to 9 | Decimal to binary | Convert a number place by place, then do one yourself |
| 10 to 14 | Hexadecimal: hex to decimal and back | Step through 0 to F, then convert two-digit hex numbers both ways |
| 15 to 16 | Binary and hex by nibbles | Split a byte into two nibbles and match each to its hex digit |
| 17 to 20 | Binary addition and overflow | Add in columns with carries, then see what a 4-bit register holds when a sum is too big |
| 21 to 22 | Hex colour codes | Mix red, green and blue from 0 to 255 and read the hex code |
| 23 to 24 | Where each base is used, and mixed conversions | Convert one value into the other two bases |
Binary and decimal
Every number system works by place value. In decimal each place is worth 10 times the one to its right; in binary each place is worth 2 times, so a byte's places are 128, 64, 32, 16, 8, 4, 2 and 1. Converting is adding the places with a 1 in them, and going back is fitting the biggest place value you can, writing 1 and subtracting, then moving right.
Hexadecimal
Hex is base 16, using 0 to 9 and then A to F for 10 to 15. One hex digit is exactly four bits, a nibble, so any byte is two hex digits: split it in half and convert each half. That is why hex appears in colour codes such as #FF8800, memory addresses and error codes.
Doing arithmetic
Binary addition works like column addition, except 1 + 1 makes 10, so you write 0 and carry 1. If the answer needs more bits than the computer has room for, the extra carry is lost, which is called an overflow error.
Try a question from the course
To turn binary into decimal, write the place values over the bits and add the ones under a 1. Take 11010110: its 1s sit under 128, 64, 16, 4 and 2, which add up to 214.
Now convert a new binary number, then press Mark to check your answer in the course.
Type the decimal value of a random 4 to 8 bit number.
Press Mark to have your answer marked in the Binary, Hexadecimal & Decimal course.
Who this course is for
- GCSE and other secondary computing students revising binary, hex, conversions, binary addition and overflow.
- Beginner programmers who keep meeting hex in colour codes, memory addresses and file formats.
- Anyone curious about how a computer can store numbers, text and colours with only two symbols.
What you need to know first
Just everyday arithmetic: adding, subtracting and doubling. The course starts by looking again at how ordinary decimal place value works, then builds binary on top of it.
How long it takes
There are 24 sections, and most take a few minutes. Practice questions use random numbers, so you can repeat them until conversions are quick. Learners without a plan can open two sections of a course a day, in order, so the whole course takes 12 days. A plan removes the daily limit and lets you go straight to any topic, such as hex or overflow.
Common questions
Is this binary course free?
How do you learn binary quickly?
Why do computers use binary?
Why use hexadecimal?
What is the largest number in 8 bits?
What is an overflow error?
Revision cards
Say the answer first, then flip the card to check it.
Where to go next
- Solve it
Number Base Converter
Convert between binary, hex and decimal and add in binary
Open the tool - Learn it
Binary, Hexadecimal & Decimal
How computers count, and how to convert between number systems
Start the course - Test it
GCSE Computer Science
A new exam-style paper every day, with instant marking and a mark scheme
Start today's paper