Decimal to Binary Converter — Turn any decimal number into binary, octal and hexadecimal instantly.

Type a number and see its binary, octal and hex form straight away. It handles very large whole numbers, fractions such as 0.625, and negative values in two's complement with 8, 16, 32 or 64 bits. You can also check an answer by converting binary back to decimal.

Convert my number Your numbers stay in your browser
Decimal to binary converter showing the number 156 converted to 10011100

Decimal number

Results

Binary
–
Octal
–
Hexadecimal
–
0Bits used
–Number type
Decimal value: –
The guide

Decimal to Binary Guide: Method, Negatives, and Fractions

Learn how decimal numbers become binary and how to read the result.

A simple explanation

What is decimal to binary conversion?

Decimal is the base-10 system we use every day, with digits 0 to 9. Binary is base 2 and uses only 0 and 1, which is how computers store numbers. Converting from decimal to binary means writing the same value using powers of 2 instead of powers of 10.

Type a number and the binary, octal and hexadecimal forms appear at once. It handles very large whole numbers, decimals such as 0.625 and negative numbers. To go the other way, use the check box here or the Binary to Decimal Converter.

Common reasons to convert

Why People Convert Decimal to Binary

Study and homework

Check answers for computer science, digital logic and number system exercises, and see the steps behind them.

Programming

Write bit masks, flags, permissions and register values, or read binary output while debugging.

Networking and electronics

Work with IP address octets, subnet masks and microcontroller values that are written in bits.

Do it by hand

How to Convert Decimal to Binary by Hand

For a whole number, divide by 2 again and again, write down each remainder, then read the remainders from the last one to the first.

156 / 2 = 78 remainder 0 78 / 2 = 39 remainder 0 39 / 2 = 19 remainder 1 19 / 2 = 9 remainder 1 9 / 2 = 4 remainder 1 4 / 2 = 2 remainder 0 2 / 2 = 1 remainder 0 1 / 2 = 0 remainder 1 Read upwards: 10011100 (156 in binary)

For a fraction, multiply by 2 instead. The digit before the point becomes the next binary digit, and you keep multiplying what is left. 0.625 gives 0.101 because 0.625 = 1/2 + 1/8.

Common values

Decimal, Binary and Hex Table

DecimalBinaryHex
111
2102
810008
101010A
151111F
161000010
100110010064
25511111111FF
256100000000100
102410000000000400
Special cases

Negative Numbers and Fractions

Two's complement

Computers store negative whole numbers in two's complement. Pick a bit width and -42 becomes 11010110 in 8 bits. The tool shows an error if the value does not fit the chosen width.

Minus sign

The simple form writes a minus sign in front of the binary value, so -42 becomes -101010. This is easier to read and fine for homework.

Fractions that never end

Some decimals cannot be written exactly in binary. 0.1 repeats forever, so the result is cut after the number of places you choose and a note is shown.

Bit width

Automatic uses the shortest of 8, 16, 32 or 64 bits that fits. Pick a width to pad positive numbers with leading zeros, such as 5 as 00000101.

Convert in a few steps

How to Use the Decimal to Binary Converter

  1. Type a decimal number, or press one of the example values.
  2. Read the binary result. Press Copy to copy it, or switch off grouping if you want plain digits.
  3. Choose how negative numbers are shown and set a bit width if you need a fixed length.
  4. Use the check box at the bottom to convert a binary value back to decimal and confirm the answer.
Better results

Simple Tips for Number Conversions

  • Grouping bits in fours makes long values much easier to read and lines them up with hex digits.
  • Powers of 2 are easy to spot: 1, 10, 100, 1000 in binary are 1, 2, 4, 8 in decimal.
  • For bit masks and registers, set the bit width so leading zeros are kept.
  • If a fractional result looks long, lower the fraction places. Most uses only need 8 or 16.
Good to know

Limitations and Privacy

Privacy

Numbers are converted in your browser. Nothing is sent to our server or stored. Only your option choices are remembered on your device.

Limitations

Input is limited to 400 digits. Floating-point formats such as IEEE 754 are not shown, only the exact binary value of the number you type. Two's complement is for whole numbers.

Common questions

Decimal to Binary Converter FAQ

How do I convert a decimal number to binary?

Type the number into the box and the binary form appears at once. By hand, divide the number by 2 repeatedly, note each remainder, and read the remainders from the last to the first.

What is 10 in binary?

10 in decimal is 1010 in binary, because 8 + 2 = 10. You can try any other value with the example buttons or by typing it.

Can it convert decimals like 0.625 or 0.1?

Yes. 0.625 is exactly 0.101 in binary. 0.1 cannot be written exactly and repeats forever, so the result is cut at the number of fraction places you choose and a note says so.

How are negative numbers shown?

Choose Minus sign to put a minus in front of the binary value, or Two's complement to see how a computer stores it. Two's complement needs a bit width, and Automatic picks 8, 16, 32 or 64 bits for you.

What does bit width do?

It sets the length of the result. A width of 8 shows 5 as 00000101, and in two's complement it also sets the range, so 8 bits holds -128 to 127.

How large a number can I convert?

Whole numbers can have up to 400 digits, which is far beyond the 64-bit limit, because the tool uses exact big-number maths. Two's complement stops at 64 bits unless you leave the width on Automatic.

Can I convert binary back to decimal?

Yes. Use the check box under the results and type a binary value, including a fraction such as 101.101. The decimal value is exact.

Is my number saved or sent anywhere?

No. The conversion happens in your browser and nothing leaves your device. Only your option choices are remembered for next time.

From people using this tool

Reviews

Loading reviews…
Keep going

More tools in the box

The homepage features dozens more free tools that don't require an API key.

Suggest a tool