Decimal to Binary Converter: Base 10 to Base 2, Hex and Octal
Type a whole number. The converter shows its binary form, the form grouped in fours, hexadecimal and octal, the number of bits needed and the two's complement form for negative numbers.
Estimates only. Check important results before you rely on them.
More Technology & Digital Tools calculators
View all 10You may also need
From related categoriesHow to use this calculator
- Type a whole number.
- Pick a word size for negative numbers and padding.
- Read the binary form at the top.
- See the hex, octal, bits needed and the two's complement.
The formula
Worked example
181 ÷ 2 gives remainders that read 10110101, which is 1011 0101 in binary, B5 in hex and 265 in octal. The number −5 in 8 bits is 2^8 − 5 = 251, which is 1111 1011.
Understanding your result
The tool uses exact big-number arithmetic, so very large values convert correctly. If a negative number is too big for the chosen word size, the tool says so.
When to use it
- Learn how binary works.
- Set bits for flags, masks and registers.
- Convert IDs and addresses for programming.
Assumptions and limits
Whole numbers only. Fractions and floating-point formats are not covered.
Frequently asked questions
How do I convert decimal to binary?
Divide by 2 repeatedly, note each remainder, and read the remainders from last to first.
What is 10 in binary?
1010.
How are negative numbers stored?
Usually in two's complement, where the negative of a number is found by inverting its bits and adding 1.
What is the binary of 255?
11111111, which is 8 ones.
How many bits do I need for a number?
The "Bits needed" row shows the minimum.