Decimal to Binary Converter

Convert to three bases at once.

Result

10011100
9C
234

How it is calculated

The tool accepts one non-negative whole number and rewrites it in three bases. Binary uses the digits 0 and 1, where each position is a power of two: n = bk·2k + … + b1·2 + b0. Hexadecimal groups the bits in fours (digits 0–9 and A–F, shown in capitals), and octal groups them in threes (digits 0–7). All three results describe the same number, so you can check one against another. The input has no unit. Anything that is not a whole number gives no result: negatives, fractions such as 2.5, an empty box, and values above 9,007,199,254,740,991 (253 − 1) are all refused. Leading zeros are not printed, and 0 converts to 0 in every base.

Worked example

Convert 156. The largest power of two that fits is 128, leaving 28; then 16 fits, leaving 12; 8 fits, leaving 4; 4 fits, leaving 0. So 156 = 128 + 16 + 8 + 4, which gives the bits 1 0 0 1 1 1 0 0. The binary result is 10011100. Split into groups of four, 1001 and 1100 are 9 and C, so hex is 9C. Split into groups of three from the right, 010, 011 and 100 are 2, 3 and 4, so octal is 234.

Try this example →

Common mistakes

  • Entering a negative number and expecting a two's complement pattern. This converter only handles zero and positive whole numbers; negative input gives no result.
  • Typing a fraction such as 10.75. Fractions are not converted, and the tool returns nothing instead of rounding.
  • Reading the hex or octal output as a decimal number. 9C and 234 are base 16 and base 8 digit strings, so 234 octal is 156, not two hundred thirty-four.
  • Dropping or adding leading zeros when copying into code. The output has none, so pad it yourself if you need a fixed width such as 8 bits.
  • Using a number larger than 253 − 1 and expecting an answer. Above that limit the input is rejected.

About this calculator

Computers store and process every value in binary (base 2) — using only the digits 0 and 1 — because a transistor's two stable electrical states map naturally onto two symbols, so converting a familiar base-10 (decimal) number into binary is the fundamental translation between how humans count and how hardware actually represents numbers. The conversion works by repeatedly dividing the decimal number by 2 and reading the remainders in reverse order, or equivalently by finding which powers of 2 sum to the target number.

Hexadecimal (base 16) and octal (base 8) are shown alongside binary because both are compact shorthand for binary that programmers use constantly — each hex digit represents exactly 4 binary bits and each octal digit represents exactly 3, making them far easier to read and write than long strings of 0s and 1s, which is why memory addresses, color codes, and file permissions are conventionally written in hex or octal rather than binary.

Was this helpful?

You can pick up to 3 reactions.

Comments

  • Be the first to comment.

Popular calculators

All Calculators