Number Base Converter (Binary, Octal, Hex)
Convert between bases 2 to 36: binary, octal, decimal, hexadecimal. Fractional numbers, repeating expansions, division and multiplication steps, two's complement.
What is a number base?
In the decimal system we use every day each position stands for a power of 10: 419 = 4 · 100 + 1 · 10 + 9. Other bases follow the same rule with powers of the base. Computers work in binary (base 2), and programmers often write hexadecimal (base 16) or octal (base 8). This tool converts between any two bases from 2 to 36 and shows the working step by step.
Converting to decimal
Multiply each digit by its place value and add the results. For hexadecimal 1A3: 1 · 16² + 10 · 16 + 3 = 256 + 160 + 3 = 419. In hexadecimal A = 10, B = 11, C = 12, D = 13, E = 14 and F = 15.
Converting from decimal to another base
Divide the whole part by the base again and again and note the remainders. Turning 13 into binary: 13 ÷ 2 = 6 remainder 1, 6 ÷ 2 = 3 remainder 0, 3 ÷ 2 = 1 remainder 1, 1 ÷ 2 = 0 remainder 1. Read the remainders from last to first: 1101. Multiply the fractional part by the base again and again and take the whole part of each product as the next digit: 0.625 is 0.101 in binary.
Repeating fractions
A fraction that ends in decimal may go on forever in another base. In binary 0.1 continues as 0.000110011… The tool finds the repeating block and writes it in brackets: 0.0(0011). This is why 0.1 + 0.2 does not come out as exactly 0.3 on a computer.
The shortcut between binary, octal and hex
Because 8 = 2³ and 16 = 2⁴, binary digits convert directly in groups of three or four: binary 1101 0011 is hexadecimal D3.
Two's complement and limits
Computers store negative whole numbers in two's complement. For −5 in 8 bits write 5 (00000101), flip the bits (11111010) and add 1 (11111011). The tool gives this form for 8, 16, 32 and 64 bits. The floating point format (IEEE 754) is not covered.
Frequently asked questions
How do you convert binary to decimal?
The number 1101 in base 2 becomes 13 in base 10. Multiply each digit by the source base raised to its place exponent and add the terms, treating this example as an unsigned integer since another encoding can assign a different meaning to the same bits.
Related calculators
-
Mathematics
Roman Numeral Converter: Numbers to Roman and Back
Convert numbers from 1 to 3999 to Roman numerals and back. Decode MCMXCIV with steps and check invalid forms such as IIII. Free, no account needed. -
Mathematics
Prime Number and Prime Factorization Calculator
Is the number prime, its prime factors, its divisors, the previous and next prime. All primes in a range with the sieve of Eratosthenes. Exact up to 2⁶⁴, with steps. -
Mathematics
Scientific Calculator
Type an expression and see the result at once: trigonometry, logarithms, powers, roots, factorials. Degree and radian modes, memory and history, all in your browser. -
General Calculations and Unit Conversion
Unit Converter: All Units at Once in a Copyable Table
Convert length, pressure, power and more. See all units at once, choose significant digits and copy the whole table. Free to use, no account needed. -
Mathematics
Absolute Value and Piecewise Function Calculator
Solves absolute value equations and inequalities step by step, evaluates expressions, writes them piecewise and evaluates piecewise functions. -
Mathematics
Algebraic Expression Simplifier
Simplifies an algebraic expression step by step: expands brackets, combines like terms, cancels common factors in rational expressions and evaluates at given values.
Found a mistake or something missing?
If a value looks wrong, a size is missing or you need a feature, write to us and we will fix it.