Homeschool · Math · Ages 10 and up
Hexadecimal and Binary
Computers count in twos; people who work with them read those numbers in sixteens. Learn how other number bases work, convert between them, read color codes and letter codes, and send a message the way an astronaut stranded on Mars might.
🔢 Try it: the converter
Type in any box and the others follow. This converts a number’s value: whole numbers from 0 up to 4,294,967,295 (that’s FFFFFFFF in hex). To turn letters or text into codes, use the Mars dial below, which sends each character as its own ASCII code.
📘 Lessons
👪 Teaching a younger child, or new to this yourself? Start with Teach Number Bases Step by Step: five hands-on lessons with beans and cups, what to say, and a printable kit.
Nine short lessons. Each ends with practice you can repeat as often as you like; a ✓ marks the ones you've finished with 8 out of 10 right (kept on this device only).
🚀 Talk like a Mars castaway
In Andy Weir's novel The Martian (2011) and the 2015 film, an astronaut stranded on Mars has an old lander camera that can only turn to point at things. Every letter on a keyboard has a number, its ASCII code, and every code fits in two hex digits. So he set out the sixteen hex digits in a circle around the camera: to send a letter, point at its two digits in turn. Try it: type a message and watch the pointer spell it out.
Your turn to receive
The pointer will spell a mystery word. Write down each pair of hex digits, then look them up in the ASCII table below (or work them out: 41 is A, and each letter after adds one).
🔤 ASCII codes for letters and numbers
ASCII (1963) gave each character a number from 0 to 127, and Unicode still uses the same numbers for these. Capital letters run from 41 to 5A in hex, small letters from 61 to 7A, and the digits 0 to 9 from 30 to 39. A space is 20.
🗝️ Ready to practice? Code Practice has quick rounds and printable worksheets for every base, Morse and letter codes, Code Quest is a puzzle trail plus a scavenger-hunt maker for home, and Mix-and-Match Worksheets turns words into printable hex, binary, Morse, Latin and ASL puzzles.
Where it goes from here
Hex shows up in web colors, computer memory addresses, network addresses, error codes and Unicode character numbers (U+0041 is A). Morse code is another way to turn letters into signals: try the Morse code course. For more math, see Ray's Arithmetic and the graphing calculator; for more computing, Khan Academy's computing courses ↗ are free.