Skip to content
RK Calculator
Menu

Decimal to Binary Converter

Convert decimal numbers to binary, including fractions and negative numbers, with the working shown.

Change the values and press Calculate to work out your own figures.

Enter a decimal number to write it in binary.

About decimal numberFor example 170 or 10.625.
Result
In binary
10101010
In octal
252
In hexadecimal
AA

170 in decimal is 10101010 in binary.

Show the working
  1. 170 ÷ 2 = 85 remainder 0
  2. 85 ÷ 2 = 42 remainder 1
  3. 42 ÷ 2 = 21 remainder 0
  4. 21 ÷ 2 = 10 remainder 1
  5. 10 ÷ 2 = 5 remainder 0
  6. 5 ÷ 2 = 2 remainder 1
  7. 2 ÷ 2 = 1 remainder 0
  8. 1 ÷ 2 = 0 remainder 1
  9. Read the remainders from the bottom up for the whole part
  10. 170₁₀ = 10101010₂

How to use it

Enter a decimal number to write it in binary.

Letters stand for digits above 9 (A = 10 … Z = 35) and can be typed in either case; prefixes such as 0b and 0x, spaces and underscores are ignored. Show the working gives each step.

Key facts

decimal → binary: place values Σ dᵢ × bⁱ; repeated division by the new base

How the conversion works

To decimal, multiply each digit by its place value (a power of the base) and add; from decimal, divide by the base repeatedly and read the remainders from the bottom up (for a fraction, multiply by the base and read off the whole parts).

Questions

What is 170 in binary?

10101010.

Can I convert fractions?

Yes. Digits after the point are converted exactly; if they repeat forever in the new base, the repeating block is shown in parentheses.

Formulas

decimal → binary: place values Σ dᵢ × bⁱ; repeated division by the new base

Sources

Limitations

  • Numbers have at most 1,000 characters; Roman numerals cover whole numbers from 1 to 3,999,999.

Formula version 0.1.0Reviewed