Hex to decimal converter
Math & numbersWhat is a hexadecimal number in decimal?
Turn a hex number such as FF or 1A3 into an ordinary decimal number.
What you enter stays on your device while you use this tool. Opening a shared link sends the settings in its address to HowToolbox to prepare the page.
In decimal
255
2 digits read in base 16
The same number in other bases
- In binary
- 11111111
- In octal
- 377
- In hexadecimal
- ff
Sponsored Links
Turn a hex number such as FF or 1A3 into an ordinary decimal number.
How to use
- Type the number. Digits above 9 are letters: A or a is ten, F is fifteen.
- Choose the base it is written in, then the base to convert to. 10 is the everyday decimal, 2 binary, 8 octal and 16 hexadecimal.
- Copy the result. The same number is also shown in the other common bases.
How it works
A base says how many digits a numbering system has, and each place is worth that many times the one to its right. In decimal the places are ones, tens, hundreds. In binary they are ones, twos, fours, eights. In hexadecimal, which has 16 digits (0–9 and A–F), they are ones, sixteens, 256s and so on. Computers use binary, and hexadecimal is a compact way to write it: one hex digit is exactly four binary digits.
To convert, add up each digit times the value of its place. For example hex FF is 15 × 16 + 15 = 255, which is 11111111 in binary and 377 in octal. Going the other way, divide by the new base again and again and read the remainders backwards (Knuth, The Art of Computer Programming, vol. 2, section 4.1).
This tool works with whole numbers of any size, so a 64-bit or even larger value stays exact, and accepts bases from 2 to 36, where the letters a to z are the digits ten to thirty-five. You can type spaces or underscores to group digits, a minus sign, and the usual 0x, 0b and 0o prefixes. Fractions are not converted.
Worked example
What is hexadecimal 2A in decimal?
- Its digits represent 2 × 16 + 10.
The decimal value is 42.
Sponsored Links
Next you might need
- Base64 encode and decodeEncode text or a file to Base64 and decode it back, right in your browser., private, runs on your deviceText toolsConverterEncoding
- Hash generatorSHA-256, SHA-512, SHA-1 and MD5 hashes of any text, made in your browser., private, runs on your deviceWeb & developerGeneratorEncoding
- Average calculatorMean, median, mode and range of a list of numbers, with the count, sum, smallest and largest., private, runs on your deviceMath & numbersCalculatorStatistics
- Combinations and permutations calculatorExact counts of combinations and permutations, with or without repetition, and the chance of one particular pick., private, runs on your deviceMath & numbersCalculatorStatistics
- Confidence interval calculatorThe confidence interval for a mean or a proportion from a sample, with the margin of error and the method used., private, runs on your deviceMath & numbersCalculatorStatistics
- Fraction calculatorAdd, subtract, multiply and divide fractions and mixed numbers, or turn a decimal into a fraction, with the answer in lowest terms., private, runs on your deviceMath & numbersCalculator
More in Math & numbers
All 24 utilities in Math & numbers- Percentage calculatorPercent of a number, what percent one number is of another, percentage change and difference, and the number before a discount., private, runs on your device
- Area of shapesArea and perimeter of rectangles, circles, triangles and eight more shapes, drawn to scale., private, runs on your device
- GCD and LCM calculatorThe greatest common divisor and the least common multiple of two to ten whole numbers, with the Euclidean steps., private, runs on your device
- Prime number checkerTest any whole number up to 100 digits for primality, with its prime factors and the next and previous prime., private, runs on your device
- Ratio calculatorSimplify a ratio to its lowest terms, or find the missing number in an equal ratio, the rule of three., private, runs on your device
- Sample size calculatorThe number of survey responses you need for a margin of error and confidence level, for any population size., private, runs on your device
Popular now
Sponsored Links
Sponsored Links
Sponsored Links