Hexadecimal to Decimal
Convert a hexadecimal number to decimal.
Formula
Variables
Example
0x1F = 31
How it works
A hexadecimal number is a base-16 number system, so each digit represents a value times a power of 16, just as each digit in decimal represents a value times a power of 10. This formula adds up every digit’s contribution from right to left: the rightmost digit is multiplied by 16^0, the next by 16^1, and so on. It works because positional numeral systems encode numbers by place value rather than by separate symbols alone.
When to use it
Use this when you need to read, check, or convert hexadecimal values into ordinary decimal numbers. It is common in programming, debugging memory addresses, color codes, and low-level data representation.
Worked example, step by step
Convert 0x2A3 to decimal
N = 2×16^2 + A×16^1 + 3×16^0
A = 10, so N = 2×256 + 10×16 + 3×1
N = 512 + 160 + 3
N = 675
Common mistakes to avoid
- Forgetting that A through F stand for 10 through 15
- Using powers of 10 instead of powers of 16
- Starting the place values from the left instead of the right
Did You Know?
Programmers love hexadecimal because each digit maps neatly to exactly four binary bits.
Share this formula
More in Computer Science
View allGustafson’s Law
IntermediateIdeal scaled-workload speedup when more processors allow a larger parallel task in the same elapsed time. Here s is the serial fraction of the parallel execution time, not the single-processor fraction used in Amdahl’s law.
Hick–Hyman Law (Equal Choices)
IntermediateModels choice reaction time for n equally likely alternatives (n ≥ 1). This information-theoretic form assumes comparable, practised stimulus–response choices; it is not a universal law of menu browsing.
Fitts’s Law (Shannon Form)
IntermediateAn empirical model of aimed movement time: farther or narrower targets generally take longer to reach. Use D ≥ 0, W > 0 and fitted coefficients for the device and task.
Shannon Entropy
AdvancedAverage information content of a random source (bits).
Master Theorem (form)
AdvancedAnalyzes running time of divide-and-conquer algorithms.
Hamming Distance
AdvancedNumber of positions at which two strings differ.