Decimal to Binary, Hexadecimal & Octal Converter (with step‑by‑step expansion)

Any non-negative integer can be written in different bases. Below are the fundamental expansion formulas used by this calculator.


Binary (base 2) uses digits 0 and 1:

N = dk−1 × 2k−1 + … + d1 × 21 + d0 × 20


Hexadecimal (base 16) uses digits 0–9 and A = 10, B = 11, C = 12, D = 13, E = 14, F = 15:

N = hm−1 × 16m−1 + … + h1 × 161 + h0 × 160


Octal (base 8) uses digits 0–7:

N = on−1 × 8n−1 + … + o1 × 81 + o0 × 80

The converter below shows each representation together with its full expansion, exactly as you would write it on paper.

Number base converter

Insert any non‑negative integer → get binary, hex, octal + detailed expansions
Enter decimal number

Results & expansion per base

BINARY (base 2)

HEXADECIMAL (base 16)

A=10, B=11, C=12, D=13, E=14, F=15
OCTAL (base 8)

How the conversion works (step‑by‑step formulas)

After you press Convert, the calculator:

The expansion uses red digits to highlight each coefficient. For hexadecimal, digits A‑F are shown in red as well.

More references & learning

Online Converter From Decimal to Binary, Octal and Hexadecimal
Binary Numbers explained