How to convert Decimal to Hex
The decimal numeral system is the standard system for denoting integer and non-integer numbers. It is the extension to non-integer numbers of the Hindu-Arabic numeral system. For writing numbers, the decimal system uses ten decimal digits, a decimal mark, and, for negative numbers, a minus sign "-". The decimal digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9; the decimal separator is the dot "." in many countries.Hexadecimal is a positional system that represents numbers using a base of 16. Unlike the common way of representing numbers with ten symbols, it uses sixteen distinct symbols, most often the symbols "0"-"9" to represent values zero to nine, and "A"-"F" to represent values ten to fifteen. Hexadecimal numerals are widely used by computer system designers and programmers, as they provide a human-friendly representation of binary-coded values.
Formula
Follow these steps to convert a decimal number into hexadecimal form:
- Divide the decimal number by 16.
- Get the integer quotient for the next iteration (if the number will not divide equally by 16, then round down the result to the nearest whole number).
- Keep a note of the remainder, it should be between 0 and 15.
- Repeat the steps until the quotient is equal to 0.
- Write out all the remainders, from bottom to top.
- Convert any remainders bigger than 9 into hex letters. This is the solution.
Division | Quotient | Remainder |
---|---|---|
37321 / 16 | 2332 | 9 |
2332 / 16 | 145 | 12 (C) |
145 / 16 | 9 | 1 |
9 / 16 | 0 | 9 |