Base Converter
Convert numbers between binary, octal, decimal and hexadecimal instantly.
The detailed guide below is currently available in English only.
How Number Base Conversion Works
Positional Notation
All modern numeral systems rely on positional notation: the contribution of each digit depends on its position and the radix (base). Each step to the left represents an increasingly higher power of the base.
Why Bases Matter in Computing
Modern microprocessors operate strictly on binary (base 2) electrical transistor states. Hexadecimal (base 16) and octal (base 8) serve as compact, human-readable shorthand for binary byte streams and memory pointers.
Understanding Radices
Binary uses symbols 0 and 1. Octal uses digits 0 through 7. Standard decimal uses 0 through 9. Hexadecimal expands beyond 9 using letters A through F (where A=10, B=11, C=12, D=13, E=14, and F=15).
Bit-Grouping Shortcuts
Because 8 = 2³ and 16 = 2⁴, you can convert between binary, octal, and hex by direct grouping: 3 binary bits equal exactly one octal digit, while 4 binary bits (a nibble) equal exactly one hex character.
Mathematical Mechanics of Radix Conversion
In any integer base \(b\), a number represented by the digits \(d_{n-1} d_{n-2} \dots d_1 d_0\) has the exact decimal equivalent value:
To convert an arbitrary decimal integer into a target base \(B\), we perform repeated division by \(B\), recording the integer quotient and the remainder at each step until the quotient reaches 0. The remainders read in reverse order (from bottom to top) form the digits of the target representation:
Quotient_0 = Quotient_1 × B + Remainder_1 … (until Quotient_k = 0)
Detailed Worked Examples
Example 1: Converting Decimal 250 into Binary, Octal, and Hexadecimal
Decimal to Binary (Base 2):
250 / 2 = 125 remainder 0
125 / 2 = 62 remainder 1
62 / 2 = 31 remainder 0
31 / 2 = 15 remainder 1
15 / 2 = 7 remainder 1
7 / 2 = 3 remainder 1
3 / 2 = 1 remainder 1
1 / 2 = 0 remainder 1
Reading remainders bottom-to-top yields 11111010₂.
Decimal to Octal (Base 8):
250 / 8 = 31 remainder 2
31 / 8 = 3 remainder 7
3 / 8 = 0 remainder 3
Reading remainders bottom-to-top yields 372₈.
Decimal to Hexadecimal (Base 16):
250 / 16 = 15 remainder 10 (which is hex 'A')
15 / 16 = 0 remainder 15 (which is hex 'F')
Reading remainders bottom-to-top yields 0xFA. Notice how 1111 1010 in binary directly splits into 1111 (F) and 1010 (A)!
Example 2: Converting Binary 101101₂ to Decimal
Expanding by powers of 2:
(1 × 2⁵) + (0 × 2⁴) + (1 × 2³) + (1 × 2²) + (0 × 2¹) + (1 × 2⁰)
= 32 + 0 + 8 + 4 + 0 + 1 = 45₁₀.
Quick Reference Table (Values 0 to 15)
| Decimal (Base 10) | Binary (4-Bit) | Octal (Base 8) | Hexadecimal (Base 16) |
|---|---|---|---|
| 0 | 0000 | 0 | 0 |
| 1 | 0001 | 1 | 1 |
| 2 | 0010 | 2 | 2 |
| 3 | 0011 | 3 | 3 |
| 4 | 0100 | 4 | 4 |
| 5 | 0101 | 5 | 5 |
| 6 | 0110 | 6 | 6 |
| 7 | 0111 | 7 | 7 |
| 8 | 1000 | 10 | 8 |
| 9 | 1001 | 11 | 9 |
| 10 | 1010 | 12 | A |
| 11 | 1011 | 13 | B |
| 12 | 1100 | 14 | C |
| 13 | 1101 | 15 | D |
| 14 | 1110 | 16 | E |
| 15 | 1111 | 17 | F |