Omni Calculator logo

Decimal to Hexadecimal Converter

Created by Philip Maus and Bogna Szyk
Reviewed by Steven Wooding
Last updated: Jan 18, 2024


This decimal to hexadecimal converter allows you to switch between numbers in their decimal and hexadecimal forms. Don't worry if you don't know what the hexadecimal system is – this article will provide you with all the information you need to perform these conversions correctly. If you ever wondered how to convert decimal to hexadecimal numbers, we will explain it to you and illustrate the conversion algorithm with easy-to-understand examples. Make sure to take a look at the binary to decimal converter and the binary to hexadecimal converter, too!

What is the hexadecimal system?

The hexadecimal system is a numeral system that uses sixteen different digits. Our ordinary decimal system uses just ten digits, from 0 to 9. The hexadecimal also uses letters A, B, C, D, E, and F. These letters represent values from ten (A) to fifteen (F).

Programmers often use the hexadecimal system because it allows for concise representation of binary numbers. For example, the number 1111 1111 in binary can be represented as simply FF in hexadecimal. While the information is shown more compactly, binary operations like bit shifts and the bitwise operations AND, OR, and XOR can still be efficiently executed.

🙋 If you're not familiar with the bit operations mentioned above, visit our dedicated tools:

There are two main ways to represent hexadecimal numbers.

  • The first one, most common in programming, is to use the prefix "0x". Then, the number FF will be written as 0xFF to inform the person reading the code that this number is hexadecimal.
  • The second method is to use a subscript – for example, to write FF₁₆. Our decimal to hexadecimal converter does not include any of these notations, so keep that in mind when experimenting with how to convert decimal to hexadecimal numbers.

How to convert decimal to hexadecimal?

You can use an algorithm that is easy to remember to convert numbers from the decimal to hexadecimal system:

  1. Divide your initial decimal number by 16.
  2. Note down the remainder in the hexadecimal notation. This will be the last digit of the hexadecimal number (the rightmost one).
  3. Take the quotient. It is your new "initial number".
  4. Keep repeating the above steps, each time adding the remainder to the left of previously obtained digits.

For example, for number 4987, we would have the following steps:

  1. 4987 / 16 = 311, remainder B
  2. 311 / 16 = 19, remainder 7
  3. 19 / 16 = 1, remainder 3
  4. 1 / 16 = 0, remainder 1

Reading from the bottom to the top, 4987 corresponds to 137B in the hexadecimal system. Check this result with our hex calculator!

How to convert hexadecimal to decimal?

To convert from hexadecimal to decimal, follow these steps:

  1. Take the leftmost digit of your initial number. Multiply it by 16.
  2. Add the next digit of the hexadecimal number. The sum will be your new "initial number".
  3. Keep repeating these steps, each time first multiplying by 16 and then adding the last digit.

For example, for the hexadecimal number 243A, we would have the following steps:

  1. 2 * 16 = 32
  2. (32 + 4) * 16 = 576
  3. (576 + 3) * 16 = 9264
  4. (9264 + 10) = 9274

243A corresponds to 9274 in the decimal system. Check this result with the hexadecimal calculator!

How to use the decimal to hexadecimal converter?

You know what a decimal and hexadecimal number is and how to convert one to the other. So let's take a look at the decimal to hexadecimal calculator and its use.

Don't worry; it is effortless. Type the decimal number you want to convert to hexadecimal in the field Decimal. And that's all!

If we try this with our example decimal number 4987 from above, we receive the expected hexadecimal result: 137B.

By default, the converter is limited to 16 bit. If you need to change that, enter the advanced mode, and you will be able to define a bit range of up to 64.

FAQ

How do I convert the number 123 to hexadecimal?

To convert the number 123 to hexadecimal, do the following:

  1. Divide by 16 and write down the remainder: 123 / 16 = 7 remainder 11.
  2. Convert the remainder to the hexadecimal notation. This will be the last digit of the hexadecimal number: B
  3. Divide the quotient by 16: 7 / 16 = 0 remainder 7.
  4. Convert the remainder to the hexadecimal notation: 7.
  5. Since the remainder is 0, you are done. Your hexadecimal number is 7B.

How do I convert the number 3A to decimal?

To convert the number 3A to decimal, follow these steps:

  1. Take the leftmost digit of your initial number. Multiply it by 16: 3 × 16 = 48.
  2. Add the next digit of the hexadecimal number: 48 + 10 = 58.
  3. Your hexadecimal result is 58.
Philip Maus and Bogna Szyk
You can enter a decimal number between -32,768 and 32,767.
Decimal
Check out 5 similar numeral systems converters 🧮
BinaryBinary to hexadecimalBinary to octal… 2 more
People also viewed…

Circumference

Use this free circumference calculator to find the area, circumference and diameter of a circle.

Podcasts

Do you feel like you could be doing something more productive or educational while on a bus? Or while cleaning the house? Well, why don't you dive into the rich world of podcasts! With this podcast calculator, we'll work out just how many great interviews or fascinating stories you can go through by reclaiming your 'dead time'!

Pounds to stone

Effortlessly find out how many pounds in a stone and convert weight from pounds to stone with our accurate tool. Convert swiftly now!

kg to ounce converter

Find out how many kilograms make an ounce using our kg to ounce converter.
Copyright by Omni Calculator sp. z o.o.
Privacy, Cookies & Terms of Service