When you first start learning about programming, web development, or even digital electronics, you’ll quickly discover there’s more than one way to represent numbers. Two of the most common systems you’ll encounter are decimal and hexadecimal. While decimal feels familiar, hexadecimal can look strange at first—full of letters like A, B, C, and F.
In this guide, you’ll learn exactly what makes decimal and hexadecimal different, why both systems exist, and how to work with them even if you’re a beginner.
Decimal is the base-10 number system—the one we use every day.
It has 10 unique symbols:
0 1 2 3 4 5 6 7 8 9Each position in a decimal number represents a power of 10. For example:
345 = (3 × 100) + (4 × 10) + (5 × 1)Because we grow up with decimal, it feels natural for things like counting money, measuring, or basic arithmetic.
Hexadecimal (often shortened to “hex”) is a base-16 number system.
It uses 16 symbols:
0 1 2 3 4 5 6 7 8 9 A B C D E FHere, the letters represent numbers above 9:
Each position in a hex number represents a power of 16. For example:
2F = (2 × 16) + (15 × 1) = 47 in decimalWhile decimal is perfect for everyday life, hexadecimal shines in the world of computers and programming. That’s because:
#FF5733.One of the most visible uses of hex is in CSS color codes:
body { background-color: #1E90FF; /* Dodger Blue */}Here, 1E90FF is a hexadecimal representation of an RGB color value. Understanding hex means you can tweak colors precisely in your design work.
If you’re not ready to do manual math for color conversions, you can try a free online converter like HexCalculator.org to instantly switch between decimal, hexadecimal, and even binary values while coding.
If you’re learning hex, conversions can feel tricky at first. But with a little practice—or a good tool—it becomes second nature.
Decimal to Hex:
FF40Hex to Decimal:
1A → Decimal 267F → Decimal 127Once you’re familiar with hex, it’s worth learning how to use it for debugging in browser developer tools. This can help you understand how data is stored, represented, and manipulated in real-time.
For a step-by-step guide, check out A Beginner’s Guide to Debugging with Hexadecimal Values in the Browser.
The decimal and hexadecimal systems are simply two different ways of representing numbers. Decimal is great for daily life, while hexadecimal is a favorite in computing for its compactness and binary alignment.
With just a bit of practice and the right tools, you’ll be able to read, write, and convert hex values with confidence—whether you’re styling a website, debugging code, or exploring digital electronics.