All courses / Data Structures and Algorithms for Game Devs / Bits and bytes

Hexadecimal

Challenge lesson, about 10 min, +20 XP

Binary is exact, but it is long. The torch color #FF7A1A from C# Basics is the number 16,742,938, and in binary that is 24 digits:

Nobody can read that at a glance, and one missing digit changes the color. Programmers write bits in base 16 instead, called hexadecimal or hex for short. You can still read every bit straight from it, and it is four times shorter.

Read the rest of this lesson and run the code in your browser.

Previous: Reading binary by hand   Next: Predict the output: binary and hex

© 2026 Xero Media LLC. All rights reserved.