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.
—
—
—
After you press Convert, the calculator:
.toString(base).The expansion uses red digits to highlight each coefficient. For hexadecimal, digits A‑F are shown in red as well.
Online Converter From Decimal to Binary, Octal and Hexadecimal
Binary Numbers explained