Skip to content
CalcWorld

Browse all tools

Decimal to Hexadecimal Converter

The decimal to hexadecimal converter divides by 16 again and again and reads the remainders from last to first, writing 10 to 15 as A to F. 255 in decimal is FF, and 500 is 1F4.

Sources: Wikipedia Updated

Convert decimal numbers (base 10) to hexadecimal numbers (base 16)

Common decimal to hex conversions

Decimal Hexadecimal
10 0xA
15 0xF
16 0x10
255 0xFF
256 0x100

Hexadecimal digits 0 to F

Hexadecimal (hex) is a base-16 number system that uses 16 distinct symbols: 0-9 represent values 0 to 9, and A-F represent values 10 to 15. Hex is commonly used in computing and programming to represent binary data in a more compact, human-readable format. For example, the RGB color white is represented as #FFFFFF in hex.

How to convert decimal to hexadecimal

Hexadecimal is base 16: it uses 0 to 9 and then A to F for the values 10 to 15. Convert 500.

  1. Divide by 16 and note the remainder: 500 ÷ 16 = 31 remainder 4.
  2. Divide the quotient again: 31 ÷ 16 = 1 remainder 15, which is F. Then 1 ÷ 16 = 0 remainder 1.
  3. Stop at a quotient of 0 and read the remainders from the bottom up: 1, F, 4, so 500 = 1F4.

The tool does the same division with JavaScript's toString(16), writes the letters in capitals and adds the prefix 0x. To check the answer, the hex to decimal converter turns 1F4 back into 500.

Repeated division of 500 by 16: 500 ÷ 16 = 31 remainder 4, 31 ÷ 16 = 1 remainder 15 (F), 1 ÷ 16 = 0 remainder 1. Read upward, 500 = 1F4 in hex.
A remainder of 10 to 15 is written as a letter, so the remainder 15 becomes F.

Why programmers write numbers in hex

Each hex digit stands for exactly 4 binary digits, since 16 = 2⁴, so one byte is always two hex digits. 500 in binary is 111110100, nine digits that are harder to scan than 1F4.

That is why hex appears in memory addresses, colour codes and byte dumps, where binary is too long and decimal does not line up with bytes. The binary to hex converter shows the four-bit grouping, and the decimal to binary converter gives the long form.

Hex digits A to F

Decimal101112131415
HexABCDEF

Limits of the converter

It accepts whole numbers of 0 or more. Decimals and negative values are rejected, because fractions and two's complement need different methods from this division loop.

For conversions between hex, octal and binary in one place, use the hex converter. Every conversion tool is listed on the number system converters page.

Decimal to Hexadecimal Converter: FAQ

What is 255 in hexadecimal?

FF. 255 ÷ 16 = 15 remainder 15, and 15 is F, so both digits are F. It is the largest value of one byte.

What does the 0x in front mean?

0x marks a number as hexadecimal in most programming languages, so 0xFF is 255 and not a word. In CSS colours the marker is # instead, as in #FFFFFF.

How do I convert hex back to decimal?

Multiply each digit by its power of 16 and add: 1F4 = 1 × 256 + 15 × 16 + 4 = 500. The hex to decimal converter does this for you.

Sources

  • Wikipedia: Hexadecimal — hex digits 0 to F, conversion by division, and one byte as two hex digits (checked October 16, 2026)