Decimal Numbers to Binary and Hex

Type any decimal number and get its exact binary, octal, and hexadecimal equivalents, with the remainder steps shown so you can follow how the conversion works.

On this page:

When 173 is not just 173

A designer hands you the color code AD and asks what it equals as an ordinary number. A networking tutorial shows the subnet mask 255.255.255.0 and wants you to see it as bits. In both cases you already know the value, you just need it rewritten in a different counting system. That is what this converter does: type a plain decimal number and it rewrites it in binary, octal, and hexadecimal, the bases computers actually work in.

The idea behind the conversion

Formula: decimal value = d_n x 10^n + ... + d_1 x 10^1 + d_0 x 10^0, where each digit d is between 0 and 9.

Every decimal number you have ever written is already a sum of powers of ten. The number 173 is 1 x 100 + 7 x 10 + 3 x 1. Converting to another base just means regrouping that same quantity into powers of 2, 8, or 16 instead of powers of 10. The tool divides your number by the target base again and again, collecting the remainders, and those remainders become the digits of the new representation, read from last to first.

How to use it

  1. Type your decimal number into the input box, digits only, no commas or spaces.
  2. Choose the base you want: binary, octal, or hexadecimal.
  3. Read the converted result, shown grouped so it is easy to copy.
  4. Switch bases to compare the same value in each system.

Worked example: 173 in binary and hex

Divide 173 by 2 and write down each remainder: 173 / 2 = 86 remainder 1; 86 / 2 = 43 remainder 0; 43 / 2 = 21 remainder 1; 21 / 2 = 10 remainder 1; 10 / 2 = 5 remainder 0; 5 / 2 = 2 remainder 1; 2 / 2 = 1 remainder 0; 1 / 2 = 0 remainder 1. Reading the remainders bottom-up gives 10101101, so 173 in decimal equals 10101101 in binary. For hexadecimal, divide by 16: 173 / 16 = 10 remainder 13, and in hex 10 is written A and 13 is written D, so 173 = AD. Both answers describe the exact same quantity.

Where this comes up in real life

Web designers translate between decimal RGB values like 173 and hex codes like AD every time they pick a color. Networking students convert 255 into 11111111 to see which bits of an address mark the network portion. People tinkering with Arduino boards read sensor values in decimal but write hardware settings in hex. If you are learning to program, converting small numbers by hand and then checking them here is one of the quickest ways to make number bases feel natural.

Mistakes to avoid

  • Dropping leading zeros. The full byte for 5 is 00000101, not 101. Trimmed zeros change the width and confuse anyone reading your result.
  • Treating hex letters as words. AD is a number here, not an abbreviation. In hexadecimal, A through F are simply the digits for 10 through 15.
  • Typing commas or fractions. Base conversion works on whole numbers, so enter 1000 rather than 1,000, and whole values rather than decimals.

Good to know

This tool converts whole numbers; extremely large values may lose precision in the browser, so cryptography-sized integers belong in a dedicated big-number tool. For the everyday range, the conversion is exact. To work the other direction, the hex converter turns hexadecimal back into decimal, the binary converter handles conversions starting from bits, and the text to binary converter encodes whole words into binary for you.

Frequently Asked Questions FAQ

What does the Decimal Converter do?
The Decimal Converter converts a value from one unit or number format to another so you can check the result quickly without doing the conversion by hand.
How is the conversion calculated?
The calculation follows the standard conversion relationship for the units involved. The formula shown on this page is: Decimal place values use powers of 10.
What should I enter in the calculator?
Enter the value you want to convert and make sure the selected unit matches the value you entered.
Can I use the result for school or work?
Yes. It can be useful for homework, notes, measurements, and everyday calculations. Check the units and rounding when the exact value matters.
Why can my result look slightly different?
Small differences usually come from rounding or from using a different number of decimal places. Using the same conversion factor should give consistent results.
Is this calculator free to use?
Yes. The calculator is provided as a simple online tool for general calculation and reference.

Have Feedback or a Suggestion?

Kindy let us know your reveiws about this page

;