Decimal to binary converter

Convert any decimal integer to binary, hex, and octal — with a full step-by-step division-by-2 breakdown to show how the binary digits are derived.

Decimal to binary converter

Binary value
10110101
Hex
0xB5
Octal
0o265
Bits
8

Step-by-step: divide by 2

How to convert decimal to binary

The standard method is repeated division by 2. At each step, divide the number by 2 and record the remainder. When the quotient reaches 0, read the remainders from bottom to top — that's your binary number.

181 ÷ 2 = 90 r 1 → 90 ÷ 2 = 45 r 0 → 45 ÷ 2 = 22 r 1 ... (continue until quotient = 0)

Reading remainders bottom-up for 181: 10110101.

Why division by 2?

Binary is base-2. In any positional number system, you extract digits of the target base by repeatedly dividing by that base and collecting remainders. Dividing by 2 extracts binary digits; dividing by 16 would extract hex digits.

Each remainder is either 0 or 1 (since you're dividing by 2), matching the only two digits in binary.

Quick reference

DecimalBinaryHex
110x1
810000x8
16100000x10
6410000000x40
10011001000x64
255111111110xFF
1,024100000000000x400
65,53511111111111111110xFFFF

FAQ

What's the largest decimal I can convert?

Uses BigInt internally, so any positive integer you can type.

How do I convert negative numbers?

For negatives, you need two's complement representation, which requires a fixed bit-width. This converter handles positive integers only.

What about fractional decimals (e.g. 0.75)?

For the fractional part, multiply by 2 repeatedly and collect the integer parts. This converter handles whole integers only. For 0.75: 0.75×2=1.5 → 1, 0.5×2=1.0 → 1. Result: 0.11 in binary.

Related calculators