Skip to content
AllCalcHub

Number Base Converter

Convert whole numbers between binary, octal, decimal, hexadecimal and base 36, with the working shown.

About the Number Base Converter

A number base sets how many digits a system uses. Decimal uses ten (0–9); binary, the language of computers, uses two (0 and 1); hexadecimal uses sixteen (0–9 then A–F), and is a compact way to write binary because each hex digit is exactly four bits.

This converter works on whole numbers of any length exactly, with no rounding.

The formula

Value = dₙ×bⁿ + … + d₁×b¹ + d₀×b⁰

d
each digit, from left (highest) to right
b
the base

To go from decimal to another base, divide by the base repeatedly and read the remainders from last to first.

0 to 16 in common bases

DecimalBinaryOctalHex
0000
1111
21022
31133
410044
510155
611066
711177
81000108
91001119
10101012A
11101113B
12110014C
13110115D
14111016E
15111117F
16100002010

How to read your result

  • Type the number as written and choose its base.
  • Binary is grouped in fours so it lines up with hex digits.

Worked example

Hex 2F to decimal

  1. 2 × 16¹ = 32
  2. F (15) × 16⁰ = 15
  3. 32 + 15 = 47

Questions people ask

Why do programmers use hexadecimal?

One hex digit is exactly four binary digits, so long binary values become short and readable: 1111 1111 is FF.

Can I convert fractions?

This converter handles whole numbers. Fractions like 0.1 often have no exact binary form.