Hex to Decimal Converter
Decimal and binary equivalents of a hex value, A to F in either case.
Result
How it is calculated
Each hex digit has a value from 0 to 15 (A=10 up to F=15). The decimal value is the sum of each digit times a power of 16, counting from the right: value = Σ digit × 16position, with the rightmost digit at position 0. The binary result is the same number written in base 2. Upper or lower case letters both work, and a leading 0x is stripped. The input must be non-empty and contain only 0-9 and A-F, so a leading #, spaces or a minus sign make it invalid. Values are limited to 64-bit signed integers: up to 7FFFFFFFFFFFFFFF, which is 9223372036854775807. Anything larger returns no result. Negative and fractional hex numbers are not supported.
Worked example
Convert the colour code digits FF5733. Split into bytes: FF = 15×16 + 15 = 255, 57 = 5×16 + 7 = 87, 33 = 3×16 + 3 = 51. Combine: 255 × 65,536 + 87 × 256 + 51 = 16,711,680 + 22,272 + 51 = 16734003. In binary this is 111111110101011100110011, which is 24 bits because each hex digit is 4 bits.
Common mistakes
- Typing the colour code with its
#(as in #FF5733); the tool accepts only hex digits and an optional0xprefix, so remove the hash. - Reading the letter O as the digit 0, or the letter l as 1; neither is a hex digit and the input is rejected.
- Treating the result as a negative number for values like FFFFFFFF; the tool reads hex as unsigned (4294967295), not as a two's complement 32-bit value (−1).
- Pasting several bytes with spaces (for example 1F 2A); remove the spaces or convert each byte separately.
- Expecting hex digits beyond 16 characters to work; numbers above 7FFFFFFFFFFFFFFF are refused.
About this calculator
Hexadecimal is base-16, using digits 0-9 and A-F, and each hex digit maps exactly onto 4 binary bits, which is why it's the standard shorthand for memory addresses, colour codes (#FF5733), and byte values in programming — far more compact than binary and easier to read at a glance. Converting to decimal sums each digit's value times 16 raised to its positional power, e.g. hex 2A = 2×16¹ + 10×16⁰ = 42.
Programmers, students learning number systems, and low-level/embedded developers reading register dumps or debugger output use this conversion constantly, since decimal is the natural unit for everyday quantities while hex (and binary) map directly onto how computers store data.
Was this helpful?
You can pick up to 3 reactions.
Popular calculators
Loan Calculator
Monthly payment, total interest and full amortization schedule.
Percentage Calculator
Percent change, percent of, and ratio calculations.
Discount Calculator
Calculate final price, savings, and discount amount.
BMI Calculator
Body mass index from height and weight (metric or imperial).
Age Calculator
Compute your exact age in years, months and days from a birth date.
Compound Interest Calculator
Calculate the final amount and interest earned with compounding.
All Calculators
- Loan Calculator
- Profit Calculator
- Discount Calculator
- BMI Calculator
- Percentage Calculator
- Ideal Weight Calculator
- Age Calculator
- Pregnancy Due Date Calculator
- Compound Interest Calculator
- BMR Calculator (Basal Metabolic Rate)
- Tip Calculator
- Fuel Cost Calculator
- Date Difference Calculator
- Sleep Cycle Calculator
- Daily Water Intake Calculator
- Simple Interest Calculator
- Heart Rate Zones Calculator
- Running Pace Calculator
- Pet Age Calculator
- Calories Burned Calculator
- Macro Calculator
- TDEE Calculator (Total Daily Energy Expenditure)
- Waist-to-Hip Ratio Calculator
- Honor Roll Calculator
- One Rep Max (1RM) Calculator
- Ovulation Calculator
- Electricity Cost Calculator
- Unit Price Calculator
- Savings Goal Calculator
- Break-Even Point Calculator
- Paint Calculator
- Course Grade Average Calculator
- Business Days Calculator
- Time Duration Calculator
- Fuel Economy Calculator
- Temperature Converter
- Tile Calculator
- Aspect Ratio Calculator
- Roman Numeral Converter
- Goal Weight Timeline Calculator
- Salary Converter (Hourly to Annual)
- Credit Card Validator (Luhn)
- Body Surface Area (BSA) Calculator
- Feels-Like Temperature Calculator
- Ohm’s Law Calculator
- PPI (Pixel Density) Calculator
- Molar Mass Calculator
- Zodiac Sign Calculator (Western + Chinese)
- IBAN Validator
- Shoe Size Converter
- Country Info & Dialing Code Lookup
- Time Zone Difference (World Clock)
- CAGR (Compound Annual Growth Rate) Calculator
- Rule of 72 Calculator
- Blood Alcohol Content (BAC) Calculator
- Lean Body Mass (LBM) Calculator
- Pythagorean Theorem Calculator
- Speed Converter
- Download Time Calculator
- Date Calculator (Add/Subtract)
No calculators found
Comments (1)
The tool reads the hex as an unsigned number, which matters for register and byte values. A single byte of 80 comes out as 128, but if the field is a signed byte it means minus 128: for any result of 128 or more in a one-byte field, subtract 256 to get the signed value. What do you decode most often, colour codes, register dumps or something else?