Skip to content
induwara.lk
induwara.lkUtility · Developer

Number Base Converter, Binary, Octal, Decimal & Hex

Convert any whole number between bases 2 and 36, binary, octal, decimal, hex and everything in between, and see binary, octal, decimal and hex side by side with full step-by-step working. Exact BigInt math, no signup, runs in your browser.

By Induwara AshinsanaUpdated Jun 9, 2026
Number base converterBase 2–36

Enter a non-negative whole number using 0-1 (Binary). Spaces and underscores are ignored.

Try
From base
To base
Binary → Decimal (base 10)
214
3 digits · 8 bits
Binarybase 2
1101 0110
8 digits
Octalbase 8
326
3 digits
Decimalbase 10
214
3 digits
Hexadecimalbase 16
D6
2 digits

Step-by-step working

1 · Binary → decimal (positional expansion)

1·27 + 1·26 + 0·25 + 1·24 + 0·23 + 1·22 + 1·21 + 0·20 = 214₁₀

2 · Decimal → Decimal (repeated division by 10)

N÷ 10 = quotientremainderdigit
2142144
21211
2022

Read the digit column bottom-to-top: 214 (base 10).

The digit alphabet (0-9 then A-Z, so A=10 … Z=35) and the 2–36 radix range follow ECMA-262 and MDN. Everything runs in your browser with exact BigInt arithmetic, no uploads, no rounding.

How it works

A number base (or radix) is just the count of distinct digits a numeral system uses. Decimal is base 10 (digits 0–9); binary is base 2 (0–1); hexadecimal is base 16 (0–9 then A–F). The quantity never changes, only how it is written. This converter moves a value between any two bases from 2 to 36 using two standard, verifiable steps.

Step 1, source to decimal (positional expansion). Every numeral is a sum of its digits times powers of the base. For an n-digit number with digits d₍n−1₎ … d₁ d₀ in base b:

N = Σ value(dᵢ) · bi, for i = 0 … n−1

where value maps 0–9 to 0–9 and A–Z to 10–35. That digit alphabet is not arbitrary: it is the mapping fixed by the ECMAScript specification (ECMA-262) for parseInt and Number.prototype.toString(radix), which is also why the radix tops out at 36, base 36 already exhausts all ten digits and all 26 letters.

Step 2, decimal to target (repeated division). To write that quantity in the target base, divide repeatedly by the base and collect remainders:

while N > 0: r = N mod base; prepend digit(r); N = ⌊N ÷ base⌋

The remainders, read from last to first, are the target representation. A value of 0 renders simply as 0.

To stay exact for arbitrarily long inputs, every calculation uses JavaScript BigInt rather than floating-point numbers, which would lose precision above 2⁵³ (about 9 quadrillion). As a credibility check, the tool computes the decimal value twice by independent code paths, Horner's method and the explicit positional sum above, and only marks a result verified when they agree. The four-panel binary / octal / decimal / hex readout and both working displays are all derived from that single shared integer, so the steps shown can never disagree with the answer.

Worked examples

255 (decimal) → all bases

  1. Binary: 255 = 128+64+32+16+8+4+2+1 = 11111111 (8 bits)
  2. Hex: 255 ÷ 16 = 15 r 15 (F); 15 ÷ 16 = 0 r 15 (F) → FF
  3. Octal: 255 ÷ 8 = 31 r 7; 31 ÷ 8 = 3 r 7; 3 ÷ 8 = 0 r 3 → 377
  4. Check octal: 3·64 + 7·8 + 7 = 192+56+7 = 255 ✓

1A3 (hexadecimal) → decimal, binary, octal

  1. Positional: 1·16² + 10·16¹ + 3·16⁰ = 256 + 160 + 3 = 419
  2. Binary: 419 = 256+128+32+2+1 = 110100011 (9 bits)
  3. Octal: 419 ÷ 8 = 52 r 3; 52 ÷ 8 = 6 r 4; 6 ÷ 8 = 0 r 6 → 643
  4. Check octal: 6·64 + 4·8 + 3 = 384+32+3 = 419 ✓

64-bit value → exact with BigInt

  1. Input: 64 ones in binary (1111…1111, length 64)
  2. Decimal: 2⁶⁴ − 1 = 18,446,744,073,709,551,615
  3. Hex: FFFFFFFFFFFFFFFF (sixteen F digits)
  4. A floating-point parser corrupts this above 2⁵³; BigInt keeps it exact ✓

Frequently asked questions

Sources & references

The digit alphabet and radix range were last cross-checked against the ECMA-262 specification on 2026-06-09. The conversion math (positional expansion and repeated division) is standard place-value arithmetic and does not change.

Related tools

Comments & feedback

Spotted a bug or want an improvement? Tell us, our team reviews every comment, and good ideas get built. Comments are public and anonymous.

Found a bug, edge case, or want to suggest an improvement?

Email me at [email protected] , most fixes ship within 24 hours.