Decimal to Binary

Convert decimal to binary as you type, with every step shown. This free online converter gives exact results for numbers of any size, and nothing you type leaves your browser.

1 Enter your value

From
To

Examples

2 Your answer

Decimal

419dec

Show in other bases

Tap any value to copy it.

See the working

Guide

How it works

Three steps, whether you are reading a memory address, a bit flag or a byte value.

  1. 1

    Choose what to convert

    Pick what you have and what you want: decimal, hexadecimal, binary or octal.

  2. 2

    Type or paste a value

    Write it however you like: 65,535, 0xFF, FFh, with commas, spaces or underscores.

  3. 3

    Read the answer

    It appears as you type, in every other base, with the working shown.

The formulas

A digit's value depends on its position. Every answer here uses one of these rules:

Decimal to binary

divide by 2, keep the remainders

419 ÷ 2 = 209 r 1, 209 ÷ 2 = 104 r 1, …, 1 ÷ 2 = 0 r 1, so 419 is 0b110100011.

Binary to decimal

decimal = Σ digit × 2position

0b110100011 is 1 × 256 + 1 × 128 + 1 × 32 + 1 × 2 + 1 × 1 = 419, so the answer checks out.

Binary to hexadecimal

group the bits in fours from the right

0b110100011 → 0001 1010 0011 → 1, A, 3, so 0b110100011 is 0x1A3.

Decimal to hexadecimal digit chart

The decimal values 0 to 15 are the single hexadecimal digits 0 to F. Click one to add it to the converter.

All conversions

Decimal, hexadecimal, binary and octal converter

One free tool for every direction. Use it as a decimal to hexadecimal converter, convert decimal to binary or octal, or work backwards as a hexadecimal to decimal converter that turns 0x to decimal values. It also converts hexadecimal to binary, binary to hexadecimal and octal to decimal, so it works as a full number base converter and hexadecimal calculator. Pick a conversion to start.

Method

How to convert decimal to binary

To convert decimal to binary, divide the number by 2 and write down the remainder. Then divide the quotient by 2 again, and keep going until the quotient reaches 0.

Read the remainders from bottom to top to get the binary number.

Worked example

419 ÷ 2 = 209  remainder 1
209 ÷ 2 = 104  remainder 1
104 ÷ 2 = 52  remainder 0
52 ÷ 2 = 26  remainder 0
26 ÷ 2 = 13  remainder 0
13 ÷ 2 = 6  remainder 1
6 ÷ 2 = 3  remainder 0
3 ÷ 2 = 1  remainder 1
1 ÷ 2 = 0  remainder 1
Read bottom to top: 419 = 0b110100011

Decimal to Binary conversion table

Use this decimal to binary table as a quick decimal to binary chart for common values, from 0 to 65,535.

DecimalBinary
00
11
210
311
4100
5101
6110
7111
81000
91001
101010
111011
121100
131101
141110
151111
161 0000
3210 0000
64100 0000
100110 0100
127111 1111
1281000 0000
2551111 1111
2561 0000 0000
51210 0000 0000
1,00011 1110 1000
1,024100 0000 0000
4,0961 0000 0000 0000
65,5351111 1111 1111 1111

Help

Questions

Quick answers to what people most often ask about hexadecimal, decimal and binary.

01How do I convert decimal to binary?

To convert decimal to binary, divide the number by 2 and write down the remainder. Then divide the quotient by 2 again, and keep going until the quotient reaches 0. Read the remainders from bottom to top to get the binary number.

02What is 255 in binary?

255 in decimal is 0b11111111 in binary. Type 255 into the converter above to see every step.

03What is 1024 in binary?

1,024 in decimal is 0b10000000000 in binary.

04What is 10 in binary?

10 in decimal is 0b1010 in binary.

05What is 16 in binary?

16 in decimal is 0b10000 in binary. That is why 0x10 means sixteen, not ten.

06What is 100 in binary?

100 in decimal is 0b1100100 in binary.

07Why do computers use binary?

Computer hardware stores everything as tiny switches that are either off or on, 0 or 1. Binary is base 2, so it maps directly onto those bits. Decimal is easier for people to read, which is why converting between the two is so common.

08How do I convert decimal to binary in Excel?

Use the DEC2BIN function: =DEC2BIN(255) returns 11111111. It works the same way in Google Sheets. These functions only handle up to 10 result characters, and the binary ones only −512 to 511, so use this converter for larger numbers.

09How do I convert decimal to binary in Python or JavaScript?

In Python, bin(255) returns '0b11111111'. In JavaScript, (255).toString(2) returns '11111111'. Python handles any size; in JavaScript use BigInt for numbers above 2⁵³.

10Does the converter use two’s complement for negative numbers?

No. It keeps the minus sign, so −255 is −0xFF, −0b11111111 and −0o377. Computers usually store negative numbers in two’s complement, where the pattern depends on the width: −1 is 1111 1111 (0xFF) in 8 bits and 0xFFFF in 16 bits. To read a signed value whose top bit is set, subtract 2ⁿ: 0xFF as a signed 8-bit number is 255 − 256 = −1.

11Can I convert decimal numbers with a decimal point?

The converter works with whole numbers. By hand, convert the fractional part by multiplying it by the target base again and again and keeping the whole-number part each time. For example, 0.5 × 16 = 8, so 0.5 is 0x0.8 in hexadecimal, 0b0.1 in binary and 0o0.4 in octal.

12How many bits are in a byte?

Eight. A byte holds 0 to 255, which is 0000 0000 to 1111 1111 in binary, 0x00 to 0xFF in hexadecimal and 0o000 to 0o377 in octal.

13Can I convert negative decimal numbers to binary?

Yes. Type a minus sign and the converter keeps it: −255 becomes −0b11111111. Numbers of any size work, because the converter uses exact whole-number arithmetic.

14What does “dec to bin” mean?

“dec to bin” is short for decimal to binary, which means going from base 10 to base 2: a number written in base 10 is rewritten in base 2. For example, 255 becomes 0b11111111.

15Does this decimal to binary calculator show the working?

Yes. It converts decimal to binary with steps: open “See the working” under the answer to see each division by 2 and the remainder it leaves. Every answer is also shown in decimal, hexadecimal, binary and octal at once.

16Is this decimal to binary converter free?

Yes. It is free with no sign-up, works online on phones, tablets and computers, and every decimal to binary conversion runs in your browser, so nothing you type is sent anywhere.