Decimal To Hex
Decimal To Hex converts base-10 numbers into hexadecimal notation. It is useful for colour codes, memory addresses, byte values and any specification written in base 16.
Share this page:
Decimal To Hex converts base-10 numbers into hexadecimal notation. It is useful for colour codes, memory addresses, byte values and any specification written in base 16.
Decimal To Hex at a glance
- Convert a decimal colour channel value into a two-digit hex component.
- Translate a memory offset or register address into the format used by a datasheet.
- Check byte values when reading a hex dump.
Step by step
- Enter the decimal number or numbers you want to convert.
- Click Convert to Hex.
- Copy the hexadecimal result, adding a 0x prefix if your code requires it.
Accuracy, limits and privacy
Pad byte values to two digits. A value of 10 is 0A as a byte, not just A.
How it works in practice
Hex values for bytes should be two digits. A decimal 10 becomes 0A, not just A, when the receiving system expects a byte-aligned string.
Where people go wrong
- Dropping the leading zero from values below 16.
- Including the 0x prefix where the target format expects bare digits.
Common questions
How do I convert a number larger than 255?
The converter handles the full value. If you need byte-sized output, split the number or pad each byte to two hex digits.
Why are letters used in the result?
Hexadecimal has sixteen digits. Values ten to fifteen are written as A to F.
Does it add the 0x prefix?
It returns the digits. Add 0x yourself when a programming language or document expects that notation.
Related Tools
More free tools you may like